Working with Windows in Vim
This section shamelessly borrowed from Benjamin Kuperman
:e filename - edit another file :split filename - split window and load another file ctrl-w up arrow - move cursor up a window ctrl-w ctrl-w - move cursor to another window (cycle) ctrl-w_ - maximize current window ctrl-w= - make all equal size 10 ctrl-w+ - increase window size by 10 lines :vsplit file - vertical split :sview file - same as split, but readonly :hide - close current window :only - keep only this window open :ls - show current buffers1 :b 2 - open buffer #2 in this window
Sudo from VIM
Sometimes you want to write to a read only file without losing your work or saving to a temporary file.
:w !sudo tee <FileName>
Change default TAB keystroke to 4 spaces
If you're doing any Programming in Python you definitely want to add this to your .vimrc.
set smartindent set tabstop=4 set shiftwidth=4 set expandtab
Add this to your .bashrc
Reload your bash settings.
Brighten the commented text in VIM!
If you have permission ( Not just access ) to make changes to the root environment:
echo "set background=dark" >> /etc/vimrc
If you don't control root and only have access to your home folder :
echo "set background=dark" >> ~/.vimrc