Vim – Useful config

As developers, we spend a majority of our productive day interacting with code. How we interact with this code is often the last thing on our mind. Taking a step back and looking at our daily habits can often yield surprising results in productivity, and is a healthy thing to do once in a while.

If you see something missing from the following Vim config snippets, please leave a comment in order to update the article. 

» Automatic settings at start-up
First, you need to edit your config file, $HOME/.vimrc  and add the the commands you consider usefull:

» Restore cursor position to where it was before

» Remove any trailing whitespace that is in the file

» Syntax Highlighting

» Indentation

» Wild Menu. Tab auto-completion for commands

» Mouse support

» Backspace fix

» Line Numbers

» Ignorecase && Smartcase. Will perform case-insensitive search if you write the text in lowercase, or case-sensitive if your text have one or more chars in uppercase

» Incremental and highlighted search. Searches as you type and highlights it

» Status bar glariness 

» Paste mode on

» 1000 Undos

» No error bells

» No start of line

» Mac OSX Paste

» Misspell save

» Highlight current line

» Sudo save (actually covered here)

» Check operating system (cross-platform vimrc)

» Nerd tree plugin (Mac)
First, issue the following commands:

Update the ~/.vimrc file with this: