SHOW:
|
|
- or go back to the newest paste.
| 1 | " my ~/.vimrc file | |
| 2 | "-----------------------------------------BEGIN--------------------------------- | |
| 3 | ||
| 4 | - | " vim settings, rather than Vi settings (much better!). |
| 4 | + | " vim settings, rather than vi settings: must come first, because it changes other options as a side effect. |
| 5 | - | " this must be first, because it changes other options as a side effect. |
| 5 | + | |
| 6 | ||
| 7 | " switch syntax highlighting on | |
| 8 | syntax enable | |
| 9 | colorscheme koehler | |
| 10 | ||
| 11 | set omnifunc=syntaxcomplete#Complete | |
| 12 | ||
| 13 | ||
| 14 | " show line numbers | |
| 15 | set number | |
| 16 | ||
| 17 | " load filetype-specific indent files | |
| 18 | filetype indent on | |
| 19 | - | " This both turns on filetype detection and allows loading of language specific |
| 19 | + | |
| 20 | - | " indentation files based on that detection. For me, this means the python |
| 20 | + | |
| 21 | - | " indentation file that lives at ~/.vim/indent/python.vim gets loaded every time |
| 21 | + | |
| 22 | - | " I open a *.py file. |
| 22 | + | |
| 23 | ||
| 24 | " highlight matching brackets | |
| 25 | - | autocmd FileType python setlocal et sta sw=4 sts=4 |
| 25 | + | |
| 26 | - | autocmd FileType python set omnifunc=pythoncomplete#Complete |
| 26 | + | |
| 27 | - | autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS |
| 27 | + | |
| 28 | - | autocmd FileType html set omnifunc=htmlcomplete#CompleteTags |
| 28 | + | |
| 29 | - | autocmd FileType css set omnifunc=csscomplete#CompleteCSS |
| 29 | + | |
| 30 | - | autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags |
| 30 | + | |
| 31 | - | if has("autocmd") && exists("+omnifunc")
|
| 31 | + | |
| 32 | - | autocmd Filetype * |
| 32 | + | |
| 33 | - | \ if &omnifunc == "" | |
| 33 | + | |
| 34 | - | \ setlocal omnifunc=syntaxcomplete#Complete | |
| 34 | + | |
| 35 | - | \ endif |
| 35 | + | |
| 36 | - | endif |
| 36 | + | " normal backspace behaviour |
| 37 | set backspace=indent,eol,start | |
| 38 | ||
| 39 | ||
| 40 | " PEP8 compliance for python files | |
| 41 | set tabstop=4 " number of visual spaces per Tab | |
| 42 | set softtabstop=4 " number of spaces in tab when editing | |
| 43 | set shiftwidth=4 | |
| 44 | set textwidth=79 | |
| 45 | set expandtab " tabs are spaces | |
| 46 | set autoindent | |
| 47 | set fileformat=unix | |
| 48 | set autowrite | |
| 49 | ||
| 50 | set foldenable " enable folding | |
| 51 | set foldlevelstart=10 " open most folds by default | |
| 52 | set foldnestmax=10 " 10 nested fold max | |
| 53 | - | " make backspace behave in a sane manner |
| 53 | + | |
| 54 | set foldlevel=99 | |
| 55 | ||
| 56 | " highlight matches | |
| 57 | set hlsearch | |
| 58 | ||
| 59 | " search as characters are entered | |
| 60 | set incsearch | |
| 61 | ||
| 62 | " disable arrow keys, use hjkl instead | |
| 63 | noremap <Up> <NOP> | |
| 64 | noremap <Down> <NOP> | |
| 65 | noremap <Left> <NOP> | |
| 66 | noremap <Right> <NOP> |