-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
278 lines (205 loc) · 6.77 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
271
272
273
274
275
276
277
278
" Enable syntax
set nocompatible " be iMproved, required
filetype off " required
set encoding=utf-8
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'airblade/vim-gitgutter'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'tpope/vim-commentary'
Plugin 'neovimhaskell/haskell-vim'
Plugin 'scrooloose/nerdtree'
Plugin 'morhetz/gruvbox'
Plugin 'jiangmiao/auto-pairs'
Plugin 'othree/html5.vim'
Plugin 'alvan/vim-closetag'
Plugin 'vim-scripts/AutoComplPop'
Plugin 'terryma/vim-multiple-cursors'
" Plugin 'scrooloose/syntastic' "(Using ale for now)
Plugin 'junegunn/goyo.vim'
Plugin 'kshenoy/vim-signature'
Plugin 'maxbrunsfeld/vim-yankstack'
Plugin 'tpope/vim-fugitive'
Plugin 'editorconfig/editorconfig-vim'
Plugin 'reedes/vim-pencil'
Plugin 'reedes/vim-colors-pencil'
Plugin 'mileszs/ack.vim'
Plugin 'w0rp/ale'
Plugin 'leafgarland/typescript-vim'
Plugin 'vimwiki/vimwiki'
" Works with Python3
Plugin 'SirVer/ultisnips'
" Repository of snippets for UltiSnips
Plugin 'honza/vim-snippets'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
syntax enable
" Enable mouse scroll
set mouse=a
" No line break
set nowrap
" Set 256 colors
set t_Co=256
" Setting monokai theme (~/.vim/colors/)
" colorscheme molokai
let g:gruvbox_invert_selection=0
let g:gruvbox_invert_indent_guides=1
let g:gruvbox_contrast_dark='hard'
" let g:gruvbox_italic=1
" let g:gruvbox_italicize_strings=1
set background=dark
colorscheme gruvbox
" Enable line numbers
set number
" set cursorline
set showmatch
" Enable switch buffer without saving
set hidden
" Enable search highlight
set hls
set incsearch " search as characters are enetered
" show existing tab with 4 spaces width
set tabstop=4
" when indenting with '>', use 4 spaces width
set shiftwidth=4
" On pressing tab, insert 4 spaces
set expandtab
" Increase update time (default 4000) for gitgutter
set updatetime=300
" Airline conf
set laststatus=2
" let g:airline_theme='molokai'
let g:airline_theme='gruvbox'
let g:airline_powerline_fonts = 1
" let g:airline#extensions#tabline#enabled = 1
" Open NerdTree with Ctrl-N
nnoremap <C-n> :NERDTreeToggle<CR>
" Add octave/matlab comment support
autocmd FileType matlab setlocal commentstring=%\ %s
" Ctrl-P ignore
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/](\.(git|hg|svn)|bower_components|node_modules|tmp|dist)$',
\ 'file': '\v\.(pyc|o|exe|so|dll|class)$',
\ }
" So that backspace work normally
set backspace=2
" Set autocompletition to snipmate (only with uppercase)
" let g:acp_behaviorSnipmateLength = 1
let g:acp_behaviorKeywordLength = 3
" Config for multiple cursors
let g:multi_cursor_use_default_mapping=0
let g:multi_cursor_next_key='<C-a>'
let g:multi_cursor_prev_key='<C-D>'
let g:multi_cursor_skip_key='<C-x>'
let g:multi_cursor_quit_key='<C-c>'
nnoremap <C-c> :call multiple_cursors#quit()<CR>
" Remmaping ; to : and vice versa
nnoremap ; :
nnoremap : ;
" Remapping movement between splits
nnoremap <C-j> <C-w>j
nnoremap <C-h> <C-w>h
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
" " Syntastic settings (disabled because of using ALE now)
" set statusline+=%#warningmsg#
" set statusline+=%{SyntasticStatuslineFlag()}
" set statusline+=%*
" let g:syntastic_always_populate_loc_list = 1
" let g:syntastic_auto_loc_list = 1
" let g:syntastic_check_on_open = 0
" let g:syntastic_check_on_wq = 1
" let g:syntastic_auto_loc_list = 0
" let g:syntastic_enable_highlighting = 0
" let g:syntastic_stl_format = "Error: line:%F (%t)"
" let g:syntastic_error_symbol = "✗"
" let g:syntastic_warning_symbol = "⚠"
" Goyo setup
nnoremap min :Goyo<CR>
let g:goyo_width=100
let g:goyo_height=100
nnoremap \\ :CtrlPBuffer<CR>
nmap z o<Esc>
nmap Z O<Esc>
set wildmenu " visual autocomplete for command menu
set lazyredraw " redraw only when we need to
" For vim-Signify to match gitgutter colors
let g:SignatureMarkTextHLDynamic = 1
let g:SignatureMarkerTextHLDynamic = 1
nmap [p <Plug>yankstack_substitute_older_paste
nmap [P <Plug>yankstack_substitute_newer_paste
let g:matchparen_timeout = 2
let g:matchparen_insert_timeout = 2
map K <Plug>(expand_region_expand)
map J <Plug>(expand_region_shrink)
set sidescroll=1
set splitbelow
set splitright
" highlight all tabs and trailing whitespace characters.
" highlight ExtraWhitespace ctermbg=darkgreen guibg=darkgreen
" match ExtraWhitespace /\s\+$\|\t/
set ignorecase " Make searching case insensitive
set smartcase " ... unless the query has capital letters.
set gdefault " Use 'g' flag by default with :s/foo/bar/.
set magic " Use 'magic' patterns (extended regular expressions).
" ---------------- Prose ----------------
function! Prose()
call pencil#init()
SoftPencil
let g:pencil#textwidth = 100
set conceallevel=0
colorscheme pencil
set background=dark
AcpDisable
Goyo
hi markdownBold cterm=bold
hi markdownItalic cterm=underline
endfunction
" invoke manually by command for other file types
command! -nargs=0 Prose call Prose()
" ------------------------------------------
" Set ack to work with ag
let g:ackprg = 'ag --nogroup --nocolor --column'
" Window resizing
nnoremap <Right> :vertical resize +1<CR>
nnoremap <Left> :vertical resize -1<CR>
nnoremap <Up> :resize +1<CR>
nnoremap <Down> :resize -1<CR>
" Trigger configuration. Do not use <tab> if you use
" https://github.com/Valloric/YouCompleteMe.
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
" Tell UltiSnips to use python3
" let g:UltiSnipsUsePythonVersion = 3
" If you want :UltiSnipsEdit to split your window.
let g:UltiSnipsEditSplit="vertical"
" Use custom snippets at ~/.vim/MySnippets/
let g:UltiSnipsSnippetDirectories=["UltiSnips", "MySnippets"]
" Use system clipboard
" Use "+yy instead of yy for example
"
" Ale config
" let g:ale_sign_column_always = 1 " This breaks with some files
" highlight clear ALEErrorSign "Disable highlight
" highlight clear ALEWarningSign "Disable highlight
let g:ale_statusline_format = ['⨉ %d', '⚠ %d', '⬥ ok']
set statusline=%{ALEGetStatusLine()}
let g:ale_sign_error = '>>'
let g:ale_sign_warning = '--'
" Map \+p for tggling btw Paste & No Paste
let mapleader = "\\"
set pastetoggle=<leader>p
" Tab movement with shift + (L or R)
noremap <S-l> gt
noremap <S-h> gT