VIM Run Command (~/.vimrc)

Yes, yet another VIM Run Command file (~/.vimrc). Enough said, read the comments for information on the commands if needed. Use it as you please, feel free to change anything to suit your needs.

Also, a nice resource for tips and tricks for better and easier VIM usage is http://vim.wikia.com/wiki/Main_Page.

" turn line numbers on
set number

" syntax on in terminals which can display color
if has('syntax') && (&t_Co > 2)
syntax on
endif

" set buffer history (i like large ints)
set history=500

" enable mnouse all the time (excluding tty's of cause)
set mouse=a

" no wrapping or hiphopping
set nowrap

" use indents of 3 spaces, and have them copied down lines:
set shiftwidth=3
set shiftround
set expandtab
set autoindent
set tabstop=3

set formatoptions-=t
set textwidth=79

filetype on

autocmd FileType c,cpp,slang set cindent

set et
set sw=3
set smarttab

set ch=2

" indent blank lines!
imap <CR> <CR> <BS>

" firefox like tabbing
" nmap <C-w> :wq<CR>
" nmap <C-x> :q<CR>
nmap <C-n> :tabn<CR>
nmap <C-p> :tabp<CR>
nmap <C-t> :tabnew<CR>

" imap <C-w> <ESC>:wq<CR>
imap <C-n> <ESC>:tabn<CR>
imap <C-p> <ESC>:tabp<CR>
imap <C-t> <ESC>:tabnew<CR>

" control + o for save
imap <C-o> <ESC>:w<CR>i<right>
map <C-o> :w<CR>i

" easy undo

imap <C-u> <ESC>:u<CR>
map <C-u> :u<CR>

set nocompatible
filetype on
filetype plugin on

Feedback