-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
214 lines (159 loc) · 3.95 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
" enable all features
set nocompatible
" pathogen
filetype off
call pathogen#infect()
call pathogen#helptags()
filetype on
filetype indent on
filetype plugin on
" lower timeout length
set ttimeoutlen=100
" disable esckeys
set noesckeys
" disable word wrap
set nowrap
" use tabs, tabsize 4 spaces
set tabstop=4
set smarttab
set shiftwidth=4
set autoindent
set backspace=start,indent
" enable title
set title
" ruby
autocmd FileType ruby,eruby,cucumber set expandtab tabstop=2 shiftwidth=2 tabstop=2
autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete
autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1
autocmd FileType ruby,eruby let g:rubycomplete_rails = 1
autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1
" line numbers
set number
" highlight the searchterms
set hlsearch
" jump to matches while typing
set incsearch
" ignore case while searching if all lowercase
set ignorecase
set smartcase
" don't wrap words
set textwidth=0
" history and undo
set history=1000
set undolevels=1000
" show matching braces
set showmatch
" enable syntax highlighting
syntax on
set bg=dark
" enable 256 color terminal
set t_Co=256
" always show the menu, insert longest match
set completeopt=menuone,longest
" bash-like tab completion
set wildmode=longest,list,full
" allows changing buffer with unsaved changes
set hidden
" colorscheme
let g:solarized_termcolors=256
colorscheme solarized
set grepprg=ack-grep
set grepformat=%f:%l:%m
" statusline
set statusline=%t%m%r\ %{fugitive#statusline()}%=[%{&ff}%Y]\ [%04l,%04v,%p%%]
set laststatus=2
" highlight current line
"set cursorline
" show command
set showcmd
" disable F1 key
inoremap <F1> <ESC>
nnoremap <F1> <ESC>
vnoremap <F1> <ESC>
" movement by screenline instead of file line
nnoremap j gj
nnoremap k gk
" tabs
nnoremap <c-n> :tabnew<cr>
nnoremap <c-l> gt
nnoremap <c-h> gT
" set , as leader
let mapleader = ","
" toggle NERDTree with <leader>d
nnoremap <silent> <leader>d :NERDTreeToggle<cr>
" NERDTree size
let NERDTreeWinSize = 40
" NERDTree ignore files
let NERDTreeIgnore=['\~$', '\.6$']
" remove trailing white-spaces with <leader>W
nnoremap <leader>W :%s/\s\+$//<cr>:noh<CR>
" toggle word wrap
nnoremap <leader>w :set wrap!<cr>
" remove highlight on <leader><space>
nnoremap <leader><space> :noh<cr>
" compile with <leader>m
nnoremap <leader>m :make<cr>
" open browser
:command -bar -nargs=1 OpenURL :!sensible-browser <args>
" change default filetype back to 'tex' for latex files
let g:tex_flavor='latex'
" disable indentation for pasting
nnoremap <F2> :set invpaste<CR>
" bufexplorer: map b
nnoremap <silent> <unique> <leader>b :BufExplorer<CR>
" ignore files
set wildignore+=*.class,*.rbc,*.6
" ctrlp to <leader>v
let g:ctrlp_map = '<leader>v'
" only update ctrlp window after typing has stopped
let g:ctrlp_lazy_update = 1
" tagbar
nnoremap <silent> <leader>t :TagbarToggle<CR>
nnoremap <silent> <leader>T :TagbarOpenAutoClose<CR>
let g:tagbar_width = 60
" gitolite
autocmd FileType gitolite set expandtab tabstop=4 shiftwidth=4 tabstop=4
" tabular: align ruby symbols
nnoremap <leader>r: :Tabularize / :/l0<cr>
" enable matchit for vim-textobj-rubyblock plugin
runtime macros/matchit.vim
" gitv mapping
nnoremap <leader>k :Gitv<cr>
" go language code formatter
nnoremap <leader>f :Fmt<cr>
" godoc
nnoremap <leader>gd :Godoc
" ctrl+space for autocompletion
inoremap <Nul> <C-x><C-o>
" Use fancy symbols in statusline
let g:Powerline_symbols = "compatible"
" gundo
nnoremap <leader>u :GundoToggle<cr>
" go tagbar
let g:tagbar_type_go = {
\ 'ctagstype' : 'go',
\ 'kinds' : [
\ 'p:package',
\ 'i:imports:1',
\ 'c:constants',
\ 'v:variables',
\ 't:types',
\ 'n:interfaces',
\ 'w:fields',
\ 'e:embedded',
\ 'f:functions',
\ 'm:methods',
\ 'r:constructor'
\ ],
\ 'sro' : '.',
\ 'kind2scope' : {
\ 't' : 'ctype',
\ 'n' : 'ntype'
\ },
\ 'scope2kind' : {
\ 'ctype' : 't',
\ 'ntype' : 'n'
\ },
\ 'ctagsbin' : 'gotags',
\ 'ctagsargs' : '-sort -silent'
\ }