Skip to content

Latest commit

 

History

History
51 lines (42 loc) · 4.5 KB

README.md

File metadata and controls

51 lines (42 loc) · 4.5 KB

Funding Circle vim configuration

Instructions

git clone http://github.com/FundingCircle/dotvim.git ~/.vim
ln -s ~/.vim/vimrc ~/.vimrc
cd ~/.vim/ && git submodule init && git submodule update

Custom Commands

NB: <leader> is defined as , (comma).

  • i: goes from normal mode to insert mode.
  • ii: goes to normal mode from insert mode.
  • cf: copies the current file name into the clipboard
  • R: pastes last contents of what was yanked regardless of what was deleted after
  • c: (from visual mode) copies the highlighted text into the clipboard
  • v: vertical split
  • h: horizontal split
  • j/k/h/l: moves to split in desired direction
  • p: opens fuzzy file finder
  • nt: toggles nerdtree
  • pt: toggles paste for better clipboard paste formatting
    • Use this before and after pasting formatted code into the current buffer

Bundles

  • ack lets you shell out to ack within vim using :Ack pattern [directory]. By default, results show up in the quickfix window. You can use :AckAdd to append to the quickfix window or prefix 'Ack' with an 'L' to use the location list (just like :grep's siblings).
  • ag is the above but for ag (a faster ack replacement)
  • auto-save Save the buffer after input like RubyMine.
  • ctrlp is a fuzzy file finder invoked by hitting Ctrl-P in normal mode and typing some part of the file name you'd like to open. This config also has ,f mapped to the same function.
  • vim-fugitive puts git into vim. It can do almost everything git related, some of the most useful features are:
    • :Gblame to blame the current file. Press enter on a commit to see the full commit. Do :Gedit to go back to the current version (or just open it again).
    • :Gread to check out the current file from git. Very useful if you made some experimental changes that you want to get rid of.
    • :Gbrowse to open the current file on GitHub, useful for sending links to other people.
  • jasmine Jasmine plugin for Vim
  • kwbd Add a buffer close to vim that doesn't close the window
  • nerdcommenter lets you comment and uncomment things. The most useful command is ,/ which comments or uncomments either the current line or the currently selected block. This config has ,/ mapped to the Toggle instead of ,c as listed in the docs (the rest of the commands use the c as listed).
  • nerdtree puts a directory tree on the left side of the screen. Press \ to open it at your project root, or Shift-\ to open it with the current file selected. You can press m to move, delete, or create files. Press ? inside the tree to get more help.
    • I: Shows/Hides hidden files
  • vim-rails lets gf and :Rextract work on partials, highlights Rails functions.
  • rspec Run Rspec spec from Vim
  • ruby-matchit 'Matchit' for Ruby.
  • supertab lets you press Tab after Ctrl-P or Ctrl-N to cycle through completion options.
  • vim-surround helps add/remove/change surround parentheses, quotes, and XML tags. Inside of "yolokitten", type cs"' to switch the surround double quotes to single quotes. t can generally be used to refer to XML tags, so inside of <tag>Hello</tag> you can do cit to modify the word "Hello." To add quotes around something, you can use the command ys followed by a motion and the character to surround it with. For instance, inside of "hello", typing ysiw( will change it to "( hello )".
  • syntastic runs your compiler or interpreter and displays syntax errors in vim. A >> in the gutter means there is an error on that line, you can mouse over it for more details.
  • ZoomWin lets you close all other windows with <C-w>o. You can restore all the closed windows with the same command. Useful with :tabo to close everything but what you're working on.