-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_vimrc
More file actions
402 lines (370 loc) · 12 KB
/
Copy path_vimrc
File metadata and controls
402 lines (370 loc) · 12 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
source $VIMRUNTIME/vimrc_example.vim
"{{{1 General Customization
"{{{2 Setup minpac
" source $HOME/vimfiles/packages.vim
"}}}
"{{{2 Setup vim-plug
source $HOME/vimfiles/plugged.vim
"}}}
"{{{2 Customize VIM
language messages en
" set guifont=Fira_Code_Medium:h14:W500:cANSI:qCLEARTYPE{{{}}}
" set guitablabel=%N\ %t\
set tabstop=4 softtabstop=4
set shiftwidth=4
set expandtab
set autoindent
set smartindent
set colorcolumn=80
set signcolumn=yes
set nocursorline
set cpoptions+=$
set diffopt=vertical
set directory=$HOME/vimfiles/swapdir
set encoding=utf-8
set formatoptions-=o
" set guifont=Victor_Mono_Medium:h16:W500:cANSI:qDRAFT
" set guifont=VictorMono_Nerd_Font_Mono:h16:W600:cANSI:qDRAFT
set guicursor=i-v-n:block-blinkon0
" set guifont=CaskaydiaCove_Nerd_Font_Mono:h14:cANSI:qDRAFT
set guifont=Cascadia_Code_iCursive_Cg:h14:cANSI:qDRAFT
" set guifont=Fira_Code_iCursive_S12:h15:cANSI:qDRAFT
set guioptions=-TMrL
set guioptions=c
set hidden
set incsearch
set langmenu=en_US.UTF-8
set laststatus=2
set listchars=tab:\›\ ,eol:¬
set nocompatible
set relativenumber
set number
set cursorline
set noerrorbells
set belloff=all
set noshowmode
set path+=**
set pythonthreedll=python39.dll
set renderoptions=type:directx,renmode:5,taamode:1,gamma:10,contrast:1,geom:1
set scrolloff=8
set showbreak=●
set showtabline=2
set smartindent
set wildignore+=NTUSER.DAT*,.git/**,node_modules/**
if filereadable($HOME . "/vimfiles/" . $MYVIMPROFILE) | source $HOME/vimfiles/$MYVIMPROFILE | endif
"}}}2
"{{{2 Customize Colorscheme
if (has("termguicolors"))
set termguicolors
endif
if (strftime("%H")>=8 && strftime("%H")<=18)
" colorscheme yang
set background=light
else
" colorscheme yin
set background=dark
endif
set background=dark
colorscheme gruvbox-material
" colorscheme yui
" colorscheme nofrils-acme
" call functions#TweakHighlights()
" highlight CursorLine guibg=NONE guifg=NONE gui=underline
"}}}2
"{{{2 Maintain undo history between sessions
set noswapfile
set nobackup
set undofile
set undodir=$HOME/vimfiles/undodir
"}}}
"{{{2 Setup netrw
" let g:netrw_banner = 1
" let g:netrw_liststyle = 1
" let g:netrw_browse_split = 4
" let g_netrw_altv = 1
" let g:netrw_winsize = 25
" let g:netrw_keepdir = 0
" let g:netrw_scp_cmd='C:\"Program Files"\PuTTY\pscp.exe -q'
let g:netrw_scp_cmd='C:/msys64/mingw64/bin/pscp.exe -q'
let g:netrw_silent=1
"}}}
"{{{2 Setup grep program
set grepprg=mack\ --nogroup\ --column\ -k\ --nocolor\ --filename\ $*
set grepformat=%f:%l:%c:%m
"}}}2
"{{{2 Setup shell
" set shell=c:\Windows\System32\cmd.exe\ /k\ c:\opt\cmder\1.3.12\vendor\init.bat
set shell=c:\Windows\System32\cmd.exe
" set shell=c:/msys64/usr/bin/bash
"}}}2
"{{{2 Mappings
let mapleader = " "
nnoremap <F5> :redraw!
nnoremap <leader>h <C-w>h
nnoremap <leader>j <C-w>j
nnoremap <leader>k <C-w>k
nnoremap <leader>l <C-w>l
nnoremap <leader>C <C-w>c
nnoremap <leader>L :set list!<CR>
nnoremap <leader>ch :let @/=''<CR>
vnoremap <leader>c "+y
vnoremap <leader>x "+x
noremap <leader>p "+p
noremap <leader>ev :tabnew<CR>:edit $MYVIMRC<CR>
noremap <leader>sv :source $MYVIMRC<CR>:call functions#SetupCanvas()<CR>
noremap <leader>ef :tabnew<CR>:edit $HOME/vimfiles/autoload/functions.vim<CR>
noremap <leader>ep :tabnew<CR>:edit $HOME/vimfiles/plugged.vim<CR>
noremap <expr> <leader>es ":vsplit $HOME/vimfiles/ftplugin/" . &filetype . "/" . &filetype . ".xpt.vim<CR>"
noremap <leader>/ :call functions#ToggleComment()<CR>
nnoremap <leader>R :QuickRun<CR>
vnoremap <leader>R :QuickRun<CR>
nnoremap <leader>QQ :qa!<CR>
nnoremap <silent> <leader>ml :call functions#AppendModeline()<CR>
inoremap <C-l> <right>
inoremap <S-Return> <C-o>A
nnoremap <S-Return> A
inoremap <C-Return> <C-o>o
inoremap <C-BS> <Esc>diwa
nnoremap <leader>al :ALELint<CR><C-l>
nnoremap <leader>an :ALENext<CR><C-l>
noremap <leader>ap :ALEPrevious<CR><C-l>
vnoremap <leader>be c<c-r>=system('b64enc -e ' . &fenc, @")<cr><esc>
vnoremap <leader>bd c<c-r>=system('b64dec -e ' . &fenc, @")<cr><esc>
noremap <C-Left> :bprev<CR>
noremap <C-Right> :bnext<CR>
nnoremap - :Fern . -toggle -drawer<CR>
inoremap <silent><expr> <tab> pumvisible() ? coc#_select_confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
nmap <leader>gd <Plug>(coc-definitions)
nmap <leader>gr <Plug>(coc-references)
nnoremap <C-p> :Files!<CR>
nmap <leader>ob <Plug>(openbrowser-open)
"}}}2
"{{{2 Setup Statusline & Tabline
call functions#Statusline()
"}}}
"{{{2 Commands
command! -register CopyMatches call functions#CopyMatches(<q-reg>)
command! DarkMode colorscheme nofrils-dark
\ | let g:crystalline_theme="nofrils_dark"
\ | call functions#TweakHighlights()
\ | call crystalline#apply_current_theme()
command! LightMode colorscheme nofrils-acme
\ | let g:crystalline_theme="nofrils_acme"
\ | call functions#TweakHighlights()
\ | call crystalline#apply_current_theme()
command! BrightMode colorscheme nofrils-light
\ | let g:crystalline_theme="nofrils_light"
\ | call functions#TweakHighlights()
\ | call crystalline#apply_current_theme()
command! SepiaMode colorscheme nofrils-sepia
\ | let g:crystalline_theme="nofrils_sepia"
\ | call functions#TweakHighlights()
\ | call crystalline#apply_current_theme()
"}}}2
"{{{2 Auto Commands
if has("autocmd")
autocmd GUIEnter * call functions#SetupCanvas()
autocmd ColorScheme * call functions#Statusline()
filetype on
filetype plugin indent on
" set omnifunc=syntaxcomplete#Complete
augroup VIM
autocmd!
autocmd FileType vim let b:comment_leader="\" "
augroup END
augroup AHK
autocmd!
autocmd FileType autohotkey setlocal fileencoding=utf-8 commentstring=;%s
autocmd FileType autohotkey let b:comment_leader="; "
autocmd FileType autohotkey let b:AutoPairs = {'(':')', '[':']', '{':'}', '"':'"', "'":"'"}
" autocmd FileType autohotkey RainbowParentheses
augroup JVM
autocmd!
autocmd FileType groovy,java,scala,kotlin setlocal commentstring=//%s
autocmd FileType groovy,java,scals,kotlin let b:comment_leader="// "
autocmd FileType groovy,java let b:AutoPairs = {'(':')', '[':']', '{':'}', '"':'"', "'":"'"}
" autocmd FileType groovy RainbowParentheses
augroup BAT
autocmd!
autocmd FileType dosbatch let b:comment_leader=":: "
augroup END
augroup LDIF
autocmd!
autocmd FileType ldif setlocal textwidth=76 wrap commentstring=#%s
augroup END
augroup LUA
autocmd!
autocmd FileType lua let b:comment_leader="-- "
augroup END
augroup WEB
autocmd!
autocmd FileType css,scss,sass,html,json,jsp,yaml
\ setlocal tabstop=2 shiftwidth=2 softtabstop=2
augroup END
augroup MARKDOWN
autocmd!
autocmd FileType markdown setlocal textwidth=80
augroup END
augroup PLANTUML
autocmd!
autocmd FileType puml,plantuml
\ setlocal tabstop=2 shiftwidth=2 softtabstop=2
autocmd FileType puml,plantuml let b:comment_leader="' "
autocmd FileType puml,plantuml let b:AutoPairs = {'(':')', '[':']', '{':'}', '"':'"'}
augroup END
augroup PY
autocmd!
autocmd FileType python
\ setlocal number autoindent expandtab textwidth=80
\ tabstop=4 shiftwidth=4 softtabstop=0 smarttab
autocmd FileType python let b:comment_leader="#"
autocmd FileType python let b:ale_fixers = ["black", "mypy"]
augroup END
augroup HASKELL
autocmd!
autocmd FileType haskell,lhaskell
\ setlocal textwidth=80 softtabstop=0 smarttab nocindent
autocmd FileType haskell let b:comment_leader="-- "
augroup END
augroup YAML
autocmd!
autocmd FileType yaml
\ setlocal tabstop=2 shiftwidth=2
autocmd FileType yaml let b:comment_leader="# "
augroup END
augroup XPT.VIM
autocmd!
autocmd FileType xpt.vim let b:AutoPairs = {'(':')', '[':']', '{':'}', '"':'"', "'":"'", '`':'^'}
augroup END
augroup my-glyph-palette
autocmd! *
autocmd FileType fern call glyph_palette#apply()
" autocmd FileType nerdtree,startify call glyph_palette#apply()
augroup END
endif
"}}}2
" Show syntax highlighting groups for word under cursor
function! <SID>SynStack()
if !exists("*synstack")
return
endif
echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
endfunc
nmap <C-x> :call <SID>SynStack()<CR>
"}}}1
"{{{1 Plugin Customization
"{{{2 Crystalline
" let g:crystalline_statusline_fn = 'functions#StatusLine'
" let g:crystalline_tabline_fn = 'functions#TabLine'
" let g:crystalline_theme = substitute(colors_name, "-", "_", "")
" let g:crystalline_tab_mod = " * "
"}}}2
"{{{2 Emmet
let g:user_emmet_leader_key = '<c-z>'
"}}}2
"{{{2 YouCompleteMe
" let g:ycm_seed_identifiers_with_syntax = 1
" let g:ycm_key_list_previous_completion = ['<Down>']
" let g:ycm_key_list_select_completion = ['<Right>']
" let g:ycm_key_list_stop_completion = ['<C-y']
" " let g:ycm_use_ultisnips_completer = 0
" " let g:ycm_enable_diagnostic_signs = 0
" " let g:ycm_autoclose_preview_window_after_insertion = 1
" let g:ycm_add_preview_to_completeopt = 0
" set completeopt-=preview
"}}}2
"{{{2 SnipMate
let g:snipMate = {}
let g:snipMate.description_in_completion = 1
"}}}2
"{{{2 Tagbar
" let g:tagbar_iconchars = ['', '']
" let g:tagbar_autofocus = 1
"}}}2
"{{{2 CtrlP
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/]node_modules|\v[\/]\.(git|hg|svn)$',
\ 'file': '\v\.(exe|dll|class)$'
\ }
"}}}2
"{{{2 NERDTree
" let g:NERDTreeDirArrowExpandable = ''
" let g:NERDTreeDirArrowCollapsible = ''
" let g:NERDTreeDirArrowExpandable = '▶'
" let g:NERDTreeDirArrowCollapsible = '▼'
" let NERDTreeQuitOnOpen = 1
"}}}2
"{{{2 Syntastic
" let g:syntastic_javascript_checkers = ["eslint"]
" let g:syntastic_javascript_eslint_exe = "eslint"
" let g:syntastic_javascript_arg = " "
" let g:syntastic_check_on_open = 0
" let g:syntasitc_check_on_wq = 0
" let g:syntastic_map_mode = { "mode": "passive" }
" let g:syntastic_stl_format = "%F;%e;%w"
"}}}2
"{{{2 Ale
let g:ale_completion_enabled = 0
let g:ale_lint_on_text_changed = 0
let g:ale_lint_on_enter = 0
let g:ale_lint_on_insert_leave = 0
let g:ale_open_list = 0
let g:ale_jq_executable = "C:/opt/bin/jq.exe"
let g:ale_xml_xmllint_executable = "C:/opt/bin/xmllint.exe"
let g:ale_xml_xmlstarlet_executable = "C:/opt/bin/xml.exe"
let g:ale_autohotkey_ahklint_executable = "C:/opt/bin/ahklint.exe"
let g:ale_ldif_ldiflint_executable = "C:/opt/bin/ldiflint.exe"
let g:ale_yaml_yamllint_executable = "C:/Users/srp/AppData/Roaming/Python/Python39/Scripts/yamllint.exe"
"}}}2
"{{{2 vim-jsx-pretty
let g:vim_jsx_pretty_colorful_config = 1
"}}}2
"{{{2 haskell-vim
let g:haskell_classic_highlighting = 1
"}}}2
"{{{2 Rainbow Parentheses
" let g:rainbow#pairs = [['(',')'], ['[',']']]
" let g:rainbow#max_level = 16
"}}}
"{{{2 Quickrun
let g:quickrun_config = {}
let g:quickrun_config.plantuml = {
\ 'command': 'plantuml',
\ 'exec': 'java -jar c:/var/java/lib/plantuml.jar %o %s',
\ 'cmdopt': '-overwrite',
\ 'outputter': 'browser',
\ 'outputter/browser/name': '%{expand("%:p:r:t").".png"}', }
let g:quickrun_config.markdown = {
\ 'type': 'markdown/pandoc',
\ 'cmdopt': '',
\ 'outputter': 'browser', }
let g:quickrun_config.autohotkey = {
\ 'exec': 'ahk c q -a %{expand("%")}',
\ 'outputter/buffer/opener': 'new' }
let g:quickrun_config.groovy = {
\ 'command' : 'groovy'
\, 'cmdopt' : '' }
let g:quickrun_config.ballerina = {
\ 'exec' : 'c:/opt/ballerina/bin/bal.bat run %{expand("%")}' }
"}}}
"{{{2 Fern
let g:fern#renderer = "nerdfont"
"}}}
"{{{2 vim-lsc
" let g:lsc_server_commands = {'java': 'c:/var/lsp/java-language-server/dist/lang_server_windows.cmd'}
"}}}
"{{{2 Hexokinase
let g:Hexokinase_highlighters = [ 'sign_column' ]
let g:Hexokinase_ftEnabled = ['css', 'html', 'javascript', 'text', 'vim', 'colortemplate']
"}}}
"{{{2 FZF
let g:fzf_preview_window = []
"}}}
"{{{2 Python-Syntax
let g:python_highlight_string_formatting=1
let g:python_highlight_string_format=1
"}}}
"}}}1
" vim:tw=78:ts=4:sts=4:sw=4:noet:ft=vim:nobomb
" vim:fdm=marker