first real commit, started clean
[dotfiles.git] / .vimrc
1 execute pathogen#infect()
2 filetype indent plugin on
3 syntax enable
4 colorscheme elflord
5
6 set encoding=utf-8
7 set history=1000
8 set number
9 set ruler
10 set backspace=eol,start,indent
11 set whichwrap+=<,>,h,l
12 set incsearch
13 set noerrorbells
14 set novisualbell
15 set nobackup
16 set nowb
17 set noswapfile
18 set shiftwidth=2
19 set tabstop=2
20 set foldmethod=indent
21 set foldnestmax=2
22 set nofoldenable
23 set cc=80
24 set textwidth=79
25
26 " Source the vimrc while editing
27 autocmd! bufwritepost .vimrc source %
28
29 " Tab Mappings
30 map <TAB>l <C-W>l
31 map <TAB>h <C-W>h
32 map <TAB>j <C-W>j
33 map <TAB>k <C-W>k
34
35 " Search results stay in middle of screen
36 nnoremap n nzzzv
37 nnoremap N Nzzzv
38
39 " Unmap the arrow keys!!!
40 for prefix in ['i', 'n', 'v']
41 for key in ['<Up>', '<Down>', '<Left>', '<Right>']
42 exe prefix . "noremap " . key . " <Nop>"
43 endfor
44 endfor
45
46 " Load all the skeletons for newfiles
47 for i in split(globpath('~/.vim/skel/', './*'), '\n')
48 let extension = split(i, "/")[-1]
49 exe "au BufNewFile *." . extension . " 0r ~/.vim/skel/" . extension
50 endfor
51
52 let mapleader="'"
53 map <leader>n :NERDTreeToggle<CR>