-
Notifications
You must be signed in to change notification settings - Fork 2
/
.vimrc_plugins_v2
198 lines (156 loc) · 7.74 KB
/
.vimrc_plugins_v2
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
call plug#begin('~/.vim/plugged')
""" General
Plug 'editorconfig/editorconfig-vim' " Editor config (http://editorconfig.org/)
Plug 'chriskempson/base16-vim' " Base 16 Colorscheme
Plug '/opt/homebrew/opt/fzf' | Plug 'junegunn/fzf.vim' " Ubiquitous anf fast fuzzy finder
Plug '907th/vim-auto-save' " Auto-save files
Plug 'kshenoy/vim-signature' " Show marks on gutter
Plug 'tmux-plugins/vim-tmux-focus-events' " Fix FocusGained and FocusLost when using tmux (https://github.com/tmux-plugins/vim-tmux-focus-events)
Plug 'christoomey/vim-tmux-navigator' " Tmux/Vim seamless navigation
Plug 'junegunn/goyo.vim' " Distraction-free prose writting
Plug 'junegunn/limelight.vim' " Highlight only the current paragraph
Plug 'will133/vim-dirdiff' " Directory diff (life is more than git)
""" Coding support
" Navigation
Plug 'ludovicchabant/vim-gutentags' " CTags auto-updater
" Git
Plug 'airblade/vim-gitgutter' " Git: show changes on editor
" Linting & Formatting
Plug 'prettier/vim-prettier' " Prettier
" Markup + CSS
Plug 'mattn/emmet-vim' " HTML with Emmet (formerly Zencoding)
Plug 'mxw/vim-jsx' " JSX syntax support
Plug 'hail2u/vim-css3-syntax' " CSS3 syntax support
Plug 'cakebaker/scss-syntax.vim' " SCSS syntax support
Plug 'alvan/vim-closetag' " Auto-close X(HT)ML tags
" Syntaxes
Plug 'pangloss/vim-javascript' " JavaScript syntax support
Plug 'herringtondarkholme/yats.vim', {'do': 'rm -rf UltiSnips'} " TypeScript syntax support
" Auto-completion
Plug 'neoclide/coc.nvim', {'branch': 'release'} " Better auto-completion
Plug 'neoclide/coc-tsserver', {'do': 'yarn install --frozen-lockfile'} " TypeScript auto-completion
Plug 'pappasam/coc-jedi', { 'do': 'yarn install --frozen-lockfile && yarn build', 'branch': 'main' } " Python auto-completion
Plug 'neoclide/coc-snippets', {'do': 'yarn install --frozen-lockfile'} " Snippets auto-completion
Plug 'neoclide/coc-pairs', {'do': 'yarn install --frozen-lockfile'}
" Snippets
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'mlaursen/vim-react-snippets'
call plug#end()
""""""""""""" PLUGIN CONFIGS
""" Emmet
let g:user_emmet_mode='n'
let g:user_emmet_leader_key='<Leader>,'
""" JSX
let g:jsx_ext_required=0
""" FZF (https://github.com/junegunn/fzf.vim#command-local-options)
let g:fzf_buffers_jump = 1
let g:fzf_layout = { 'down': '~40%' }
" Customize fzf colors to match your color scheme
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'] }
" :Files override - Preview included
command! -bang -nargs=? -complete=dir Files
\ call fzf#vim#files(<q-args>, fzf#vim#with_preview(), <bang>0)
" :DirFiles - Files in current directory
command! -bang DirFiles
\ call fzf#vim#files(expand('%:p:h'), fzf#vim#with_preview(), <bang>0)
" :Ag - Start fzf with hidden preview window that can be enabled with "?" key
" :Ag! - Start fzf in fullscreen and display the preview window above
let $AG_DEFAULT_OPTIONS='-s --hidden'
command! -bang -nargs=* Ag
\ call fzf#vim#ag(<q-args>,
\ $AG_DEFAULT_OPTIONS,
\ <bang>0 ? fzf#vim#with_preview('up:60%')
\ : fzf#vim#with_preview('right:50%:hidden', '?'),
\ <bang>0)
" :Cd - Go to a dir, so Files will just list from it
command! -nargs=* -complete=dir Cd call fzf#run(fzf#wrap(
\ {'source': 'find '.(empty(<q-args>) ? '.' : <q-args>).' -type d',
\ 'sink': 'cd'}))
" :Maps override - Show ALL types of vim maps (defaults to normal mode)
command! -bar -bang Maps call fzf#vim#maps('', <bang>0)
""" UltiSnips
let g:UltiSnipsJumpForwardTrigger="<C-]>"
let g:UltiSnipsJumpBackwardTrigger="<C-[>"
let g:UltiSnipsEditSplit="vertical"
""" Auto-save
let g:auto_save = 1
""" Vim-gutter
let g:gitgutter_map_keys = 1
""" Guten Tags
let g:gutentags_enabled = 0
augroup auto_gutentags
au FileType python,java,scala,json,yml,yaml,css,scss,less,xml,html,xhtml,svg,js,javascript,ts,typescript,vim let g:gutentags_enabled=1
augroup end
""" CoC (https://github.com/neoclide/coc.nvim#example-vim-configuration)
let g:coc_start_at_startup = 1
" Having longer updatetime (default is 4000 ms = 4s) leads to noticeable
" delays and poor user experience
set updatetime=300
" Always show the signcolumn, otherwise it would shift the text each time
" diagnostics appear/become resolved
set signcolumn=yes
" Use tab for trigger completion with characters ahead and navigate
" NOTE: There's always complete item selected by default, you may want to enable
" no select by `"suggest.noselect": true` in your configuration file
" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
" other plugin before putting this into your config
inoremap <silent><expr> <TAB>
\ coc#pum#visible() ? coc#pum#next(1) :
\ CheckBackspace() ? "\<Tab>" :
\ coc#refresh()
inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
" Make <CR> to accept selected completion item or notify coc.nvim to format
" <C-g>u breaks current undo, please make your own choice
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
function! CheckBackspace() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
" Use <c-space> to trigger completion
if has('nvim')
inoremap <silent><expr> <c-space> coc#refresh()
else
inoremap <silent><expr> <c-@> coc#refresh()
endif
" Make <CR> to accept selected completion item or notify coc.nvim to format
" <C-g>u breaks current undo, please make your own choice
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
" Add (Neo)Vim's native statusline support
" NOTE: Please see `:h coc-status` for integrations with external plugins that
" provide custom statusline: lightline.vim, vim-airline
set statusline+=%{coc#status()}%{get(b:,'coc_current_function','')}
" Use K to show documentation in preview window
nnoremap <silent> K :call ShowDocumentation()<CR>
function! ShowDocumentation()
if CocAction('hasProvider', 'hover')
call CocActionAsync('doHover')
else
call feedkeys('K', 'in')
endif
endfunction
" Refactorings
nmap <leader>crl <Plug>(coc-codeaction-refactor)
" Symbol renaming
nmap <leader>crr <Plug>(coc-rename)
" Apply the most preferred quickfix action to fix diagnostic on the current line
nmap <leader>cf <Plug>(coc-fix-current)
" Go to definition
nmap <leader>cd <Plug>(coc-definition)
" Show errors
nnoremap <leader>ce :CocDiagnostics<CR>|