BriansNotes: .vimrc

File .vimrc, 2.1 KB (added by brian, 2 years ago)
Line 
1set nocompatible
2
3" allow backspacing over everything in insert mode
4set backspace=indent,eol,start
5
6set history=50          " keep 50 lines of command line history
7set ruler               " show the cursor position all the time
8set showcmd             " display incomplete commands
9set incsearch           " do incremental searching
10
11" Don't use Ex mode, use Q for formatting
12map Q gq
13
14" Switch syntax highlighting on, when the terminal has colors
15" Also switch on highlighting the last used search pattern.
16if &t_Co > 2 || has("gui_running")
17  syntax on
18  set hlsearch
19endif
20
21" Only do this part when compiled with support for autocommands.
22if 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
47else
48
49  set autoindent                " always set autoindenting on
50
51endif " 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.
55command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis
56                \ | wincmd p | diffthis
57
58set nobackup
59set ts=3
60set sw=3
61set backspace=2
62set expandtab
63set textwidth=120
64
65filetype on
66
67colorscheme Dark
68imap <S-Tab> <C-n>
69nnoremap <Tab> :bnext<CR>
70nnoremap <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