/dotfiles

Dotfiles / ✨Vim✨ setup

Primary LanguageLua

Dotfiles / ✨Vim✨ setup

vimrc to make nvim look like this: Screenshot 2024-06-18 at 10 40 13 AM

or this with vanilla vim: Screen Shot 2022-12-21 at 3 53 26 PM

or this with skinnyvimrc (use if you don't want to install a separate theme/font) Screen Shot 2023-01-03 at 9 34 02 PM

Vim

Install

  1. Copy this vimrc cp skinnyvimrc ~/.vimrc or cp vimrc ~/.vimrc
  2. Open vim and install plugs: :PlugInstall
  3. Source: :source ~/.vimrc
  4. Install :ag search: apt-get install silversearcher-ag or brew install the_silver_searcher
  5. For autocomplete, install YouCompleteMe (needs root)
    the Linux instructions lie, use:
    cd ~/.vim/plugged/YouCompleteMe
    python3 install.py --all
    

Make fonts and theme pretty (not needed for skinnyvimrc)

  1. Set Nord in iterm theme (install here for Terminal)
  2. Download Inconsolata Nerd Font and set as terminal font for nice ligatures and icons

How to use

my fav vim commands

Searching

  • Ctrl+P: Search for file name
  • <space>l: Search for file name in same directory as this file
  • <space>ag: Search for word under cursor across all files in directory
  • :Ag stringIWantToSearchFor: Search for word across all files in directory

Misc

  • [Ctrl+N] Show files with NERDTree
  • <space>pr Format file

LSP (Language Server Protocol) - shows errors/warnings, definitions, etc as you type like VSCode would

  • :LspInstallServer Install language server for currently opened file's language (you might need additional installs)
  • See vim-lsp for commands

Nvim

Install nvim (for universal linux):

curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim.appimage
chmod u+x nvim.appimage
./nvim.appimage

Copy the nvim folder to ~/.config/nvim. This contains lazy.nvim configs. see https://www.lazyvim.org/ for more info cp -r nvim ~/.config/nvim Install ripgrep for search (something was weird with ag): sudo apt-get install ripgrep or brew install ripgrep The apt install neovim is really old so we have to build from source: Install lua: sudo apt install lua5.3

Other setup

Other setup

  • install ohmyzsh sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" and cp zshrc ~/.zshrc
  • Good Ubuntu theme: budgie arc-dark with mcmojave-circle-pink
  • for rust, remember to install rustfmt apt install rustfmt or something otherwise neoformat doesn't work