-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
270 lines (227 loc) · 7.03 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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
set nocompatible
filetype off
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
" Keep Plugin commands between vundle#begin/end.
" BEGIN plugins
" Plugins from github.
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-surround'
Plugin 'fholgado/minibufexpl.vim'
Plugin 'rbgrouleff/bclose.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'jmcantrell/vim-virtualenv'
Plugin 'fs111/pydoc.vim'
Plugin 'Shougo/denite.nvim'
Plugin 'Shougo/deoplete.nvim'
Plugin 'roxma/nvim-yarp'
Plugin 'roxma/vim-hug-neovim-rpc'
Plugin 'taq/vim-git-branch-info'
Plugin 'fatih/vim-go'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'majutsushi/tagbar'
Plugin 'pangloss/vim-javascript'
Plugin 'jelera/vim-javascript-syntax'
Plugin 'avakhov/vim-yaml'
Plugin 'tpope/vim-speeddating'
Plugin 'tpope/vim-unimpaired'
Plugin 'vim-scripts/utl.vim'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
" Plugins required by vim-orgmode
"Plugin 'jceb/vim-orgmode'
"Plugin 'tpope/vim-repeat'
"Plugin 'chrisbra/NrrwRgn'
"Plugin 'mattn/calendar-vim'
"Plugin 'inkarkat/vim-SyntaxRange'
" Exclude colorschemes from vundle, because I am using a custom blackboard
" colorcheme.
" Plugin 'flazz/vim-colorschemes'
" Better tasteful indentation.
Plugin 'hynek/vim-python-pep8-indent'
" Use kevinw/pyflakes-vim if only python is required.
Plugin 'scrooloose/syntastic'
" Disable this one possibly in favor of the other flake8 plugin.
" Plugin 'nvie/vim-flake8'
" The enhanced version
Plugin 'vim-scripts/python.vim--Vasiliev'
" Plugin from http://cscope.sourceforge.net/cscope_maps.vim, mirrored in
" github shown below.
Plugin 'simplyzhao/cscope_maps.vim'
" Colorscheme
Plugin 'altercation/vim-colors-solarized'
" Terraform!
Plugin 'hashivim/vim-terraform'
" Typescript
Plugin 'leafgarland/typescript-vim'
"
" END plugins
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
set enc=utf-8
set nocompatible
set backspace=indent,eol,start
set viminfo+=!
set hidden
set noswapfile
set vb t_vb=
syntax on
autocmd BufEnter * :syntax sync fromstart
colorscheme blackboard
set guifont="Monaco:h10"
set gfn=Monaco:h10
set nobackup
set nowritebackup
"filetype on
"filetype plugin on
"filetype plugin indent on
" Disabling this in favor of jedi-vim
" autocmd FileType python set complete+=k~/.vim/syntax/python.vim "isk+=.,(
set ruler
set guioptions-=T
set completeopt-=preview
set gcr=a:blinkon0
" We do not need to setnumber since I am now using Relative Numbering.
" RltvNmbr
set cmdheight=1
set laststatus=2
set statusline=[%l,%c\ %P%M]\ %f\ %r%h%w
if has("gui")
set lines=60
set number
endif
" git-branch-info.vim
set statusline+=%{GitBranchInfoString()}
let g:git_branch_status_head_current=1
let g:git_branch_status_nogit=""
let g:git_branch_status_text=""
" set smarttab
" set smartindent
" set expandtab
" set tabstop=4
" set shiftwidth=4
" set softtabstop=4
inoremap <Silent> <Tab> <C-R>=(col('.') > (matchend(getline('.'), '^\s*') + 1))?'<C-V><C-V><Tab>':'<Tab>'<CR>
" Key mappings
map <F11> :NERDTreeToggle<CR>
map <F5> :bp<CR>
map <F6> :bn<CR>
map <F7> :bd<CR>:syntax on<CR>
" MiniBufExplorer.
let g:miniBufExplMapWindowNavVim = 1
" let g:miniBufExplMapWindowNavArrows = 1
" let g:miniBufExplMapCTabSwitchBufs = 1
" let g:miniBufExplMapCTabSwitchBufs = 1
" Mimic Ctab behavior
" If you like <C-TAB> and <C-S-TAB> to switch buffers
" in the current window then perform the remapping
"
noremap <C-TAB> :MBEbn<CR>
noremap <C-S-TAB> :MBEbp<CR>
let g:miniBufExplModSelTarget = 1
"##############################################################################
"" Easier split navigation
"##############################################################################
"
"" Use ctrl-[hjkl] to select the active split!
nmap <silent> <c-k> :wincmd k<CR>
nmap <silent> <c-j> :wincmd j<CR>
nmap <silent> <c-h> :wincmd h<CR>
nmap <silent> <c-l> :wincmd l<CR>
" Omni-complete should work with C-x C-o
" the lines below are just for extra help.
let python_highlight_all = 1
let Tlist_Ctags_Cmd = "/usr/local/bin/ctags"
let Tlist_Use_Right_Window = 1
" Turn this on to highlight text over 'OverLength'
"highlight OverLength ctermbg=red ctermfg=white guibg=#592929
"match OverLength /\%81v.\+/
" GRB: use fancy buffer closing that doesn't close the split
cnoremap <expr> bd (getcmdtype() == ':' ? 'Bclose' : 'bd')
" Flake8 run on save.
" autocmd BufWritePost *.py call Flake8()
"
" set splitbelow
" set splitright
"
let g:virtualenv_directory = '/Users/karthik/.venv'
" Enable syntastic underlining
let g:syntastic_enable_highlighting = 1
"let g:syntastic_python_flake8_args = '--ignore=E121,E122,E123,E124,E125,E126,E127,E128,E711,E712,H233,H302,H303,H404,F403,F811,F841,N309'
let g:syntastic_auto_loc_list=0
let g:syntastic_check_on_open = 1
let g:syntastic_go_checkers = ['golint', 'govet', 'errcheck']
let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] }
" NerdTREE settings
let NERDTreeIgnore=['\.o$', '\.pyc$']
" vim-go settings
let g:go_highlight_types = 1
let g:go_highlight_fields = 1
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_structs = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
let g:go_fmt_autosave = 0
let g:go_def_mode='gopls'
" tagbar settings for golang
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',
\ 'm:methods',
\ 'r:constructor',
\ 'f:functions'
\ ],
\ 'sro' : '.',
\ 'kind2scope' : {
\ 't' : 'ctype',
\ 'n' : 'ntype'
\ },
\ 'scope2kind' : {
\ 'ctype' : 't',
\ 'ntype' : 'n'
\ },
\ 'ctagsbin' : 'gotags',
\ 'ctagsargs' : '-sort -silent'
\ }
let g:terraform_align=1
let g:terraform_fold_sections=1
let g:terraform_remap_spacebar=1
let g:terraform_commentstring='//%s'
let g:terraform_fmt_on_save=1
" Shougo/deoplete.nvim
let g:deoplete#enable_at_startup = 1
call deoplete#custom#option('omni_patterns', { 'go': '[^. *\t]\.\w*' })
" Shougo/denite.nvim
noremap <C-l> :Denite buffer file/rec file<CR>
autocmd FileType denite call s:denite_my_settings()
function! s:denite_my_settings() abort
nnoremap <silent><buffer><expr> <CR>
\ denite#do_map('do_action')
nnoremap <silent><buffer><expr> d
\ denite#do_map('do_action', 'delete')
nnoremap <silent><buffer><expr> p
\ denite#do_map('do_action', 'preview')
nnoremap <silent><buffer><expr> q
\ denite#do_map('quit')
nnoremap <silent><buffer><expr> i
\ denite#do_map('open_filter_buffer')
nnoremap <silent><buffer><expr> <Space>
\ denite#do_map('toggle_select').'j'
endfunction