-
Notifications
You must be signed in to change notification settings - Fork 12
/
.vimrc
143 lines (113 loc) · 3.14 KB
/
.vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
set nocp
set directory=~/.vim/tmp
set backupskip=/tmp/*,/private/tmp/*
" Manage multiple buffers
set hidden
" Use the file's name in the title
set title
" No annoying beep
"set visualbell
" Turn on syntax highlighting
syntax on
" Background, colorscheme, etc
set background=dark
" Utility features
set ruler
set number
set cursorline
set history=1000
set bs=2
" Set the terminal font encoding
set encoding=utf-8
set termencoding=utf-8
" Turn plugin features on
filetype on
filetype plugin on
filetype indent on
set autoindent
set showmatch
" Bash-like tab completion
set wildmenu
set wildchar=<Tab>
set wildmode=list:longest
set wildignore+=*.pyc,.hg,.git,.svn
" Mouse options
set mouse=a
set mousemodel=popup
" Spacing and tabbing
set smarttab
set expandtab
set tabstop=4
set softtabstop=4
set shiftwidth=4
set textwidth=100
set nowrap
" Split manipulation
set wmh=0
nmap + :resize <CR>
nmap - :resize -1000<CR>
nmap = :wincmd =<CR>
nmap [ :wincmd k<CR>:resize<CR>
nmap ] :wincmd j<CR>:resize<CR>
" Command Timeouts
set timeout
set ttimeout
set ttimeoutlen=10
set timeoutlen=10
" Tab navigation
nmap <F4> :tabnew<CR>
nmap <F5> :tabp<CR>
nmap <F6> :tabn<CR>
" Scrolling context
set scrolloff=3
" Map leader to ,
let mapleader = ","
" Shortcuts
au Filetype php noremap ; :!php -l %<CR>
au Filetype sh noremap ; :!bash -n %<CR>
au Filetype bash noremap ; :!bash -n %<CR>
au Filetype ruby noremap ; :!ruby -c %<CR>
au Filetype python noremap ; :!python -m py_compile %<CR>
au Filetype javascript noremap ; :call JSHint()<CR>
" Scrolling speed
nnoremap <C-e> 5<C-e>
nnoremap <C-y> 5<C-y>
" Filetype-specific formatting
set formatoptions+=t,c,r,o,n
au FileType c,cpp,h set cindent formatoptions+=ro
au FileType c set omnifunc=ccomplete#Complete
au FileType css set omnifunc=csscomplete#CompleteCSS
au FileType html,xhtml,xml set omnifunc=htmlcomplete#CompleteTags tw=0
au FileType javascript set omnifunc=javascriptcomplete#CompleteJS
au FileType make set noexpandtab shiftwidth=8
au FileType php set omnifunc=phpcomplete#CompletePHP
au FileType python set omnifunc=pythoncomplete#Complete et sw=4 sts=4 ts=4 ai
au FileType ruby set omnifunc=rubycomplete#Complete
au FileType tex SPCheck
au FileType tex let dialect='US'
au Syntax {cpp,c,idl} runtime syntax/doxygen.vim
au BufRead,BufNewFile PKGBUILD set ts=2 sts=2 et sw=2
au BufNewFile,BufRead .Xdefaults* set filetype=xdefaults
au BufNewFile,BufRead *.lss set filetype=less
au BufNewFile,BufRead *.less set filetype=less
au BufNewFile,BufRead *.css set filetype=less
" Completion
inoremap <Nul> <C-x><C-p>
" Status line settings
set laststatus=2
set statusline=%-3.3n\ %f%(\ %r%)%(\ %#WarningMsg#%m%0*%)%=(%l/%L,\ %c)\ %P\ [%{&encoding}:%{&fileformat}]%(\ %w%)\ %y
set shortmess+=aI
hi StatusLine term=inverse cterm=NONE ctermfg=red ctermbg=white
hi StatusLineNC term=none cterm=NONE ctermfg=darkgray ctermbg=lightgray
" Folding
if has("folding")
set foldenable
set foldmethod=marker
set foldopen=hor,mark,search,tag,undo
endif
hi Folded term=standout ctermfg=3 ctermbg=none
" Searching & Replacing
set hlsearch
" Enable extended % matching
runtime macros/matchit.vim
execute pathogen#infect()