This Vim configuration is meant to make Vim feel more like an IDE than a simple console-based text editor. I use it mostly under with MacVIM and Linux GVim though I occasionally run it directly in a terminal.
Run these commands to get this Vim configuration working on your OS X or Linux machine.
You can run git pull inside of ~/.vim if you'd ever like to grab the latest version.
cd ~
git clone https://github.com/nickelchen/vimrc.git .vim
ln -s ~/.vim/vimrc ~/.vimrc # Optional, needed for some VIM installationsThis method might be more sane. Simply downlaod the latest version, extract to ~/.vim, and configure to your liking.
wget https://github.com/nickelchen/vimrc/archive/master.zip- Edit many files at the same time
- File Browser on left side of screen
- Move between files in center screen
- View status of the current GIT repo, if applicable
- Additional features when running under MacVIM
- Quickly navigate to files using a fuzzy finder
As of v0.2.0, the Leader key is now bound to Space (used to be Comma)
- Use
<Leader>qto close the current file (a different file will appear in its place) - Use
Ctrl hCtrl lto move between open files Ctrl LeftCtrl Rightalso works for switching between files- While in MacVIM, you can swipe left and right to switch between open files
- Use
Cmd Shift N(orAlt nin Linux GVim) to open a new empty buffer
- Use
<Leader>h<Leader>j<Leader>k<Leader>lto navigate between viewports - Use
<Leader>Qto close the current window (you probably won't ever need to do this) - Use
<Leader>nto toggle the file browser - Use
Ctrl Pto perform a recursive fuzzy filename search - Use
<Leader>aand type a phrase to search to search based on content within your files (quote and escape if needed) - Use
<Leader>Ato close the open ack search results at the bottom of the screen
- Use
<Leader>nto toggle the file browser - Use standard movement keys to move around
- Use
Ctrl jandCtrl kto move between siblings (aka skip over children in expanded folders) - Use
Cto make the highlighted node the current working directory - Use
:Bookmark BookmarkNameto bookmark the current selection - Use
Bto toggle the bookmark menu - Use
?if you'd like some NERDTree documentation - Use
oto open the selected file in a new buffer - Use
tto open the selected file in a new tab
- Use
Cmd t(orAlt tin Linux GVim) to open a new tab - Use
Cmd w(orAlt win Linux GVim) to close the current tab - Use
Cmd 1toCmd 9(orAlt 1toAlt 9in Linux GVim) to navigate to the specified tab
There is a very large collection of colorschemes in this repository.
Many of them can be seen here.
Set the scheme using :colorscheme NAME.
- Use
<Leader>xto switch to a random theme.
Other than the myriad of built-in methods for navigating text...
- Use
<Leader><Leader>bto highlight and jump to previous words - Use
<Leader><Leader>wto highlight and jump to following words
- Use
zcto close fold - Use
zoto open fold
- Use
<Leader>cto copy the highlighted text into the OS clipboard - Use
<Leader>vto paste the OS clipboard into the document
Smooth scroll is disabled by default.
- Use
<F3>to toggle smooth scroll
Use <F4> to toggle mouse support
Type S to replace in current buffer
Type P to replace in whole project, you need to replace --old-- and --new-- with text you want
Use vim-surround [https://github.com/tpope/vim-surround] to add surroundings to text.
Use cs"( to replace "" with (), in normal mode
Use ds" to delete "" surrounds, in normal mode
Use S) to surround visual text with (), in visial mode
Type :w!!, which is equal to :w !sudo tee %
