-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
236 lines (186 loc) · 5.87 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
" general settings
set nocompatible
set incsearch
set ignorecase smartcase
set autoindent
set tabstop=2 softtabstop=2 sw=2 expandtab
set shiftround
set showmatch
set cindent
set nu!
set wildmode=longest:full
set wildmenu
" Remap <leader> to ','
let mapleader = ","
" Vundle
filetype off
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
set rtp+=~/.vim/bundle/vundle/
call vundle#rc('~/.vim/vundle')
Bundle 'gmarik/vundle'
Bundle 'vim-ruby/vim-ruby'
Bundle 'scrooloose/nerdcommenter'
Bundle 'The-NERD-tree'
Bundle 'scrooloose/syntastic'
Bundle 'tpope/vim-fireplace'
Bundle 'tpope/vim-classpath'
Bundle 'tpope/vim-surround'
Bundle 'tpope/vim-rails'
Bundle 'guns/vim-clojure-static'
Bundle 'vim-scripts/yavdb'
Bundle 'benmills/vimux'
Bundle 'sjl/gundo.vim'
Bundle 'tristen/vim-sparkup'
Bundle 'LaTeX-Box-Team/LaTeX-Box'
Bundle 'jgdavey/vim-turbux'
Bundle 'Valloric/YouCompleteMe'
Bundle 'mileszs/ack.vim'
Bundle 'kien/ctrlp.vim.git'
Bundle 'altercation/vim-colors-solarized.git'
" Experimental plugins
Bundle 'christoomey/vim-tmux-navigator'
Plugin 'SirVer/ultisnips'
Plugin 'honza/vim-snippets'
Bundle 'bling/vim-airline'
Bundle 'kien/rainbow_parentheses.vim'
Bundle 'tpope/vim-repeat.git'
Bundle 'AndrewRadev/switch.vim'
Plugin 'JamshedVesuna/vim-markdown-preview'
Bundle 'vim-airline/vim-airline-themes'
Plugin 'fatih/vim-go'
Plugin 'hynek/vim-python-pep8-indent'
Plugin 'rust-lang/rust.vim'
Bundle 'pangloss/vim-javascript'
filetype plugin indent on
syntax on
set background=dark
colorscheme solarized
" map escape to kj
inoremap kj <Esc>
" Open NERDTree with the current directory
map <leader>nt :NERDTree<CR>
" Open NERDTree with the current file
map <leader>ntf :NERDTreeFind<CR>
" Open Gundo
map <leader>gu :GundoToggle<CR>
" Open CtrlP
map <leader>cp :CtrlP<CR>
" Clear the search highlights
map <leader><Space> :noh<CR>
" Look for the word under the cursor
nmap <leader>ack :execute("Ack '\\b" . expand("<cword>") . "\\b'")<CR>
" Run the current go file
au FileType go nmap <leader>r <Plug>(go-run)
" Build the current go file
au FileType go nmap <leader>b <Plug>(go-build)
" Test the current go file
au FileType go nmap <leader>t <Plug>(go-test)
" Run coverage on the current go file
au FileType go nmap <leader>c <Plug>(go-coverage)
" Open the relevant Godoc for the word under the cursor
au FileType go nmap <Leader>gd <Plug>(go-doc)
" Open the Godoc in browser
au FileType go nmap <Leader>gb <Plug>(go-doc-browser)
" Show a list of interfaces which is implemented by the type under your cursor
au FileType go nmap <Leader>s <Plug>(go-implements)
" Show time info about the word under the cursor
au FileType go nmap <Leader>i <Plug>(go-info)
" Rename a variable in the current go file
au FileType go nmap <Leader>e <Plug>(go-rename)
" Go to definition in a split
au FileType go nmap <Leader>ds <Plug>(go-def-split)
" Go to definition in a vertical split
au FileType go nmap <Leader>dv <Plug>(go-def-vertical)
" Go to definition in a new tab
au FileType go nmap <Leader>dt <Plug>(go-def-tab)
" other setings
set encoding=utf-8
set fileencodings=utf-8,cp1251
set tags=./tags,tags
set history=1000
set cursorline
set cursorcolumn
hi CursorLine cterm=bold
hi SpellBad cterm=underline ctermbg=Black ctermfg=Magenta gui=underline guibg=Black guifg=Magenta
set timeoutlen=300
if v:version >= 703
set colorcolumn=80
endif
" Start scrolling five lines before the horizontal window border
set scrolloff=5
set dir=/tmp/
set pastetoggle=<F3>
" Add bulgarian as an input language, allowing keyboard bindings to work
set keymap=bulgarian-bds
set iminsert=0
set imsearch=-1
autocmd BufWritePre *.{tex,rb,py,c,cpp,h,hpp,clj,go} :%s/\s\+$//e
" vimux parameters
let g:VimuxUseNearestPane = 1
let g:VimuxHeight = 40
let g:VimuxOrientation = "h"
nnoremap <leader>vp :VimuxPromptCommand<CR>
nnoremap <leader>vl :VimuxRunLastCommand<CR>
nnoremap <leader>vq :VimuxCloseRunner<CR>
" Enable this option if you want the cursor to jump to the first detected
" error
let g:syntastic_auto_jump=1
let g:syntastic_python_pylint_exec = 'python3-pylint'
" Automatically close the Gundo windows when reverting
let g:gundo_close_on_revert=1
" YouCompleteMe
let g:ycm_confirm_extra_conf = 1
let g:ycm_global_ycm_extra_conf = "~/.ycm_extra_conf.py"
let g:ycm_seed_identifiers_with_syntax = 1
" ultishnips
let g:UltiSnipsExpandTrigger="<leader>e"
let g:UltiSnipsJumpForwardTrigger="<leader>e"
let g:UltiSnipsJumpBackwardTrigger="<leader>E"
let g:UltiSnipsSnippetDirectories=["my-snippets", "UltiSnips"]
set guioptions-=m
set guioptions-=T
" vim-airline
let g:airline_theme = 'wombat'
let g:airline#extensions#syntastic#enabled = 1
set laststatus=2
" rainbow parentheses
let g:rbpt_colorpairs = [
\ ['brown', 'RoyalBlue3'],
\ ['Darkblue', 'SeaGreen3'],
\ ['darkgray', 'DarkOrchid3'],
\ ['darkgreen', 'firebrick3'],
\ ['darkcyan', 'RoyalBlue3'],
\ ['darkred', 'SeaGreen3'],
\ ['darkmagenta', 'DarkOrchid3'],
\ ['brown', 'firebrick3'],
\ ['gray', 'RoyalBlue3'],
\ ['black', 'SeaGreen3'],
\ ['darkmagenta', 'DarkOrchid3'],
\ ['Darkblue', 'firebrick3'],
\ ['darkgreen', 'RoyalBlue3'],
\ ['darkcyan', 'SeaGreen3'],
\ ['darkred', 'DarkOrchid3'],
\ ['red', 'firebrick3'],
\ ]
" Nerd tree
let g:NERDTreeQuitOnOpen = 1
" Markdown preveiw
let vim_markdown_preview_hotkey='<leader>mp'
let vim_markdown_preview_github=1
let vim_markdown_preview_use_xdg_open=1
" format with goimports instead of gofmt
let g:go_fmt_command = "goimports"
let g:syntastic_go_checkers = ['golint', 'govet', 'errcheck']
" rust autoformat
let g:rustfmt_autosave = 1
" vim-javascript
let g:javascript_plugin_jsdoc = 1
let g:javascript_plugin_ngdoc = 1
" Ignore some files
set wildignore+=*/.git/*,*.class,*.jar,*.zip,*.d
nnoremap <leader>q :call ToggleQuickfix()<cr>
nnoremap <leader>Q :cc<cr>
nnoremap <leader>j :cnext<cr>
nnoremap <leader>k :cprev<cr>
" end of file