These are the new Codegram vimfiles!
If you trust me, do this:
rm -fR ~/.vim && git clone https://github.com/codegram/vimfiles.git ~/.vim && rm ~/.vimrc && ln -s ~/.vim/vimrc ~/.vimrc && git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle && vim +BundleInstall +qa! && cd ~./vim/bundle/vimproc.vim && make && clear && echo "Done! :)"
Clone this repo:
$ git clone https://github.com/codegram/vimfiles.git ~/.vim $ rm ~/.vimrc && ln -s ~/.vim/vimrc ~/.vimrc
$ git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
Set up your
~/vimrc.local with your custom plugins, themes, for example:
" Color theme Bundle 'sjl/badwolf' colorscheme badwolf
Open up Vim, and issue this command:
Now compile the vimproc extension:
cd ~/.vim/bundle/vimproc.vim && make
TA-DA! Everything's done!
- The leader key is
,nrenames current file, asking for the new name.
- Arrow keys are disabled.
jkis mapped to
<ESC>, so you don't have to reach out to
,<Space>clears the search.
:w!: it saves the current buffer.
:wqa!: it saves all buffers and quits.
<S-tab>rotates among open buffers.
<leader>dcloses the current buffer.
<leader>Dcloses ALL the buffers.
,vopens a new vertical split and switches to it.
<C-h>switches to the left split.
<C-j>switches to the split below.
<C-k>switches to the split above.
<C-l>switches to the right split.
,truns the current test file (RSpec, MiniTest or Cucumber).
,Truns the specific test under the cursor (RSpec or Cucumber).
<F2>to toggle Paste mode (to paste stuff from the system clipboard).
,gbin Visual mode to perform a
git blameon the selected lines.
Use Ag (the silver searcher) to search through your code.
,aperforms an Ag search.
<C-p>: Rotate among results.
Auto-closes, parens, curly braces, everything.
brew install ctags and run the
ctags -R . command on your working
directory to generate the tag list.
<C-]>to go to the definition of the word under the cursor (constant, method, whatever
<C-p>to come back.
<F9>to rotate among multiple definitions of the same tag.
<Leader>cto search among tags with the CtrlP plugin.
<Leader>bto toggle the Tagbar
end after a method definition, if clause, etc. (Ruby)
Use Git from Vim.
,gs: Git status.
,gc: Git commit.
:Gist [-p|-P]: Post a [p]rivate or [P]ublic gist with the current buffer. You can also run it from Visual mode to post only a part.
Integration with Rails.
cs"'changes surround from
ysiw"surrounds inside the word with
Comments any kind of code.
,co: In visual mode, comments the selected block.