-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc-old
429 lines (354 loc) · 11.2 KB
/
.vimrc-old
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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
"""""""""""""""""""""""""""""""
" Vundle
"
set nocompatible " be iMproved, required
set autoread
filetype off " required
set shell=/bin/bash
"set rtp+=~/.fzf
call plug#begin('~/.vim/plugged')
"
" Code efficiencies
"Plug 'Valloric/YouCompleteMe', { 'do': './install.py' } " You complete me
Plug 'jiangmiao/auto-pairs'
Plug 'marijnh/tern_for_vim', { 'do': 'npm install' }
Plug 'mattn/emmet-vim' " Emmet
Plug 'ntpeters/vim-better-whitespace' " Remove whitespace
Plug 't9md/vim-textmanip' " Text manipulation
Plug 'terryma/vim-multiple-cursors' " Multi cursors : )
Plug 'tpope/vim-fugitive' " Git
Plug 'tpope/vim-surround' " Surround tags
"Plug 'unblevable/quick-scope' " Quick scopeing f,F,t
"
" File handling
Plug 'tyru/open-browser.vim' " Open in Browser
"
" Search utilities
"Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } " Fzf
Plug 'FelikZ/ctrlp-py-matcher' " CtrlP performance
Plug 'ctrlpvim/ctrlp.vim' " CtrlP
"
" Syntax highlighting
Plug 'ap/vim-css-color' " CSS color
Plug 'cakebaker/scss-syntax.vim' " SCSS
Plug 'digitaltoad/vim-jade' " Jade
Plug 'hail2u/vim-css3-syntax' " CSS
Plug 'mxw/vim-jsx' " JSX
Plug 'othree/html5.vim' " HTML
Plug 'pangloss/vim-javascript' " JS
Plug 'scrooloose/syntastic' " Syntax checker
"
" UI enhancements
Plug 'altercation/vim-colors-solarized' " Solarized
Plug 'bling/vim-airline' " Airline
Plug 'godlygeek/tabular' " Align text
Plug 'nathanaelkane/vim-indent-guides' " Indent guides
Plug 'schickling/vim-bufonly' " Close all but current buffer
Plug 'scrooloose/nerdcommenter' " Nerd commenter
Plug 'scrooloose/nerdtree' " Nerd tree
Plug 'vim-scripts/AutoComplPop' " AutoComlPop menu
Plug 'wesQ3/vim-windowswap' " Window swap
call plug#end() " required
"
" Nerd Tree
let NERDTreeShowLineNumbers = 1
let g:NERDTreeDirArrowExpandable = '+'
let g:NERDTreeDirArrowCollapsible = '-'
"
" Open browser current
command! OpenBrowserCurrent execute "OpenBrowser" "file:///" . expand('%:p:gs?\\?/?')
"
" Syntastic
set statusline=%#warningmsg#%{SyntasticStatuslineFlag()}%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_check_on_open = 0
let g:syntastic_auto_jump = 1
let g:syntastic_enable_signs = 0
let g:syntastic_mode = "passive"
"let syntastic_mode_map = { 'passive_filetypes': ['html'] }
"let g:syntastic_scss_checkers = ['scss_lint']
let g:syntastic_scss_checkers = ['']
let g:syntastic_javascript_checkers = ['eslint']
"let g:syntastic_javascript_jsxhint_exec = 'jsx-jshint-wrapper'
"
" Omnicomplete
set omnifunc=syntaxcomplete#Complete
"""""""""""""""""""""""""""""""
" Tern js
"
let g:tern_show_argument_hints='on_hold'
let g:tern_map_prefix = '<leader>'
let g:tern_map_keys=1
"""""""""""""""""""""""""""""""
" Insert
"
set backspace=2 " Allow backspace to erase in insert mode
"""""""""""""""""""""""""""""""
" Visual
"
"colorscheme Tomorrow-Night-Eighties " Set colorscheme
set background=dark " Options are light/dark
colorscheme solarized
set cpoptions+=$ " show in change mode to mark edit end
set cursorline " highlight current line
"set colorcolumn=60 " color column at 60 characters
syntax sync minlines=256
set foldmethod=indent " Code folding
set encoding=utf8
set guifont=Source_Code_Pro:h16
"set guifont=Space_Mono:h16
"set guifont=Fira_Code:h16
set guioptions-=T " Remove toolbar
set guioptions-=m " Remove menu bar
set guioptions-=r " Remove right-hand scroll bar
set guioptions-=L " Remove right-hand scroll bar
set laststatus=2 " Always show status line
set linespace=2 " Set line height
set nonu rnu " Set Relative Number
set novisualbell t_vb= " Disable errorbell
set nowrap " Disable text wrap
set linebreak
set scrolloff=5 " Start scrolling before end
set shiftwidth=4 " Change indent size. Default: 8
set sidescroll=1 " Scroll sideways 1 char at a time
set sidescrolloff=5 " Same for side
set tabstop=4 " Change tab size. Default: 8
set shiftwidth=4
set expandtab
set vb " Disable errorbell
set virtualedit=all " Enable virtual edit
syntax on
"""""""""""""""""""""""""""""""
" Multi Cursors
highlight multiple_cursors_cursor term=reverse cterm=reverse gui=reverse
highlight link multiple_cursors_visual Visual
"""""""""""""""""""""""""""""""
" Syntax Colors
"
" hi cssClassName guifg=#f2777a gui=NONE
" hi cssMedia guifg=#cc99cc gui=NONE
" hi cssFontDescriptor guifg=#cc99cc gui=NONE
" hi cssPseudoClassId guifg=#cc99cc gui=NONE
" hi cssPseudoClassLang guifg=#f2777a gui=NONE
" hi cssTagName guifg=#f2777a gui=NONE
" hi cssValueLength guifg=#f99157 gui=NONE
" hi cssValueNumber guifg=#f99157 gui=NONE
" hi cssVendor guifg=#99cccc gui=NONE
" hi htmlArg guifg=#f99157 gui=NONE
" hi htmlSpecialTagName guifg=#f2777a gui=NONE
" hi scssAmpersand guifg=#f2777a gui=NONE
" hi scssDebug guifg=#cc99cc gui=NONE
" hi scssDefinition guifg=#cc99cc gui=NONE
" hi scssEachKeyword guifg=#cc99cc gui=NONE
" hi scssForKeyword guifg=#cc99cc gui=NONE
" hi scssElse guifg=#cc99cc gui=NONE
" hi scssExtend guifg=#cc99cc gui=NONE
" hi scssFunctionBody guifg=#cc99cc gui=NONE
" hi scssFunctionName guifg=#99cccc gui=NONE
" hi scssFunctionParams guifg=#99cccc gui=NONE
" hi scssIf guifg=#cc99cc gui=NONE
" hi scssInclude guifg=#cc99cc gui=NONE
" hi scssMixinParams guifg=#99cccc gui=NONE
" hi scssReturn guifg=#cc99cc gui=NONE
" hi scssVariable guifg=#f99157 gui=NONE
" hi jsFuncName guifg=#99cccc gui=NONE
" hi jsFuncCall guifg=#99cccc gui=NONE
" hi jsFuncArgs guifg=#ffcc66 gui=NONE
" hi jsFunction guifg=#f2777a gui=NONE
" hi jsStringS guifg=#99cc99 gui=NONE
" hi jsGlobalObjects guifg=#ffcc66 gui=NONE
" hi jsNumber guifg=#cc99cc gui=NONE
" hi jsReturn guifg=#f2777a gui=NONE
" hi jsLabel guifg=#f2777a gui=NONE
" hi jsStatement guifg=#f2777a gui=NONE
" hi jsRepeat guifg=#f2777a gui=NONE
" hi jsConditional guifg=#f2777a gui=NONE
" hi jsThis guifg=#f2777a gui=NONE
" hi jsBooleanFalse guifg=#cc99cc gui=NONE
" hi jsBooleanTrue guifg=#cc99cc gui=NONE
" hi jsBraces guifg=#999999 gui=NONE
" hi jsFuncBraces guifg=#999999 gui=NONE
" hi jsParens guifg=#999999 gui=NONE
" hi jsFuncParens guifg=#999999 gui=NONE
" hi jsNoise guifg=#999999 gui=NONE
" Slash after folder names
"hi NERDTreeDirSlash guifg=#99cccc gui=NONE
" Folder open icon color
"hi NERDTreeOpenable guifg=#f99157 gui=NONE
" Folder close icon color
"hi NERDTreeClosable guifg=#99cccc gui=NONE
" Pipes beside folders color
"hi NERDTreePart guifg=#2d2d2d gui=NONE
hi CursorLineNr guifg=#aaaaaa
hi LineNr guibg=NONE
"hi ColorColumn guibg=#292929
"set fillchars+=vert:\|
set fillchars=""
hi VertSplit ctermbg=NONE guibg=NONE
"""""""""""""""""""""""""""""""
" JSX Syntax
"
let g:jsx_ext_required = 0
"""""""""""""""""""""""""""""""
" Detect syntax function
"
function! SynStack()
if !exists("*synstack")
return
endif
echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
endfunc
"""""""""""""""""""""""""""""""
" You Complete Me
"
let g:ycm_path_to_python_interpreter = '/usr/local/bin/python'
let g:ycm_server_use_vim_stdout = 0
"""""""""""""""""""""""""""""""
" Search
"
set incsearch
set ignorecase
set smartcase
set nohlsearch
"""""""""""""""""""""""""""""""
" Dim Inactive
"
"let g:diminactive_use_colorcolumn = 0
"let g:diminactive_use_syntax = 1
"""""""""""""""""""""""""""""""
" Indent Guides
"
set ts=4 sw=4 noet
" let g:indent_guides_start_level=2
" let g:indent_guides_guide_size=1
"""""""""""""""""""""""""""""""
" Hotkeys
"
let mapleader = ','
" Plug install
nnoremap <leader>pi :PlugInstall<cr>
" Plug clean
nnoremap <leader>pc :PlugClean<cr>
" Toggle Nerdtree
nnoremap <leader>nt :NERDTreeToggle<cr>
" Toggle IndentGuides
nnoremap <leader>ig :IndentGuidesToggle<cr>
" Open vimrc
"nnoremap <leader>v :vsplit $VIM/vimrc<cr>
nnoremap <leader>v :vsplit $HOME/.vimrc<cr>
" Open new file in vsplit
nnoremap <leader>n :vnew<cr>
" Quit current buffer
nnoremap <leader>q :q<cr>
" Reload current buffer
nnoremap <leader>r :e!<cr>
" Exit current buffer
nnoremap <leader>e :exit!<cr>
" Delete current buffer
nnoremap <leader>d :bd<cr>
" Close all but current buffer
nnoremap <leader>o :BufOnly<cr>
" Open file explorer
nnoremap <leader>x :Explore<cr>
" Format Code - Indent
nnoremap <leader>f gg=G''0
" Format Code - CSS
nnoremap <leader>c :CSScomb<cr>
" Format Code - HTML
nnoremap <leader>h :%s/>\s*</>\r</g<cr> :g/^$/d<cr> ggVGo=<Esc>
" Delete empytlines
nnoremap <leader>rel :g/^$/d<cr>
" Paste all tag below
nnoremap <leader>pb vatygv<c-[>o<cr><c-[>pvat=kdd
" Join tag
nnoremap <leader>jt JxJx<c-[>0w
" Toggle invisible characters
nnoremap <leader>l :set list!<cr>
" Toggle hlsearch
nnoremap <leader>hs :set hlsearch! hlsearch?<cr>
" Strip whitespace
nnoremap <leader>sw :StripWhitespace<cr>
" Insert line below on enter
nnoremap <cr> o<Esc>
" Insert line above on shift enter
nnoremap <S-cr> O<Esc>
" Prepend HTML Attribute
nnoremap <leader>pa 0wea<Space>
" Append HTML Attribute
nnoremap <leader>aa 0w%i<Space>
" Append HTML Class
nnoremap <leader>ac 0/class<cr>/"<cr>ni<Space>
" Remove first HTML Attribute
nnoremap <leader>ra 0wewdt"da"<Esc>
" Visual all
nnoremap <leader>va ggVGo
" Set syntax to HTML
command! Sethtml :set filetype=html syntax=html<cr>
" Set syntax to CSS
command! Setcss :set filetype=css syntax=css<cr>
" Set syntax to SCSS
command! Setscss :set filetype=scss syntax=scss<cr>
" Set syntax to JS
command! Setjs :set filetype=js syntax=js<cr>
" Open current file in browser
nnoremap <leader>oib :OpenBrowserCurrent<cr>
" Tab moves line over
nnoremap <Tab> >>_
nnoremap <S-Tab> <<_
inoremap <S-Tab> <C-D>
vnoremap <Tab> >gv
vnoremap <S-Tab> <gv
"""""""""""""""""""""""""""""""
" Tabularize
"
if exists(":Tabularize")
nnoremap <leader>a: :Tabularize /:\zs<cr>
nnoremap <leader>a{ :Tabularize /{<cr>
endif
" Split and Tab Controls
if bufwinnr(1)
nnoremap <C-Tab> :bprevious<cr>
nnoremap <C-S-Tab> :bNext<cr>
nnoremap <C-k> <C-W>k
nnoremap <C-j> <C-W>j
nnoremap <C-h> <C-W>h
nnoremap <C-l> <C-W>l
nnoremap <C-[> <C-W>5<
nnoremap <C-]> <C-W>5>
endif
"""""""""""""""""""""""""""""""
" Indent Line
"
let g:indentLine_char = '.'
"""""""""""""""""""""""""""""""
" CtrlP
"
let g:ctrlp_working_path_mode = 'r'
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
let g:ctrlp_custom_ignore = '\v[\/](\.git|build|dist|_site|node_modules|\.swp)$'
hi CtrlPMatch ctermbg=235 ctermfg=250 guibg=#99cccc guifg=#333333 cterm=NONE gui=NONE
hi CtrlPPrtBase ctermbg=235 ctermfg=250 guibg=#ffcc66 guifg=#333333 cterm=NONE gui=NONE
"""""""""""""""""""""""""""""""
" Airline
"
"let g:airline_right_alt_sep = ''
"let g:airline_right_sep = ''
"let g:airline_left_alt_sep= ''
"let g:airline_left_sep= ''
let g:airline#extensions#bufferline#enabled = 1
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#fnamemod = ':t'
let g:airline_powerline_fonts=1
"""""""""""""""""""""""""""""""
" Tabularize
"
if exists(":Tabularize")
nnoremap <leader>a: :Tabularize /:\zs<cr>
endif
"""""""""""""""""""""""""""""""
" Vim-move
"
let g:move_key_modifier = 'c'