-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc.settings
More file actions
868 lines (781 loc) · 29.1 KB
/
vimrc.settings
File metadata and controls
868 lines (781 loc) · 29.1 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
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
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
" All system-wide defaults are set in $VIMRUNTIME/debian.vim (usually just
" /usr/share/vim/vimcurrent/debian.vim) and sourced by the call to :runtime
" you can find below. If you wish to change any of those settings, you should
" do it in this file (/etc/vim/vimrc), since debian.vim will be overwritten
" everytime an upgrade of the vim packages is performed. It is recommended to
" make changes after sourcing debian.vim since it alters the value of the
" 'compatible' option.
" This line should not be removed as it ensures that various options are
" properly set to work with the Vim-related packages available in Debian.
runtime! debian.vim
" Uncomment the next line to make Vim more Vi-compatible
" NOTE: debian.vim sets 'nocompatible'. Setting 'compatible' changes numerous
" options, so any other options should be set AFTER setting 'compatible'.
"set compatible
" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
if has("syntax")
syntax on
endif
" If using a dark background within the editing area and syntax highlighting
" turn on this option as well
" set background=dark
" Uncomment the following to have Vim jump to the last position when
" reopening a file
if has("autocmd")
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
endif
" Uncomment the following to have Vim load indentation rules and plugins
" according to the detected filetype.
"if has("autocmd")
" execute pathogen#infect()
" filetype plugin indent on
"endif
call plug#begin('~/.vim/bundle')
Plug 'rking/ag.vim'
Plug 'mattn/calendar-vim'
Plug 'vim-scripts/Conque-Shell'
" Plug 'SirVer/ultisnips'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'davidhalter/jedi-vim'
Plug 'python-mode/python-mode', { 'for': 'python', 'branch': 'develop' }
Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app && npx --yes yarn install' }
Plug 'scrooloose/nerdtree'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'danro/rename.vim'
Plug 'godlygeek/tabular'
Plug 'liuchengxu/vista.vim'
Plug 'mbbill/undotree'
" ******* color scheme *********
Plug 'tomasr/molokai'
Plug 'ku1ik/vim-monokai'
Plug 'joshdick/onedark.vim'
Plug 'kyoz/purify', {'rtp': 'vim'}
Plug 'rakr/vim-one'
Plug 'folke/tokyonight.nvim'
Plug 'NLKNguyen/papercolor-theme'
Plug 'catppuccin/nvim'
" ******************************
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" Plug 'itchyny/lightline.vim'
Plug 'google/vim-codefmt'
Plug 'tpope/vim-commentary'
Plug 'easymotion/vim-easymotion'
Plug 'tpope/vim-fugitive'
Plug 'ludovicchabant/vim-gutentags'
Plug 'inkarkat/vim-ingo-library'
Plug 'xuhdev/vim-latex-live-preview'
Plug 'andrejlevkovitch/vim-lua-format'
Plug 'google/vim-maktaba'
Plug 'inkarkat/vim-mark'
Plug 'samoshkin/vim-mergetool'
Plug 'kshenoy/vim-signature'
Plug 'tpope/vim-surround'
Plug 'lervag/vimtex'
Plug 'vimwiki/vimwiki'
Plug 'Yggdroot/LeaderF', { 'do': ':LeaderfInstallCExtension' }
Plug 'skywind3000/vim-quickui'
Plug 'skywind3000/asynctasks.vim'
Plug 'skywind3000/asyncrun.vim'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'pappasam/coc-jedi', { 'do': 'yarn install --frozen-lockfile && yarn build', 'branch': 'main' }
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'nvim-telescope/telescope-fzf-native.nvim'
Plug 'LukasPietzschmann/telescope-tabs'
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'HiPhish/rainbow-delimiters.nvim'
Plug 'kyazdani42/nvim-web-devicons'
Plug 'ryanoasis/vim-devicons'
Plug 'dhananjaylatkar/cscope_maps.nvim' " cscope keymaps
Plug 'echasnovski/mini.files'
Plug 'mg979/vim-visual-multi', {'branch': 'master'}
Plug 'chiphogg/vim-prototxt'
Plug 'wookayin/semshi', { 'do': ':UpdateRemotePlugins' }
Plug 'williamboman/mason.nvim'
call plug#end()
" The following are commented out as they cause vim to behave a lot
" differently from regular Vi. They are highly recommended though.
"set showcmd " Show (partial) command in status line.
"set showmatch " Show matching brackets.
"set ignorecase " Do case insensitive matching
"set smartcase " Do smart case matching
"set incsearch " Incremental search
"set autowrite " Automatically save before commands like :next and :make
"set hidden " Hide buffers when they are abandoned
"set mouse=a " Enable mouse usage (all modes)
" Source a global configuration file if available
if filereadable("/etc/vim/vimrc.local")
source /etc/vim/vimrc.local
endif
"****************************************
"New file title
"****************************************
autocmd BufNewFile *.py call SetPythonHeader()
autocmd BufNewFile *.hpp,*.cpp,*.cc,*.[ch],*.sh,*.java call SetHeader()
let $author_name = "{set name in ~/.vimrc line 62}"
let $author_email = "{set mail in ~/.vimrc line 63}"
let $default_license = "{set license in ~/.vimrc line 64}"
function! SetHeader()
"*.sh
if &filetype == 'sh'
call setline(1,"\#########################################################################")
call append(line("."), "\#")
call append(line(".")+1, "\# Author: ".$author_name)
call append(line(".")+2, "\# Mail: ".$author_email)
call append(line(".")+3, "\# FileName: ".expand("%:t"))
call append(line(".")+4, "\#")
call append(line(".")+5, "\# Created On: ".strftime("%c"))
call append(line(".")+6, "\#")
call append(line(".")+7, "\#########################################################################")
call append(line(".")+8, "")
call append(line(".")+9, "\#!/bin/bash")
call append(line(".")+10, "")
else
call setline(1,"/*************************************************************************")
call append(line("."), "\*")
call append(line(".")+1, "\* Author: ".$author_name)
call append(line(".")+2, "\* Mail: ".$author_email)
call append(line(".")+3, "\* FileName: ".expand("%:t"))
call append(line(".")+4, "\*")
call append(line(".")+5, "\* Created On: ".strftime("%c"))
call append(line(".")+6, "\* Licensed under The ".$default_license." License [see LICENSE for details]")
call append(line(".")+7, "\*")
call append(line(".")+8, "************************************************************************/")
call append(line(".")+9, "")
endif
"*.cpp
if &filetype == 'cpp'
call append(line(".")+10, "#include <iostream>")
call append(line(".")+11, "")
endif
"*.cc
if &filetype == 'cc'
call append(line(".")+10, "#include <iostream>")
call append(line(".")+11, "")
endif
"*.c
if &filetype == 'c'
call append(line(".")+10, "#include <stdio.h>")
call append(line(".")+11, "")
endif
"Goto end of file
"autocmd BufEnter * normal G
endfunc
function! SetPythonHeader()
call setline(1,"\#!/usr/bin/env python3")
call append(line("."), "\"\"\"")
call append(line(".")+1, " Author: ".$author_name)
call append(line(".")+2, " Mail: ".$author_email)
call append(line(".")+3, " FileName: ".expand("%:t"))
call append(line(".")+4, "")
call append(line(".")+5, " Created On: ".strftime("%c"))
call append(line(".")+6, " Licensed under The ".$default_license." License [see LICENSE for details]")
call append(line(".")+7, "\"\"\"")
" autocmd BufEnter * normal G
endfunc
"****************************************
"cscope config
"****************************************
function! LoadCscope()
let db = findfile("cscope.out", ".;")
if (!empty(db))
let path = strpart(db, 0, match(db, "/cscope.out$"))
set nocscopeverbose " suppress 'duplicate connection' error
exe "cs add " . db . " " . path
set cscopeverbose
" else add the database pointed to by environment variable
elseif $CSCOPE_DB != ""
cs add $CSCOPE_DB
endif
endfunction
" au BufEnter /* call LoadCscope()
" nmap <Leader>g :cs find g <C-R>=expand("<cword>")<CR><CR>
" nmap <Leader>s :cs find s <C-R>=expand("<cword>")<CR><CR>
" nmap <Leader>d :cs find d <C-R>=expand("<cword>")<CR><CR>
" nmap <Leader>c :cs find c <C-R>=expand("<cword>")<CR><CR>
" nmap <Leader>t :cs find t <C-R>=expand("<cword>")<CR><CR>
" nmap <Leader>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
" nmap <Leader>I :cs find i <C-R>=expand("<cfile>")<CR><CR>
map <C-F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR><CR>
nnoremap <C-]> g<C-]>
"****************************************
"NERDTREE config"
"****************************************
"autocmd vimenter * NERDTree
wincmd w
autocmd vimenter * wincmd w
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
let g:NERDTreeGitStatusUseNerdFonts = 1
" Highlight current line
"au WinLeave * set nocursorline nocursorcolumn
"au WinEnter * set cursorline cursorcolumn
"set cursorline cursorcolumn
set cursorcolumn
"****************************************
"airline settings
"****************************************
" let g:airline_theme="hybridline"
let g:airline_theme="simple"
set laststatus=2
set t_Co=256
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#left_sep = ' '
let g:airline#extensions#tabline#left_alt_sep = '|'
let g:airline#extensions#tabline#buffer_nr_show = 1
nnoremap <C-TAB> :bn<CR>
nnoremap <C-S-TAB> :bp<CR>
" unicode symbols
let g:airline_left_sep = '»'
let g:airline_left_sep = '▶'
let g:airline_right_sep = '«'
let g:airline_right_sep = '◀'
let g:airline_symbols_branch = '⎇'
"****************************************
"vim-fugitive config"
"****************************************
" set laststatus=2 " Always display the status line
" set statusline+=%{fugitive#statusline()} " Git Hotness
"****************************************
"vista settings
"****************************************
function! NearestMethodOrFunction() abort
return get(b:, 'vista_nearest_method_or_function', '')
endfunction
set statusline+=%{NearestMethodOrFunction()}
autocmd VimEnter * call vista#RunForNearestMethodOrFunction()
" How each level is indented and what to prepend.
" This could make the display more compact or more spacious.
" e.g., more compact: ["▸ ", ""]
" Note: this option only works for the kind renderer, not the tree renderer.
let g:vista_icon_indent = ["╰─▸ ", "├─▸ "]
" Executive used when opening vista sidebar without specifying it.
" See all the avaliable executives via `:echo g:vista#executives`.
let g:vista_default_executive = 'ctags'
" Set the executive for some filetypes explicitly. Use the explicit executive
" instead of the default one for these filetypes when using `:Vista` without
" specifying the executive.
let g:vista_executive_for = {
\ 'cpp': 'ctags',
\ 'php': 'vim_lsp',
\ }
" Declare the command including the executable and options used to generate ctags output
" for some certain filetypes.The file path will be appened to your custom command.
" For example:
let g:vista_ctags_cmd = {
\ 'haskell': 'hasktags -x -o - -c',
\ }
" To enable fzf's preview window set g:vista_fzf_preview.
" The elements of g:vista_fzf_preview will be passed as arguments to fzf#vim#with_preview()
" For example:
let g:vista_fzf_preview = ['right:50%']
" Ensure you have installed some decent font to show these pretty symbols, then you can enable icon for the kind.
let g:vista#renderer#enable_icon = 1
" The default icons can't be suitable for all the filetypes, you can extend it as you wish.
let g:vista#renderer#icons = {
\ "function": "\uf794",
\ "variable": "\uf71b",
\ }
nnoremap <silent> <F8> :Vista!!<CR>
"****************************************
"LeaderF settings:
"****************************************
let g:Lf_ShortcutF = '<C-P>'
let g:Lf_WindowPosition = 'popup'
let g:Lf_PreviewInPopup = 1
let g:Lf_ReverseOrder = 1
let g:Lf_WorkingDirectoryMode = 'AF'
let g:Lf_RootMarkers = ['.git', '.svn', '.hg', '.project', '.root']
let g:Lf_WildIgnore = {
\ 'dir': ['.git', '.ccls-cache', '__pycache__'],
\ }
"****************************************
"ag settings:
"****************************************
let g:ag_working_path_mode="r"
nmap <F2> :Ag! --noaffinity<space>
"****************************************
"markdown preview:
"****************************************
nmap <F9>o :MarkdownPreview<CR>
nmap <F9>q :MarkdownPreviewStop<CR>
function! SetupPython()
setlocal softtabstop=4
setlocal tabstop=4
setlocal shiftwidth=4
endfunction
command! -bar SetupPython call SetupPython()
"****************************************
"vimwiki"
"****************************************
let g:vimwiki_list = [{'path': '~/Documents/VimWiki/', 'syntax': 'markdown', 'ext': '.md'}]
au BufRead, BufNewFile *.wiki set filetype=vimwiki
function! ToggleCalendar()
execute ":Calendar"
if exists("g:calendar_open")
if g:calendar_open == 1
execute "q"
unlet g:calendar_open
else
g:calendar_open = 1
end
else
let g:calendar_open = 1
end
endfunction
:autocmd FileType vimwiki map <Leader>c :call ToggleCalendar()<CR>
:nnoremap <F7> "=strftime("%Y-%m-%d")<CR>P
:inoremap <F7>t <C-R>=strftime("%Y-%m-%d")<CR>
":autocmd FileType vimwiki map c :Calendar<CR>
"****************************************
"Calendar"
"****************************************
autocmd bufenter * if (winnr("$") == 1 && exists("b:Calendar")) | q | endif
"****************************************
"vim-mark"
"****************************************
let g:mwDefaultHighlightingPalette = 'extended'
"****************************************
"google vim codefmt"
"****************************************
"augroup autoformat_settings
" autocmd FileType bzl AutoFormatBuffer buildifier
" autocmd FileType c,cpp,proto,javascript AutoFormatBuffer clang-format
" autocmd FileType dart AutoFormatBuffer dartfmt
" autocmd FileType go AutoFormatBuffer gofmt
" autocmd FileType gn AutoFormatBuffer gn
" autocmd FileType html,css,json AutoFormatBuffer js-beautify
" autocmd FileType java AutoFormatBuffer google-java-format
" autocmd FileType python AutoFormatBuffer yapf
" " Alternative: autocmd FileType python AutoFormatBuffer autopep8
"augroup END
"****************************************
"ultisnips"
"****************************************
" let $snipath = $HOME."/.vim/ultisnips"
" let g:UltiSnipsSnippetDirectories = [$snipath]
" " Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe.
" let g:UltiSnipsExpandTrigger="<c-m>"
" let g:UltiSnipsJumpForwardTrigger="<c-b>"
" let g:UltiSnipsJumpBackwardTrigger="<c-z>"
" " If you want :UltiSnipsEdit to split your window.
" let g:UltiSnipsEditSplit="vertical"
"****************************************
"coc-ultisnips"
"****************************************
let $snipath = $HOME."/.vim/ultisnips"
" let g:snippets.userSnippetsDirectory = [$snipath]
imap <c-l> <Plug>(coc-snippets-expand)
xmap <leader>x <Plug>(coc-convert-snippet)
" nmap <silent> [g <Plug>(coc-diagnostic-prev)
" nmap <silent> ]g <Plug>(coc-diagnostic-next)
" GoTo code navigation
" nmap <silent> gd <Plug>(coc-definition)
" nmap <silent> gy <Plug>(coc-type-definition)
" nmap <silent> gi <Plug>(coc-implementation)
" nmap <silent> gr <Plug>(coc-references)
" nmap <Leader>s <Plug>(coc-references)
"****************************************
"cscope_maps"
"****************************************
lua << EOF
local work_path = os.getenv("PWD")
if (work_path == os.getenv("HOME")) then
return
end
local f = io.popen('find "'..work_path..'" -name cscope.out')
local cscope_file = nil
for file in f:lines() do --Loop through all files
cscope_file = file
end
require("cscope_maps").setup{
disable_maps = true,
skip_input_prompt = true,
vim.api.nvim_set_keymap(
"n",
"<leader>s",
[[<cmd>lua require('cscope_maps').cscope_prompt('s', vim.fn.expand("<cword>"))<cr>]],
{ noremap = true, silent = true }
),
cscope = {
-- location of cscope db file
db_file = cscope_file,
-- cscope executable
exec = "cscope", -- "cscope" or "gtags-cscope"
-- choose your fav picker
picker = "telescope", -- "telescope", "fzf-lua" or "quickfix"
-- "true" does not open picker for single result, just JUMP
skip_picker_for_single_result = false, -- "false" or "true"
-- these args are directly passed to "cscope -f <db_file> <args>"
db_build_cmd_args = { "-bqkv" },
-- statusline indicator, default is cscope executable
statusline_indicator = nil,
},
}
EOF
"****************************************
"jedi-vim"
"****************************************
let g:jedi#completions_enabled = 0
"****************************************
"deoplete.nvim"
"****************************************
let g:deoplete#enable_at_startup = 1
"****************************************
"python-mode"
"****************************************
let g:pymode_rope = 0
let g:pymode_options_max_line_length = 120
let g:pymode_lint_ignore = ["E501", "W0611", "W0612", "E231", "E116", "E402", "C901"]
"****************************************
"coc.nvim"
"****************************************
let g:coc_node_path='/usr/local/bin/node'
"****************************************
"fzf"
"****************************************
set rtp+=/usr/local/opt/fzf
"****************************************
"gutentags"
"****************************************
" let g:gutentags_trace = 1
let g:gutentags_project_root = ['.root', '.svn', '.git', '.hg', '.project']
let g:gutentags_ctags_tagfile = 'tags'
let s:vim_tags = expand('~/.cache/ctags')
let g:gutentags_cache_dir = s:vim_tags
let g:gutentags_exclude_filetypes = ['gitcommit', 'gitconfig', 'gitrebase', 'gitsendemail', 'git', 'BCLOUD']
let g:gutentags_ctags_extra_args = ['--fields=+niazS', '--extras=+q']
let g:gutentags_ctags_extra_args += ['--c++-kinds=+px']
let g:gutentags_ctags_extra_args += ['--c-kinds=+px']
let g:gutentags_ctags_exclude = [
\ '*.git', '*.svn', '*.hg', '*.ccls-cache',
\ 'cache', 'build', 'dist', 'bin', 'node_modules', 'bower_components',
\ '*-lock.json', '*.lock',
\ '*.min.*',
\ '*.bak',
\ '*.zip',
\ '*.pyc',
\ '*.class',
\ '*.sln',
\ '*.csproj', '*.csproj.user',
\ '*.tmp',
\ '*.cache',
\ '*.vscode',
\ '*.pdb',
\ '*.exe', '*.dll', '*.bin',
\ '*.mp3', '*.ogg', '*.flac',
\ '*.swp', '*.swo',
\ '.DS_Store', '*.plist',
\ '*.bmp', '*.gif', '*.ico', '*.jpg', '*.png', '*.svg',
\ '*.rar', '*.zip', '*.tar', '*.tar.gz', '*.tar.xz', '*.tar.bz2',
\ '*.pdf', '*.doc', '*.docx', '*.ppt', '*.pptx', '*.xls',
\ '*.yml', '*.gcc_cmd', 'output',
\]
if !isdirectory(s:vim_tags)
silent! call mkdir(s:vim_tags, 'p')
endif
"****************************************
"colorscheme"
"****************************************
if (has("termguicolors"))
set termguicolors
endif
"------ dracula ------
" let g:dracula_colorterm = 0
" colorscheme dracula
"------ molokai ------
" colorscheme molokai
" let g:molokai_original = 1
" let g:rehash256 = 1
" hi Normal ctermbg=black guibg=black
"------ monokai ------
" colorscheme monokai
" highlight Normal ctermbg=None
" hi Normal ctermbg=black guibg=black
" ------ purify ------
" colorscheme purify
" let g:lightline = {
" \ 'colorscheme': 'purify',
" \ }
"------ one ------
" colorscheme one
" set background=dark
" let g:one_allow_italics = 1
" let g:airline_theme='one'
" ------ onedark ------
" let g:onedark_terminal_italics = 1
" colorscheme onedark
" let g:lightline = {
" \ 'colorscheme': 'onedark',
" \ }
" ------ challenger_deep ------
" colorscheme challenger_deep
" ------ papercolor ------
" set t_Co=256
" set background=dark
" colorscheme PaperColor
" colorscheme vividchalk
" ------ tokyonight ------
" colorscheme tokyonight
colorscheme tokyonight-night
" colorscheme tokyonight-storm
" colorscheme tokyonight-day
" colorscheme tokyonight-moon
" ------ catppuccin ------
" colorscheme catppuccin
" hi Normal ctermbg=black guibg=black
"****************************************
"vim-latex-live-preview"
"****************************************
" let g:livepreview_previewer = 'evince'
let g:livepreview_previewer = 'zathura'
let g:livepreview_engine = 'xelatex'
:autocmd FileType vimwiki,tex setlocal updatetime=200
nmap <Leader>L :set syntax=tex<CR>
" :LLPStartPreview
"****************************************
"undotree"
"****************************************
nnoremap <F5> :UndotreeToggle<CR>
"****************************************
"rainbow"
"****************************************
" let g:rainbow_active = 1
" let g:rainbow_conf = {
" \ 'separately': {
" \ 'cmake': 0,
" \ 'vimwiki': 0,
" \ 'markdown': 0,
" \ 'gitcommit': 0,
" \ }
" \}
"****************************************
"asyncomplete"
"****************************************
if executable('pyls')
" pip install python-language-server
au User lsp_setup call lsp#register_server({
\ 'name': 'pyls',
\ 'cmd': {server_info->['pyls']},
\ 'allowlist': ['python'],
\ })
endif
if executable('ccls')
" pip install python-language-server
au User lsp_setup call lsp#register_server({
\ 'name': 'pyls',
\ 'cmd': {server_info->['pyls']},
\ 'allowlist': ['python'],
\ })
endif
"****************************************
"quickui"
"****************************************
let g:asynctasks_term_pos = 'tab'
let g:quickui_color_scheme = 'papercol dark'
let g:asyncrun_open = 6
call quickui#menu#reset()
call quickui#menu#install("&File", [
\ [ "Leaderf &File", 'Leaderf file', 'Open file with leaderf'],
\ [ "Leaderf &Recently", 'Leaderf mru --regexMode', 'Open recently accessed files'],
\ [ "Leaderf &Buffer", 'Leaderf buffer', 'List current buffers in leaderf'],
\ ])
call quickui#menu#install("&Build", [
\ ["Project &Build", 'AsyncTask build'],
\ ["Project &Run", 'AsyncTask run'],
\ ])
call quickui#menu#install("&Git", [
\ ['&View Diff', 'Gdiff'],
\ ['&Show Log', 'Glog'],
\ ['File &Add', 'Gw'],
\ ])
call quickui#menu#install('&Tools', [
\ ['List &Buffer', 'call quickui#tools#list_buffer("e")', ],
\ ['List &Function', 'call quickui#tools#list_function()', ],
\ ['Display &Messages', 'call quickui#tools#display_messages()', ],
\ ])
call quickui#menu#install('&Plugin', [
\ ["&FileLists\t<space>tn", 'lua MiniFiles.open()', 'toggle nerdtree'],
\ ['&Tagbar', 'Vista!!', 'toggle Vista'],
\ ["-"],
\ ["&Display Calendar", "Calendar", "display a calender"],
\ ["-"],
\ ["Plugin &Status", "PlugStatus", "Check plugins status"],
\ ["Plugin &Update", "PlugUpdate", "Update plugin"],
\ ])
call quickui#menu#install('Help (&?)', [
\ ["&Index", 'tab help index', ''],
\ ['Ti&ps', 'tab help tips', ''],
\ ['--',''],
\ ["&Tutorial", 'tab help tutor', ''],
\ ['&Quick Reference', 'tab help quickref', ''],
\ ['&Summary', 'tab help summary', ''],
\ ['--',''],
\ ['&Vim Script', 'tab help eval', ''],
\ ['&Function List', 'tab help function-list', ''],
\ ['&Dash Help', 'call asclib#utils#dash_ft(&ft, expand("<cword>"))'],
\ ], 10000)
" let g:quickui_show_tip = 1
"----------------------------------------------------------------------
" context menu
"----------------------------------------------------------------------
let g:context_menu_k = [
\ ["&CopyHistory\t:reg", 'reg', 'Display copy history'],
\ ["&FileLists", 'lua MiniFiles.open()', 'toggle nerdtree'],
\ ['&Tagbar', 'Vista!!', 'toggle Vista'],
\ ['List &Buffer', 'call quickui#tools#list_buffer("e")', ],
\ ["&Search in Project", 'Ag! --noaffinity "<cword>"'],
\ [ "--", ],
\ [ "&Align symbol\t\:Tabularize \/symbol", ':Tabularize'],
\ [ "--", ],
\ [ "Git Add\t", 'Git add .', 'Git add .'],
\ [ "Git Diff\t", 'Git diff', 'Git diff'],
\ [ "Git Diff --cached\t", 'Git diff --cached', 'Git diff --cached'],
\ [ "Git Commit\t", 'Git commit', 'Git commit'],
\ [ "Git Commit --amend\t", 'Git commit --amend', 'Git commit --amend'],
\ [ "Git Push\t", 'Git push', 'Git push'],
\ [ "--", ],
\ [ "Find &Definition\t\\g", 'cs find g "<cword>"', 'Cscope search g'],
\ [ "Find Symbol\t\\s", 'cs find s "<cword>"', 'Cscope search s'],
\ [ "Find Called by this function\t\\d", 'cs find d "<cword>"', 'Cscope search d'],
\ [ "Find Calling this function\t\\c", 'cs find c "<cword>"', 'Cscope search c'],
\ [ "Find Text string\t\\t", 'cs find t "<cword>"', 'Cscope search c'],
\ [ "Find Files including this file\t\\i", 'cs find i "<cword>"', 'Cscope search c'],
\ [ "--", ],
\ ['Dash &Help', 'call asclib#utils#dash_ft(&ft, expand("<cword>"))'],
\ ['Cpp&man', 'exec "Cppman " . expand("<cword>")', '', 'c,cpp'],
\ ['P&ython Doc', 'call quickui#tools#python_help("")', 'python'],
\ ]
"----------------------------------------------------------------------
" hotkey
"----------------------------------------------------------------------
nnoremap <silent><leader><space> :call quickui#menu#open()<cr>
nnoremap <silent>F :call quickui#tools#clever_context('k', g:context_menu_k, {})<cr>
if has('gui_running') || has('nvim')
noremap <c-f10> :call MenuHelp_TaskList()<cr>
endif
set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux
set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.idea/*,*/.DS_Store,*/vendor
"****************************************
"telescope.nvim"
"****************************************
" Find files using Telescope command-line sugar.
" nnoremap <leader>ff <cmd>Telescope find_files<cr>
" nnoremap <leader>fg <cmd>Telescope live_grep<cr>
" nnoremap <leader>fb <cmd>Telescope buffers<cr>
" nnoremap <leader>fh <cmd>Telescope help_tags<cr>
" " Using Lua functions
nnoremap <leader>ff <cmd>lua require('telescope.builtin').find_files()<cr>
nnoremap <leader>fg <cmd>lua require('telescope.builtin').live_grep()<cr>
nnoremap <leader>fb <cmd>lua require('telescope.builtin').buffers()<cr>
nnoremap <leader>fh <cmd>lua require('telescope.builtin').help_tags()<cr>
nnoremap <leader>fr <cmd>lua require('telescope.builtin').resume()<cr>
nnoremap <leader>ft <cmd>lua require('telescope-tabs').list_tabs()<cr>
lua << EOF
local actions = require("telescope.actions")
require('telescope').setup{
defaults = {
layout_strategy = 'vertical',
layout_config = { width = 120.0},
-- Default configuration for telescope goes here:
-- config_key = value,
mappings = {
i = {
["<esc>"] = actions.close,
["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous,
},
}
},
pickers = {
-- Default configuration for builtin pickers goes here:
-- picker_name = {
-- picker_config_key = value,
-- ...
-- }
-- Now the picker_config_key will be applied every time you call this
-- builtin picker
},
extensions = {
-- Your extension configuration goes here:
-- extension_name = {
-- extension_config_key = value,
-- }
-- please take a look at the readme of the extension you want to configure
}
}
EOF
"****************************************
"nvim-treesitter"
"****************************************
lua <<EOF
require("nvim-treesitter.install").prefer_git = true
require'nvim-treesitter.configs'.setup {
-- One of "all", "maintained" (parsers with maintainers), or a list of languages
ensure_installed = {
"cpp", "cpp", "cmake", "cuda",
"lua", "python",
"markdown", "vim", "yaml", "json", "hjson", "proto", "xml",
},
-- Install languages synchronously (only applied to `ensure_installed`)
sync_install = false,
-- List of parsers to ignore installing
-- ignore_install = { "javascript" },
highlight = {
-- `false` will disable the whole extension
enable = true,
-- list of language that will be disabled
-- disable = { "c", "rust" },
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
}
EOF
"****************************************
"mini-files"
"****************************************
lua <<EOF
require("mini.files").setup({
windows= {
preview = true,
},
})
EOF
lua <<EOF
require("mason").setup()
EOF
"****************************************
"normal"
"****************************************
set nu
set hlsearch
set noautoindent
set ruler
syntax enable
syntax on
set shiftwidth=2
set softtabstop=2
set tabstop=2
set cindent
set expandtab
set autochdir
set showcmd
set smartcase
set smartindent
" set pastetoggle=<F12>
let g:indentLine_char = '︙'
set tags=./.tags;,.tags
set runtimepath^=~/.vim/bundle/ag.vim
set complete=.,w,b,u,t
set backspace=indent,eol,start
set history=1000
set t_ut=
set nofoldenable
set encoding=utf-8
set mouse=