Skip to content

Instantly share code, notes, and snippets.

@calvinalvin
Last active March 9, 2022 00:14
Show Gist options
  • Save calvinalvin/c8fa5b3455cc1cb1978d4acd5f4d9585 to your computer and use it in GitHub Desktop.
Save calvinalvin/c8fa5b3455cc1cb1978d4acd5f4d9585 to your computer and use it in GitHub Desktop.
Vim development environment setup

Vim Upgrade to 8

  • brew install vim then update .zshrc to point to new vim with alias vim="/usr/local/bin/vim"

Instructions on setting up vim env for development

  • Install vim-pathogen https://github.com/tpope/vim-pathogen. This is for vim plugins.
  • Install NERDTree for folder list view https://github.com/scrooloose/nerdtree. (clone inside ~/.vim./bundle)
  • Install fzf to replace search. https://github.com/junegunn/fzf. Do brew install fzf and install this globally on the machine. This a replacement file searcher for the OS.
  • Install silver searcher https://github.com/ggreer/the_silver_searcher. brew install the_silver_searcher
  • Install fzf-vim to add fzf functionality inside vim. https://github.com/junegunn/fzf.vim (clone inside ~/.vim./bundle)
  • Install delimitMate https://github.com/Raimondi/delimitMate to automatically bracket match (clone inside ~/.vim/bundle)
  • Install https://github.com/pangloss/vim-javascript (clone inside ~/.vim/bundle)
  • Install https://github.com/leafgarland/typescript-vim (clone inside ~/.vim/bundle)
  • Install https://github.com/w0rp/ale for linting (clone inside ~/.vim/bundle)
  • Install https://github.com/neoclide/coc.nvim/ for code autocomplete intellisense like you get in vscode. (clone inside ~/.vim/bundle, then you will need to yarn install node dependencies from that project since coc.vim is written in typescript and runs a node server). From within the vim editor you will need to run vim command :CocInstall coc-json coc-tsserver to install completion extensions for typescript & json.
  • For syntax higlighting: https://github.com/vim-syntastic/syntastic.git (clone inside ~/.vim/bundle)
  • For commenting out blocks of code: https://github.com/tomtom/tcomment_vim.git. To use, enter visual block mode and highlight the lines you want to comment out then type gcc. Why gcc? I don't know.

Install colorscheme

Download a new Vim color scheme – “distinguished“ https://github.com/Lokaltog/vim-distinguished. Extracts and move the downloaded *.vim file to this folder ~/.vim/colors/.

Or gruvbox is another color scheme https://github.com/morhetz/gruvbox

mv ~/Downloads/vim-distinguished-develop/colors/*.vim ~/.vim/colors/

Copy

P.S Create the folders if not exists.

Edit the vim ~/.vimrc file, enable the syntax highlight and set the colorscheme to “distinguished”. ~/.vimrc

syntax on
colorscheme distinguished

Python support

Install zsh-autocomplete

This is nice plugin for zsh that let's autocomplete from history: https://github.com/zsh-users/zsh-autosuggestions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment