Tuesday, February 05, 2008

my vimrc backup

This is more like a backup for my vimrc file. Whenever I change to a new machine, I start missing my vim settings and memorizing stuff like this is not one of my good habits :).

set nocompatible

set backspace=indent,eol,start " allow backspacing over everything in insert mode
set nu " Set line numbering on
set nobackup " do not keep a backup file, use versions instead
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set incsearch " do incremental searching
map Q gq " Don't use Ex mode, use Q for formatting

" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
else
set term=xterm
endif
syntax on
set hlsearch

" Only do this part when compiled with support for autocommands.
if has("autocmd")

" Enable file type detection.
" Use the default filetype settings, so that mail gets 'tw' set to 72,
" 'cindent' is on in C files, etc.
" Also load indent files, to automatically do language-dependent indenting.
filetype plugin indent on

" For all text files set 'textwidth' to 78 characters.
autocmd FileType text setlocal textwidth=78

endif

" toggle paste / mouse mode
map :call InvertPasteAndMouse()
fun! InvertPasteAndMouse()
if &mouse == ''
set mouse=a | set nopaste
echo "mouse mode on, paste mode off"
else
set mouse= | set paste
echo "mouse mode off, paste mode on"
endif
endfunction

set tabstop=2
" set softtabstop=2
set shiftwidth=2
set expandtab
"set mouse=vc
set autoindent " always set autoindenting on
set smartindent

colorscheme desert

No comments: