-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugins.vim
More file actions
496 lines (395 loc) · 14.6 KB
/
Copy pathplugins.vim
File metadata and controls
496 lines (395 loc) · 14.6 KB
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
" vim-plug CONFIG
set nocompatible " be iMproved, required
filetype off " required
call plug#begin('$HOME/.vim/bundle')
" Stop hlsearch when no longer necessary
Plug 'romainl/vim-cool'
" Indicate active buffer by highlighting separators
Plug 'nvim-zh/colorful-winsep.nvim'
" buffer manager
Plug 'nvim-lua/plenary.nvim'
Plug 'j-morano/buffer_manager.nvim'
" vim-move
Plug 'matze/vim-move'
" vim-pencil
Plug 'preservim/vim-pencil'
" Line highlighting
Plug 'mvllow/modes.nvim'
" Improve marks
Plug 'chentoast/marks.nvim'
" Add more targets for operations
" Cheatsheet: https://github.com/wellle/targets.vim/blob/master/cheatsheet.md
Plug 'wellle/targets.vim'
" highlighting for f
Plug 'unblevable/quick-scope'
" Camel/snake case word motion
Plug 'Strike-F8/CamelCaseMotion'
" Easy undo history
Plug 'mbbill/undotree', { 'on': 'UndotreeToggle' }
" Multiple cursors
Plug 'mg979/vim-visual-multi'
" scrollbar\stripe on right side
Plug 'petertriho/nvim-scrollbar'
Plug 'lewis6991/gitsigns.nvim'
Plug 'kevinhwang91/nvim-hlslens'
" Better directory view
" Plug 'nvim-tree/nvim-web-devicons'
" Plug 'nvim-tree/nvim-tree.lua'
Plug 'preservim/nerdtree', { 'on': ['NERDTreeToggle', 'NERDTreeFind'] }
" csv/csv like filetype highlighting
Plug 'mechatroner/rainbow_csv', { 'for': ['csv', 'tsv'] }
" tom language syntax highlighting
Plug 'https://gitlab.com/taiwa1/tom/tom-vim', { 'for': 'toms' }
" tpf file syntax highlighting
Plug 'https://gitlab.com/taiwa1/tom/tpf-vim', { 'for': ['tpf', 'tbl'] }
" Better json support
Plug 'VPavliashvili/json-nvim', { 'for': ['json', 'jsonc'] }
" Intellisense for C#
Plug 'OmniSharp/omnisharp-vim', { 'for': ['cs', 'csx'] }
" IFC file syntax highlighting
Plug 'https://gitlab.com/Strike_F8/ifc-vim', { 'for': 'ifc' }
" autocorrect.vim Autocorrect misspelled words from a predefined list
Plug 'mitchpaulus/autocorrect.vim', { 'for': ['text', 'markdown'] }
" IndentLine: Display indentation guides in yaml files
Plug 'Yggdroot/indentLine'
" vim-smoothie - smooth scrolling!
Plug 'psliwka/vim-smoothie'
" vim-airline: Status bar at the bottom
Plug 'vim-airline/vim-airline'
" Errormarker highlights lines that contain errors
Plug 'mh21/errormarker.vim'
" ALE: syntax fixing and linting for many languages including Ruby and Python
Plug 'dense-analysis/ale'
" rust.vim: Rust file detection, highlighting, formatting etc..
Plug 'rust-lang/rust.vim', { 'for': 'rust' }
" RACER: Rust autocompletion
Plug 'racer-rust/racer', { 'for': 'rust' }
" vim-colorschemes pack
Plug 'flazz/vim-colorschemes'
" vim-quickui
Plug 'skywind3000/vim-quickui'
" vim-snippets. More code snippets for markdown
Plug 'honza/vim-snippets'
" markdown preview
" Install dependencies with :call mkdp#util#install()
Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app & yarn install', 'for': 'markdown' }
" Code completion
Plug 'neoclide/coc.nvim', {'branch': 'release'}
" File navigation
Plug 'lokaltog/vim-easymotion'
" Git support
Plug 'tpope/vim-fugitive'
" Commenting plugin
Plug 'tpope/vim-commentary'
" Display diff symbols
Plug 'mhinz/vim-signify'
" Automatically set cwd
Plug 'airblade/vim-rooter'
" View LSP Symbols
Plug 'liuchengxu/vista.vim'
" Pulse the line after a search
Plug 'danilamihailov/beacon.nvim'
" Highlight the word under the cursor
Plug 'RRethy/vim-illuminate'
" Limelight
Plug 'junegunn/limelight.vim', { 'on': 'Limelight' }
" All of your Plugins must be added before the following line
call plug#end() " required
filetype plugin indent on " required
syntax enable
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PlugList - lists configured plugins
" :PlugInstall - Install plugins
" :PlugUpdate - Install or update plugins
" :PlugClean - Remove unlisted plugins
" :PlugUpgrade - Upgrade vim-plug itself
" :PlugStatus - Check the status of plugins
" :PlugDiff - Examine changes from the previous update and the pending changes
" :PlugSnapshot - Generate script for restoring the current snapshot of plugins
"
" Plugin configuration
" javacomplete2 configuration
autocmd FileType java setlocal omnifunc=javacomplete#Complete
" set JAVA_HOME so JDK is used instead of JRE https://stackoverflow.com/a/46885299
" Configure IndentLine to display a thinner line
" let g:indentLine_char = '⦙'
" AUTO-CORRECT CONFIGURATION
" Load for particular file types
let g:AutocorrectFiletypes = ["text","markdown"]
" Change auto-correct file location
if has('win32') || has('win16')
let g:AutocorrectPersonalFile='~\AppData\local\nvim\autocorrect.txt'
else
let g:AutocorrectPersonalFile='~/.config/nvim/autocorrect.txt'
endif
" VIM-AIRLINE CONFIGURATION
" Display all buffers when only one tab is open
let g:airline#extensions#tabline#enabled = 1
" Buffer indicator format: display full path on top right of buffer
let g:airline#extensions#tabline#formatter = 'unique_tail'
" Enable Capslock integration
let g:airline#extensions#capslock#enabled = 1
" Configure Omnisharp
" Enable highlighting in insert mode
let g:OmniSharp_highlighting = 3
" BLOCK SELECTION
" https://stackoverflow.com/questions/1676632/whats-a-quick-way-to-comment-uncomment-lines-in-vim/1676690#1676690
" ALE configuration: show the number of errors and warnings in status bar
" Taken from https://www.vimfromscratch.com/articles/vim-for-ruby-and-rails-in-2019/
function! LinterStatus() abort
let l:counts = ale#statusline#Count(bufnr(''))
let l:all_errors = l:counts.error + l:counts.style_error
let l:all_non_errors = l:counts.total - l:all_errors
return l:counts.total == 0 ? '✨ all good ✨' : printf(
\ '😞 %dW %dE',
\ all_non_errors,
\ all_errors
\)
endfunction
" do not lint while typing
let g:ale_lint_on_text_changed = 'never'
" Integrate ale with airline
let g:airline#extensions#ale#enabled = 1
set statusline=
set statusline+=%m
set statusline+=\ %f
set statusline+=%=
set statusline+=\ %{LinterStatus()}
" Enable nvim-scrollbar
lua require("gitsigns").setup()
lua require("scrollbar.handlers.gitsigns").setup()
lua require("scrollbar").setup()
"" Undo tree config
nnoremap <leader>t :UndotreeToggle<CR>
" Show a full-width diff window at the bottom
if !exists('g:undotree_WindowLayout')
let g:undotree_WindowLayout = 2
endif
" On windows, use a supported command for diffing files
if has('win64') || has('win32') || has('win16')
let g:undotree_DiffCommand = "FC"
endif
" Persistent undo across sessions
if has("persistent_undo")
let undo_path = expand('~/.undotree')
if !isdirectory(undo_path)
call mkdir(undo_path, "p", 0700)
endif
let &undodir=undo_path
set undofile
endif
" Configure multiple cursors
let g:VM_theme = 'iceblue'
" 'iceblue', 'olive', 'codedark', 'sand'
let g:VM_default_mappings = 0
let g:VM_maps = {}
let g:VM_maps["Find Under"] = '<C-n>'
let g:VM_maps["Find Subword Under"] = '<C-n>'
let g:VM_maps["Select All"] = '\\A'
let g:VM_maps["Start Regex Search"] = '\\/'
let g:VM_maps["Add Cursor Down"] = '<c-j>'
let g:VM_maps["Add Cursor Up"] = '<c-k>'
let g:VM_maps["Select Cursor Down"] = '<C-S-j>'
let g:VM_maps["Select Cursor Up"] = '<C-S-k>'
let g:VM_maps["Add Cursor At Pos"] = '\\\'
let g:VM_maps["Visual Regex"] = '\\/'
let g:VM_maps["Visual All"] = '\\A'
let g:VM_maps["Visual Add"] = '\\a'
let g:VM_maps["Visual Find"] = '\\f'
let g:VM_maps["Visual Cursors"] = '\\c'
" vim-commentary config
augroup commentary_commentstring
autocmd!
autocmd FileType toms,tpf,tbl setlocal commentstring=//\ %s
augroup END
" CamelCaseMotion config
" Replace the w, b, e, and ge motions with CamelCaseMotion
map <silent> w <Plug>CamelCaseMotion_w
map <silent> b <Plug>CamelCaseMotion_b
map <silent> e <Plug>CamelCaseMotion_e
map <silent> ge <Plug>CamelCaseMotion_ge
sunmap w
sunmap b
sunmap e
sunmap ge
" Use normal navigation with the leader key
noremap <leader>w :normal! w<CR>
noremap <leader>e :normal! e<CR>
noremap <leader>b :normal! b<CR>
" visual mode
xnoremap <leader>w :<C-u>normal! gvw<CR>
xnoremap <leader>e :<C-u>normal! gve<CR>
xnoremap <leader>b :<C-u>normal! gvb<CR>
" iamcco markdown preview config
" set to 1, nvim will open the preview window after entering the Markdown buffer
" default: 0
let g:mkdp_auto_start = 0
" set to 1, the nvim will auto close current preview window when changing
" from Markdown buffer to another buffer
" default: 1
let g:mkdp_auto_close = 0
" set to 1, Vim will refresh Markdown when saving the buffer or
" when leaving insert mode. Default 0 is auto-refresh Markdown as you edit or
" move the cursor
" default: 0
let g:mkdp_refresh_slow = 0
" set to 1, the MarkdownPreview command can be used for all files,
" by default it can be use in Markdown files only
" default: 0
let g:mkdp_command_for_global = 0
" set to 1, the preview server is available to others in your network.
" By default, the server listens on localhost (127.0.0.1)
" default: 0
let g:mkdp_open_to_the_world = 0
" use custom IP to open preview page.
" Useful when you work in remote Vim and preview on local browser.
" For more details see: https://github.com/iamcco/markdown-preview.nvim/pull/9
" default empty
let g:mkdp_open_ip = ''
" specify browser to open preview page
" for path with space
" valid: `/path/with\ space/xxx`
" invalid: `/path/with\\ space/xxx`
" default: ''
let g:mkdp_browser = 'C:\Program Files\BraveSoftware\Brave-Browser\Application\brave.exe'
" set to 1, echo preview page URL in command line when opening preview page
" default is 0
let g:mkdp_echo_preview_url = 0
" a custom Vim function name to open preview page
" this function will receive URL as param
" default is empty
let g:mkdp_browserfunc = ''
" options for Markdown rendering
" mkit: markdown-it options for rendering
" katex: KaTeX options for math
" uml: markdown-it-plantuml options
" maid: mermaid options
" disable_sync_scroll: whether to disable sync scroll, default 0
" sync_scroll_type: 'middle', 'top' or 'relative', default value is 'middle'
" middle: means the cursor position is always at the middle of the preview page
" top: means the Vim top viewport always shows up at the top of the preview page
" relative: means the cursor position is always at relative positon of the preview page
" hide_yaml_meta: whether to hide YAML metadata, default is 1
" sequence_diagrams: js-sequence-diagrams options
" content_editable: if enable content editable for preview page, default: v:false
" disable_filename: if disable filename header for preview page, default: 0
let g:mkdp_preview_options = {
\ 'mkit': {},
\ 'katex': {},
\ 'uml': {},
\ 'maid': {},
\ 'disable_sync_scroll': 0,
\ 'sync_scroll_type': 'middle',
\ 'hide_yaml_meta': 1,
\ 'sequence_diagrams': {},
\ 'flowchart_diagrams': {},
\ 'content_editable': v:false,
\ 'disable_filename': 0,
\ 'toc': {}
\ }
" use a custom Markdown style. Must be an absolute path
" like '/Users/username/markdown.css' or expand('~/markdown.css')
let g:mkdp_markdown_css = ''
" use a custom highlight style. Must be an absolute path
" like '/Users/username/highlight.css' or expand('~/highlight.css')
let g:mkdp_highlight_css = ''
" use a custom port to start server or empty for random
let g:mkdp_port = ''
" preview page title
" ${name} will be replace with the file name
let g:mkdp_page_title = '「${name}」'
" recognized filetypes
" these filetypes will have MarkdownPreview... commands
let g:mkdp_filetypes = ['markdown']
" set default theme (dark or light)
" By default the theme is defined according to the preferences of the system
let g:mkdp_theme = 'dark'
" combine preview window
" default: 0
" if enable it will reuse previous opened preview window when you preview markdown file.
" ensure to set let g:mkdp_auto_close = 0 if you have enable this option
let g:mkdp_combine_preview = 1
" auto refetch combine preview contents when change markdown buffer
" only when g:mkdp_combine_preview is 1
let g:mkdp_combine_preview_auto_refresh = 1
"" config quick-scope
" highlight only on keypress instead of always
let g:qs_highlight_on_keys = ['f', 'F', 't', 'T']
" Setup marks.nvim
lua << EOF
require('marks').setup()
EOF
" Setup Modes.nvim
lua << EOF
require("modes").setup()
EOF
" Enable indentLine without affecting json and markdown
let g:vim_json_conceal=0
let g:markdown_syntax_conceal=0
" config buffer_manager
lua << EOF
require("buffer_manager").setup({
-- Example options (all optional)
short_file_names = true,
short_term_names = true,
loop_nav = false,
show_cols = "both", -- "number" | "kbs" | "both"
win_position = { h = 0.5, v = 0.5 },
width = 0.6, -- relative if <= 1, absolute columns if > 1
height = 0.6, -- relative if <= 1, absolute rows if > 1
highlight = "Normal:NormalFloat",
-- Run different commands when selecting a buffer from the menu
select_menu_item_commands = {
edit = { key = "<CR>", command = "edit" },
v = { key = "v", command = "vsplit" },
s = { key = "s", command = "split" },
},
-- Close menu keys (defaults include "q" and <Esc>)
toggle_key_bindings = { "q", "<Esc>" },
})
EOF
" Toggle buffer menu
nnoremap <silent> <A--> :lua require("buffer_manager.ui").toggle_quick_menu()<CR>
" within the buffer menu, move buffers up and down
autocmd FileType buffer_manager vnoremap J :m '>+1<CR>gv=gv
autocmd FileType buffer_manager vnoremap K :m '<-2<CR>gv=gv
" Configure Winsep
lua << EOF
require("colorful-winsep").setup({
-- choose between "single", "rounded", "bold" and "double".
border = "bold",
excluded_ft = { "packer", "TelescopePrompt", "mason" },
highlight = nil, -- nil|string|function. See the docs's Highlights section
animate = {
---@type "shift"|"progressive"|false
enabled = "shift", -- false to disable or choose a option below (e.g. "shift") and set option for it if needed
shift = {
delay = 16, -- about 60fps
frames = 15, -- how many frames are required to complete the animation
},
progressive = {
delay = 16,
vertical_lerp_factor = 0.15, -- between 0 and 1
horizontal_lerp_factor = 0.15, -- between 0 and 1
},
},
indicator_for_2wins = {
-- only work when the total of windows is two
position = "center", -- false to disable or choose between "center", "start", "end" and "both"
symbols = {
-- the meaning of left, down ,up, right is the position of separator
start_left = "",
end_left = "",
start_down = "",
end_down = "",
start_up = "",
end_up = "",
start_right = "",
end_right = "",
},
},
})
EOF