| 1 | set nocompatible |
|---|
| 2 | |
|---|
| 3 | " allow backspacing over everything in insert mode |
|---|
| 4 | set backspace=indent,eol,start |
|---|
| 5 | |
|---|
| 6 | set history=50 " keep 50 lines of command line history |
|---|
| 7 | set ruler " show the cursor position all the time |
|---|
| 8 | set showcmd " display incomplete commands |
|---|
| 9 | set incsearch " do incremental searching |
|---|
| 10 | |
|---|
| 11 | " Don't use Ex mode, use Q for formatting |
|---|
| 12 | map Q gq |
|---|
| 13 | |
|---|
| 14 | " Switch syntax highlighting on, when the terminal has colors |
|---|
| 15 | " Also switch on highlighting the last used search pattern. |
|---|
| 16 | if &t_Co > 2 || has("gui_running") |
|---|
| 17 | syntax on |
|---|
| 18 | set hlsearch |
|---|
| 19 | endif |
|---|
| 20 | |
|---|
| 21 | " Only do this part when compiled with support for autocommands. |
|---|
| 22 | if has("autocmd") |
|---|
| 23 | |
|---|
| 24 | " Enable file type detection. |
|---|
| 25 | " Use the default filetype settings, so that mail gets 'tw' set to 72, |
|---|
| 26 | " 'cindent' is on in C files, etc. |
|---|
| 27 | " Also load indent files, to automatically do language-dependent indenting. |
|---|
| 28 | filetype plugin indent on |
|---|
| 29 | |
|---|
| 30 | " Put these in an autocmd group, so that we can delete them easily. |
|---|
| 31 | augroup vimrcEx |
|---|
| 32 | au! |
|---|
| 33 | |
|---|
| 34 | " For all text files set 'textwidth' to 78 characters. |
|---|
| 35 | autocmd FileType text setlocal textwidth=78 |
|---|
| 36 | |
|---|
| 37 | " When editing a file, always jump to the last known cursor position. |
|---|
| 38 | " Don't do it when the position is invalid or when inside an event handler |
|---|
| 39 | " (happens when dropping a file on gvim). |
|---|
| 40 | autocmd BufReadPost * |
|---|
| 41 | \ if line("'\"") > 0 && line("'\"") <= line("$") | |
|---|
| 42 | \ exe "normal! g`\"" | |
|---|
| 43 | \ endif |
|---|
| 44 | |
|---|
| 45 | augroup END |
|---|
| 46 | |
|---|
| 47 | else |
|---|
| 48 | |
|---|
| 49 | set autoindent " always set autoindenting on |
|---|
| 50 | |
|---|
| 51 | endif " has("autocmd") |
|---|
| 52 | |
|---|
| 53 | " Convenient command to see the difference between the current buffer and the |
|---|
| 54 | " file it was loaded from, thus the changes you made. |
|---|
| 55 | command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis |
|---|
| 56 | \ | wincmd p | diffthis |
|---|
| 57 | |
|---|
| 58 | set nobackup |
|---|
| 59 | set ts=3 |
|---|
| 60 | set sw=3 |
|---|
| 61 | set backspace=2 |
|---|
| 62 | set expandtab |
|---|
| 63 | set textwidth=120 |
|---|
| 64 | |
|---|
| 65 | filetype on |
|---|
| 66 | |
|---|
| 67 | colorscheme Dark |
|---|
| 68 | imap <S-Tab> <C-n> |
|---|
| 69 | nnoremap <Tab> :bnext<CR> |
|---|
| 70 | nnoremap <S-Tab> :bprevious<CR> |
|---|
| 71 | |
|---|
| 72 | "autocmd FileType python set omnifunc=pythoncomplete#Complete |
|---|
| 73 | "autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS |
|---|
| 74 | "autocmd FileType html set omnifunc=htmlcomplete#CompleteTags |
|---|
| 75 | "autocmd FileType css set omnifunc=csscomplete#CompleteCSS |
|---|