-
Notifications
You must be signed in to change notification settings - Fork 2
/
vimrc
680 lines (628 loc) · 26.2 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
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
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
" =============================================================================
" NO COMPATIBILITY
" =============================================================================
set nocompatible
" =============================================================================
" LANGUAGE UI
" =============================================================================
language messages C
set langmenu=en_US.UTF-8
" =============================================================================
" VIM-POLYGLOT
" =============================================================================
" let g:polyglot_disabled = ['markdown']
let g:vim_json_syntax_conceal = 0
let g:vim_markdown_conceal = 0
let g:vim_markdown_conceal_code_blocks = 0
" =============================================================================
" VIM-PLUG
" =============================================================================
let vimplug_exists=expand('~/.vim/autoload/plug.vim')
if !filereadable(vimplug_exists)
if !executable("curl")
echoerr "You have to install curl or first install vim-plug by yourself!"
execute "q!"
endif
echo "Installing Vim-Plug..."
echo ""
silent exec "!curl -fLo " . vimplug_exists . " --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim"
let g:not_finis_vimplug = "yes"
autocmd VimEnter * PlugInstall
endif
call plug#begin('~/.vim/bundle')
" =============================================================================
" PLUGINS
" =============================================================================
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-rails'
Plug 'tpope/vim-abolish'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-bundler'
Plug 'tpope/vim-capslock'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-endwise'
Plug 'tpope/vim-rvm'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-dispatch'
Plug 'tpope/vim-dadbod'
Plug 'tpope/vim-jdaddy'
Plug 'tpope/vim-rhubarb'
Plug 'tpope/vim-fugitive'
Plug 'jiangmiao/auto-pairs'
Plug 'itchyny/lightline.vim'
Plug 'mengelbrecht/lightline-bufferline'
Plug 'justinmk/vim-sneak'
Plug 'ludovicchabant/vim-gutentags'
Plug 'kshenoy/vim-signature'
Plug 'yggdroot/indentline'
Plug 'airblade/vim-rooter'
Plug 'chaoren/vim-wordmotion'
Plug 'junegunn/vim-peekaboo'
Plug 'junegunn/vim-easy-align'
Plug 'junegunn/fzf.vim'
Plug 'junegunn/fzf'
Plug 'junegunn/gv.vim'
Plug 'stsewd/fzf-checkout.vim'
Plug 'haya14busa/is.vim'
Plug 'terryma/vim-multiple-cursors'
Plug 'rhysd/committia.vim'
Plug 'rhysd/devdocs.vim'
Plug 'ryanoasis/vim-devicons'
Plug 'dyng/ctrlsf.vim'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'honza/vim-snippets'
Plug 'RRethy/vim-hexokinase', { 'do': 'make hexokinase' }
Plug 'sheerun/vim-polyglot'
Plug 'moll/vim-node'
Plug 'mhinz/vim-signify'
Plug 'mhinz/vim-startify'
Plug 'alok/notational-fzf-vim'
Plug 'zinit-continuum/zplugin-vim-syntax'
Plug 'drzel/vim-line-no-indicator'
Plug 'liuchengxu/vista.vim'
Plug 'christoomey/vim-tmux-navigator'
Plug 'editorconfig/editorconfig-vim'
Plug 'jeffkreeftmeijer/vim-numbertoggle'
Plug 'AndrewRadev/tagalong.vim'
Plug 'jmckiern/vim-venter'
Plug 'voldikss/vim-floaterm'
Plug 'lambdalisue/suda.vim'
Plug 'psliwka/vim-smoothie'
Plug 'benwainwright/fzf-project'
Plug 'kovetskiy/vim-autoresize'
Plug 'andymass/vim-matchup'
" =============================================================================
" COLORSCHEME
" =============================================================================
Plug 'sainnhe/gruvbox-material'
call plug#end()
" =============================================================================
" SET TRUECOLORS
" =============================================================================
if (has("nvim"))
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
endif
if exists('+termguicolors')
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
set termguicolors
endif
let g:gruvbox_material_enable_italic=1
let g:gruvbox_material_sign_column_background = 'none'
set bg=dark
color gruvbox-material
" =============================================================================
" CHECK OS
" =============================================================================
if has('unix')
let s:uname = system("uname")
if s:uname == "Darwin\n"
" Do Mac stuff here
set guifont=FuraCode\ Nerd\ Font\ Mono\:h11
else
set guifont=FuraCode\ Nerd\ Font\ Mono\ 8
endif
elseif has('win32') || has('win64')
behave mswin
set guifont=Hack\:9
au GUIEnter * simalt ~n
endif
" =============================================================================
" SETTINGS
" =============================================================================
set fillchars+=vert:\ " Change vertical split character
set guioptions=aAce " GUI options
set showtabline=2
set so=10 " Row after cursor
set fileformat=unix " set fileformat
set tabstop=2 " N space for tab
set mouse=a " Mouse enabled
set colorcolumn=+1 " Highlight column 81
set backupcopy=yes
set foldmethod=indent
set foldlevel=1
set foldnestmax=10
set undolevels=1000 " n of changes that can be undone
set spelllang=it " set default spell to it
set softtabstop=2
set signcolumn=yes
set shortmess+=c
set shortmess-=S
set noshowmode " Don't dispay mode in command line
set number " Row number
set relativenumber " Relative number
set hidden " allow hidden buffer
set splitright " Open vertical splits to the right
set splitbelow " Open horizontal splits to the bottom
set wrapscan " Start search from the beginning
set nobackup " No backups
set nowritebackup " No backups
set noswapfile " No swap
set noautowrite " no auto save on buffer switch
set noundofile " no undo files
set nofoldenable " Open all folds by default
set showcmd " Show command
set showmatch " Show close bracket
set ignorecase " no case sensitive search patterns
set hlsearch " Highlight search results
set smartcase " Search with caps - override ignorecase
" set esckeys " cursor keys in I mode
set noerrorbells " do not use errorbells
set nojoinspaces " two spaces after a period on join
set title " show window title
set cursorline
set lazyredraw
set nolist listchars=tab:▸\ ,trail:·,precedes:←,extends:→,eol:↲,nbsp:␣
" jump to the last known cursor position
autocmd BufReadPost *
\ if line("'\"") > 1 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
" Set cursor position
au WinLeave * set nocursorcolumn
au WinEnter * set cursorcolumn
" ============================================================================
" HIGHLIGHT
" =============================================================================
" Make background transparent for many things
hi! Normal ctermbg=NONE guibg=NONE
hi! NonText ctermbg=NONE guibg=NONE
hi! LineNr ctermfg=NONE guibg=NONE
hi! SignColumn ctermfg=NONE guibg=NONE
hi! StatusLine guifg=NONE guibg=NONE
hi! StatusLineNC guifg=NONE guibg=NONE
" Try to hide vertical spit and end of buffer symbol
hi! VertSplit gui=NONE guifg=NONE guibg=NONE cterm=NONE
hi! EndOfBuffer ctermbg=NONE ctermfg=NONE guibg=NONE guifg=NONE
" Make background color transparent for git changes
hi! SignifySignAdd guibg=NONE
hi! SignifySignDelete guibg=NONE
hi! SignifySignChange guibg=NONE
" hi CursorLine cterm=NONE ctermbg=NONE ctermfg=NONE guibg=NONE guifg=NONE
" Gruvbox
" For list
hi NonText ctermfg=16 guifg=#FABD2F
hi SpecialKey ctermfg=16 guifg=#FBCB8B
"Gruvbox color for sneak
hi Sneak gui=bold guifg=#1d2021 guibg=#FABD2F
hi SneakScope guifg=#1d2021 guibg=#FABD2F
hi SneakLabelMask guifg=#FABD2F guibg=#FABD2F
" Gruvbox floaterm
hi FloatermBorder guifg=#83a598
" " Nord
" hi NonText ctermfg=16 guifg=#EBCB8B
" hi SpecialKey ctermfg=16 guifg=#EBCB8B
" " Nord color for sneak
" hi Sneak gui=bold guifg=#D8Dee9 guibg=#5E81AC
" hi SneakScope guifg=#2E3440 guibg=#EBCB8B
" hi SneakLabelMask guifg=#5E81AC guibg=#5E81AC
" " Nord floaterm
" hi FloatermBorder guifg=#EBCB8B
" ============================================================================
" VISTA
" =============================================================================
let g:vista#renderer#enable_icon = 1
let g:vista#executives = ['coc', 'ctags', 'lcn', 'vim_lsc', 'vim_lsp']
let g:vista#finders = ['fzf']
let g:vista_executive_for = {
\ 'ruby': 'coc',
\ }
let g:vista_fzf_preview = []
let g:vista_close_on_jump = 1
let g:vista_close_on_fzf_select = 1
" =============================================================================
" FZF
" =============================================================================
let g:fzf_colors =
\ { 'fg': ['fg', 'Normal'],
\ 'bg': ['bg', 'Normal'],
\ 'hl': ['fg', 'Comment'],
\ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
\ 'bg+': ['bg', 'CursorLine', 'CursorColumn'],
\ 'hl+': ['fg', 'Statement'],
\ 'info': ['fg', 'PreProc'],
\ 'border': ['fg', 'Ignore'],
\ 'prompt': ['fg', 'Conditional'],
\ 'pointer': ['fg', 'Exception'],
\ 'marker': ['fg', 'Keyword'],
\ 'spinner': ['fg', 'Label'],
\ 'header': ['fg', 'Comment'] }
let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.6, 'highlight': 'FloatermBorder' } }
command! -bang GIssue call fzf#run(fzf#wrap({
\ 'source': 'gh issue list',
\ 'options': [
\ '--preview', 'gh issue view {1}',
\ '--prompt', 'λ -> ',
\ ]}, <bang>0))
" =============================================================================
" VIM-STARTIFY
" =============================================================================
let g:startify_files_number = 8
" let g:startify_session_autoload = 1
let g:startify_padding_left = 3
let g:webdevicons_enable_startify = 1
let g:startify_session_delete_buffers = 1 " delete all buffers when loading or closing a session, ignore unsaved buffers
let g:startify_session_remove_lines = ['setlocal', 'winheight'] " lines matching any of the patterns in this list, will be removed from the session file
let g:startify_session_sort = 1 " sort sessions by alphabet or modification time
let g:startify_update_oldfiles = 1
let g:startify_change_to_dir = 1 " when opening a file or bookmark, change to its directory
let g:startify_fortune_use_unicode = 1 " beautiful symbols
" let g:startify_padding_left = 3 " the number of spaces used for left padding
let g:startify_session_sort = 1 " sort sessions by alphabet or modification time"
let g:startify_bookmarks = [
\ {'d': '~/Dev'},
\ {'w': '~/DevWeb'},
\ {'c': '~/.vimrc'},
\ {'s': '~/.config/nvim/coc-settings.json'},
\ {'z': '~/.zshrc'}
\ ]
let g:startify_custom_header = [
\' ██╗ ██╗ ██╗██████╗ ███████╗',
\' ██║ ██║ ██║██╔══██╗██╔════╝',
\' ██║ ██║█████╗██║██║ ██║█████╗ ',
\' ╚██╗ ██╔╝╚════╝██║██║ ██║██╔══╝ ',
\' ╚████╔╝ ██║██████╔╝███████╗',
\' ╚═══╝ ╚═╝╚═════╝ ╚══════╝',
\ ]
let g:startify_lists = [
\ { 'type': 'bookmarks', 'header': [" Bookmarks"] },
\ { 'type': 'files', 'header': [" MRU Files"] },
\ { 'type': 'dir', 'header': [" MRU Files in ". getcwd()] },
\ { 'type': 'commands', 'header': [" Commands"] },
\ ]
function! StartifyEntryFormat()
return 'WebDevIconsGetFileTypeSymbol(absolute_path) ." ". entry_path'
endfunction
" =============================================================================
" CTRLSF
" =============================================================================
let g:ctrlsf_ackprg = 'rg'
let g:ctrls_auto_preview = 1
let g:ctrlsf_search_mode = 'async'
let g:ctrlsf_auto_focus = {
\ "at": "start"
\ }
" =============================================================================
" NOTATIONAL VIM
" =============================================================================
let g:nv_search_paths = ['~/Notes']
" =============================================================================
" NETRW
" =============================================================================
let g:netrw_banner = 0
let g:netrw_liststyle = 3
let g:netrw_list_hide = '\(^\|\s\s\)\zs\.\S\+'
let g:netrw_preview = 1
let g:netrw_alto = 0
" =============================================================================
" VIM-SIGNATURE
" =============================================================================
let g:SignatureMarkTextHLDynamic = 1
let g:SignatureMarkerTextHLDynamic = 1
" =============================================================================
" COC
" =============================================================================
command! -nargs=0 Prettier :CocCommand prettier.formatFile
let g:coc_global_extensions = ['coc-solargraph', 'coc-highlight', 'coc-python', 'coc-yaml', 'coc-html', 'coc-css', 'coc-json', 'coc-xml', 'coc-snippets', 'coc-tsserver', 'coc-prettier', 'coc-flutter', 'coc-explorer', 'coc-markdownlint', 'coc-db', 'coc-yank']
autocmd CursorHold * silent call CocActionAsync('highlight')
inoremap <silent><expr> <TAB>
\ pumvisible() ? coc#_select_confirm() :
\ coc#expandableOrJumpable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
let g:coc_snippet_next = '<tab>'
let g:coc_status_error_sign = ' '
let g:coc_status_warning_sign = ' '
let g:coc_explorer_global_presets = {
\ 'floating': {
\ 'position': 'floating',
\ },
\ 'floatingTop': {
\ 'position': 'floating',
\ 'floating-position': 'center-top',
\ },
\ 'floatingLeftside': {
\ 'position': 'floating',
\ 'floating-position': 'left-center',
\ 'floating-width': 50,
\ },
\ 'floatingRightside': {
\ 'position': 'floating',
\ 'floating-position': 'left-center',
\ 'floating-width': 50,
\ },
\ 'simplify': {
\ 'file-child-template': '[selection | clip | 1] [indent][icon | 1] [filename omitCenter 1]'
\ }
\ }
" =============================================================================
" LIGHTLINE AND LIGHTLINE-BUFFERLINE
" =============================================================================
let g:lightline#bufferline#show_number = 1
let g:lightline#bufferline#enable_devicons = 1
let g:lightline = {
\ 'colorscheme': 'gruvbox_material',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'gitbranch', 'readonly', 'filename' ] ],
\ 'right': [ ['lineinfo'],
\ [ 'linenoindicator' ],
\ [ 'rvm' ],
\ [ 'fileformat' ],
\ [ 'fileencoding' ],
\ [ 'filetype' ]]
\ },
\ 'component_function': {
\ 'gitbranch': 'Lightlinegit',
\ 'filetype': 'MyFiletype',
\ 'fileformat': 'MyFileformat',
\ 'rvm': 'rvm#statusline',
\ 'filename': 'LightlineFilename',
\ 'readonly': 'LightLineReadonly',
\ 'currentfunction' : 'CocCurrentFunction',
\ 'method' : 'NearestMethodOrFunction',
\ 'mode' : 'LightlineMode',
\ 'linenoindicator' : 'LineNoIndicator',
\ },
\ 'component_expand': {
\ 'buffers': 'lightline#bufferline#buffers',
\ 'cocerror': 'LightLineCocError',
\ 'cocwarn': 'LightLineCocWarn',
\ },
\ 'component_type': {
\ 'buffers': 'tabsel',
\ 'cocerror': 'error',
\ 'cocwarn' : 'warning',
\ },
\ 'tabline': {
\ 'left': [ ['buffers'] ],
\ 'right': [['cocerror', 'cocwarn', 'currentfunction' ]]
\ }
\ }
function! LightlineMode()
return &filetype ==# 'vista' ? 'VISTA' :
\ &filetype ==# 'ctrlsf' ? 'CTRLSF' :
\ &filetype ==# 'fugitive' ? 'FUGITIVE' :
\ &filetype ==# 'fzf' ? 'FZF' :
\ lightline#mode()
endfunction
function! MyFiletype()
return winwidth(0) > 70 ? (strlen(&filetype) ? &filetype . ' ' . WebDevIconsGetFileTypeSymbol() : 'no ft') : ''
endfunction
function! MyFileformat()
return winwidth(0) > 70 ? (&fileformat . ' ' . WebDevIconsGetFileFormatSymbol()) : ''
endfunction
function! LightlineFilename()
let modified = &modified ? ' +' : ''
let root = fnamemodify(get(b:, 'git_dir'), ':h')
let path = expand('%:p')
if path[:len(root)-1] ==# root
return path[len(root)+1:] . modified
endif
return expand('%') . modified
endfunction
function! LightLineReadonly()
if &filetype == "help"
return ""
elseif &readonly
return ""
else
return ""
endif
endfunction
function! LightLineCocError()
let s:error_sign = get(g:, 'coc_status_error_sign')
let info = get(b:, 'coc_diagnostic_info', {})
if empty(info)
return ''
endif
let errmsgs = []
if get(info, 'error', 0)
call add(errmsgs, s:error_sign . info['error'])
endif
return trim(join(errmsgs, ' ') . ' ' . get(g:, 'coc_status', ''))
endfunction
function! LightLineCocWarn() abort
let s:warning_sign = get(g:, 'coc_status_warning_sign')
let info = get(b:, 'coc_diagnostic_info', {})
if empty(info)
return ''
endif
let warnmsgs = []
if get(info, 'warning', 0)
call add(warnmsgs, s:warning_sign . info['warning'])
endif
return trim(join(warnmsgs, ' ') . ' ' . get(g:, 'coc_status', ''))
endfunction
function! Lightlinegit()
let l:branch = FugitiveHead()
return l:branch ==# '' ? '' : ' ' . l:branch
endfunction
function! NearestMethodOrFunction() abort
return get(b:, 'vista_nearest_method_or_function', '')
endfunction
autocmd User CocDiagnosticChange call lightline#update()
autocmd BufWritePost,TextChanged,TextChangedI * call lightline#update()
" =============================================================================
" VIM-HEXOKINASE
" =============================================================================
let g:Hexokinase_ftAutoload = ['*']
let g:Hexokinase_highlighters = ['sign_column']
let g:Hexokinase_optInPatterns = ['full_hex', 'triple_hex', 'rgb', 'rgba']
" let g:Hexokinase_refreshEvents = ['BufWritePost']
" =============================================================================
" FILETYPE
" =============================================================================
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
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd BufNewFile,BufRead /tmp/mutt-* set filetype=mail
autocmd BufNewFile,BufRead /*.rasi setf css
autocmd BufEnter * if (winnr("$") == 1 && &filetype == 'coc-explorer') | q | endif
" autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete
" autocmd FileType ruby,eruby let g:rubycomplete_load_gemfile=1
" autocmd FileType ruby,eruby let g:rubycomplete_use_bundler=1
" autocmd BufRead,BufNewFile *.md setlocal spell
" =============================================================================
" FUNCTION
" =============================================================================
function RunWith (command)
execute "w"
execute "!clear;time " . a:command . " " . expand("%")
endfunction
" =============================================================================
" SUBTYPES
" =============================================================================
" Ruby
augroup ruby_subtypes
autocmd!
autocmd BufNewFile,BufRead *.pdf.erb let b:eruby_subtype='html'
autocmd BufNewFile,BufRead *.pdf.erb set filetype=eruby
augroup END
" Jquery
au BufRead,BufNewFile jquery.*.js set ft=javascript syntax=jquery
" =============================================================================
" INDENTLINE
" =============================================================================
let g:indentLine_char = '|'
let g:indentLine_fileTypeExclude = [ 'startify' ]
" let g:indentLine_setColors = 0
" let g:indentLine_char_list = ['|', '¦', '┆', '┊']
" let g:indentLine_char = '·'
" let g:indentLine_leadingSpaceEnabled = 1
" let g:indentLine_leadingSpaceChar = '·'
" =============================================================================
" VIM-RUBOCOP
" =============================================================================
let g:vimrubocop_keymap = 0
let g:vimrubocop_confi = '.rubocop.yml'
" =============================================================================
" VIM-ROOTER
" =============================================================================
let g:rooter_silent_chdir = 1
let g:rooter_cd_cmd = 'lcd'
let g:rooter_resolve_links = 1
let g:rooter_patterns = ['.git', '.git/']
" =============================================================================
" DEVDOCS
" =============================================================================
let g:devdocs_filetype_map = {
\ 'ruby': 'rails',
\ 'javascript.js': 'jquery',
\ }
" ============================================================================
" VIM-SNEAK
" =============================================================================
let g:sneak#use_ic_scs = 1
let g:sneak#s_next = 1
let g:sneak#f_reset = 1
let g:sneak#t_reset = 1
let g:sneak#label = 1
let g:sneak#prompt = 'λ -> '
let g:sneak#label_esc = "\<CR>"
let g:sneak#target_labels = 'aoeuidhtnspyfgcrlqjkxbmwvzAOEUIDHTNSPYFGCRLQJKXBMWVZ'
" ============================================================================
" VIM-GUTENTAGS
" =============================================================================
set tags+=tags,.git/tags
let g:gutentags_enabled = 1
let g:gutentags_generate_on_missing = 1
let g:gutentags_generate_on_write = 1
let g:gutentags_resolve_symlinks = 1
let g:gutentags_ctags_tagfile = '.git/tags'
let g:gutentags_project_root = ['.git']
let g:gutentags_ctags_extra_args = ['--fields=+l']
let g:gutentags_add_default_project_roots = 0
let g:gutentags_ctags_executable_ruby = 'ripper-tags'
let g:gutentags_ctags_extra_args = ['--ignore-unsupported-options', '--recursive']
" ============================================================================
" EDITORCONFIG
" =============================================================================
let g:EditorConfig_exclude_patterns = ['fugitive://.*', 'scp://.*']
" ============================================================================
" FLOATERM
" =============================================================================
let g:floaterm_autoclose = 2
let g:floaterm_title = 'λ -> $1..$2'
" ============================================================================
" FZF-PROJECT
" =============================================================================
let g:fzfSwitchProjectProjects = [ '~/DevWeb' ]
let g:fzfSwitchProjectProjectDepth = 2
let g:fzfSwitchProjectGitInitBehavior = 'none'
let g:fzfSwitchProjectAlwaysChooseFile = 1
" =============================================================================
"<F1> open help
nnoremap <F3> :set number! relativenumber!<CR>
nmap <F4> :set list! list?<CR>
nnoremap <silent> <F5> :FloatermToggle<CR>
tnoremap <silent> <F5> <C-\><C-n>:FloatermToggle<CR>
nnoremap <silent> <F6> :FloatermNext<CR>
tnoremap <silent> <F6> <C-\><C-n>:FloatermNext<CR>
nmap <silent> <F7> :CocCommand explorer --width 80<CR>
nmap <F8> :Vista<CR>
nmap <F9> :VenterToggle<CR>
autocmd FileType ruby nmap <F10> :call RunWith("ruby")<cr>
autocmd FileType json nmap <F10> :%!python -m json.tool<cr>
nmap <Leader>bda :bd <C-a><CR>
nmap <Leader>bn :bn<CR>
nmap <Leader>bp :bp<CR>
nmap <Leader>bb :Buffers<CR>
nmap <Leader>nm :Dispatch npm start<CR>
nmap <Leader>nv :NV<CR>
nmap <silent> <Leader>f :call fzf#vim#files('', fzf#vim#with_preview({'options': '--prompt "λ -> "'}))<CR>
nmap <Leader>r :Rg<CR>
nmap <Leader>tt :Rg TODO:<CR>
nmap <Leader>l :Lines<CR>
nmap <Leader>h :History<CR>
nmap <Leader>tc :Colors<CR>
nmap <Leader>m :Marks<CR>
nmap <Leader>v :Vista finder<CR>
nmap <silent> <Leader>g :GFiles?<CR>
nmap <Leader>gv :GV<CR>
nmap <Leader>gg :FloatermNew lazygit<CR>
nmap <Leader>gf :20G<CR>
nmap <Leader>gi :GIssue<CR>
nmap <silent> <Leader>sp :set spell!<CR>
nmap <silent> <Leader>pr :FzfSwitchProject<CR>
nmap K <Plug>(devdocs-under-cursor)
nmap <C-F>f <Plug>CtrlSFPrompt
vmap <C-F>f <Plug>CtrlSFVwordExec
nmap <C-F>n <Plug>CtrlSFCwordExec
nnoremap <C-F>t :CtrlSFToggle<CR>
xmap ga <Plug>(EasyAlign)
nmap ga <Plug>(EasyAlign)
map f <Plug>Sneak_f
map F <Plug>Sneak_F
map t <Plug>Sneak_t
map T <Plug>Sneak_T
nnoremap <silent> <space>y :<C-u>CocList -A --normal yank<cr>