vim: The Best Text Editor

I love vim. I don't know why and I'm not going to try to convince you to love it.

vim settings

To change vim settings, you need to change the vimrc file. On Linux, this is at: ~/.vimrc. On Windows, this is at: C:\Users\<username>\_vimrc. I also use gvim a lot which is vim with a gui. After all a mouse is pretty useful. Settings for gvim are found in the gvimrc file in the same location as the vimrc file.

My vimrc file for all platforms

   set expandtab           " tabs to spaces
   set shiftwidth=3        " four spaces for tabs
   set softtabstop=3       " columns for a tab in insert mode
   set autoindent          " indent to same level
   set number              " line numbers
   set colorcolumn=73      " Add line in column 81
   set hlsearch            " highlight searches
   set incsearch           " start highlighting in search immediately
   set wrap                " wrap text
   syntax on               " Turn on syntax highlighting
   set showmatch           " Show matching braces
   set linebreak           " Wrap at words
   colorscheme elflord     " Common dark colorscheme
   set ruler               " Show character number info
   " For makefiles, require tabs and not spaces
   autocmd FileType make set noexpandtab
   autocmd FileType make set tabstop=3

My gvimrc file for Windows

   set nobackup              " Turn off backups after quit
   set nowritebackup         " Turn off backups during edit
   set noundofile            " Turn off persistent undo
   set lines=45 columns=90   " Number of lines and columns (used on linux too)
   set guifont=Consolas:h11  " Font
   set bs=2                  " Backspace behavior needed on Windows