Supercharging Vim
Let's start by opening a new hidden file called .vimrc
in our home
folder and pasting a few lines:
set nocompatible filetype off " Settings to replace tab. Use :retab for replacing tab in existing files. set tabstop=4 set shiftwidth=4 set expandtab " Have Vim jump to the last position when reopening a file if has("autocmd") au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif " Other general vim options: syntax on set showmatch " Show matching brackets. set ignorecase " Do case insensitive matching set incsearch " show partial matches for a search phrase set nopaste set number set undolevels=1000
Now let's close and reopen the file, so that we can see the configuration take effect. Let's go into a little more detail regarding some of the options.
First of all, as you've probably guessed, the lines starting with "
are comments, so they can be ignored. Lines 5, 6, and 7 tell vim
to always use...