-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.vimrc
More file actions
113 lines (101 loc) · 3.5 KB
/
init.vimrc
File metadata and controls
113 lines (101 loc) · 3.5 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
"NOTE one need to create a file under nvim working dir
"To find the working directory is exactly, use the command :echo stdpath('config') inside Neovim.
" for windows it is usually c:\Users\abc\AppData\Local\nvim\
"for linux, a init.vim file should be created in ~/.config/nvim/init.vim
"IMP example
"let g:WorkDir = '~/.config/nvim/'
"exe 'source '.g:WorkDir.'config/init.vimrc'
let g:config_dir = expand('<sfile>:p:h')
let g:config_dir = substitute(g:config_dir, '\\', '/', 'g')
if g:config_dir[-1:] !=# '/'
let g:config_dir = g:config_dir . '/'
endif
" Universal plugins
let g:share_plugin = [
\'dstein64/vim-startuptime',
\'svermeulen/vim-cutlass',
\'MTDL9/vim-log-highlighting',
\'tpope/vim-fugitive',
\'tpope/vim-repeat',
\'unblevable/quick-scope',
\'dhruvasagar/vim-table-mode'
\]
" Vim specific plugins
let g:vim_plugin = [
\ 'mhinz/vim-signify',
\ 'itchyny/lightline.vim',
\ 'itchyny/vim-gitbranch',
\ 'tpope/vim-commentary',
\ 'tpope/vim-speeddating',
\ 'kana/vim-textobj-user',
\ 'Julian/vim-textobj-variable-segment',
\ 'mbbill/undotree',
\ 'machakann/vim-sandwich',
\ 'airblade/vim-rooter',
\ ['bluz71/vim-nightfly-colors',"nightfly"]
\]
if has("nvim")
" loading neovim plugins handled by nvim
exe 'luafile '.g:config_dir.'init.lua'
else
try
let s:path_package = $HOME . '/.local/share/nvim/site/'
"plug.vim originally sit in nvim working dir autoload folder
exe 'source '. s:path_package.'pack/deps/opt/plug.vim'
catch
let s:path_package = $HOME . '/AppData/local/nvim-data/site/'
exe 'source '. s:path_package.'pack/deps/opt/plug.vim'
endtry
call plug#begin(s:path_package.'pack/deps/opt/')
for plugin in g:share_plugin
Plug plugin
endfor
for plugin in g:vim_plugin
if type(plugin) == type([])
Plug plugin[0], {'as': plugin[1]}
else
Plug plugin
endif
endfor
call plug#end()
exe 'source '.g:config_dir.'vim/vim_config.vimrc'
endif
if !exists('g:vscode')
exe 'source '.g:config_dir.'vim/nvim_vim_config.vimrc'
exe 'source '.g:config_dir.'vim/md.vimrc'
endif
exe 'source '.g:config_dir.'vim/univ_config.vimrc'
" colorscheme and highlight
try
colorscheme kanagawa-paper
catch
try
colorscheme nightfly
catch
colorscheme habamax
endtry
endtry
function! s:ApplyCustomHighlights()
" QuickScope
highlight QuickScopePrimary guifg=#afff5f gui=underline ctermfg=155 cterm=underline
highlight QuickScopeSecondary guifg='#5fffff' gui=undercurl ctermfg=81 cterm=undercurl
" colorschme TODO, XXX, IMP, NOTE
highlight MiniHipatternsTodo guibg=#FF9E3B guifg=#282c34
highlight MiniHipatternsFixme guibg=#E82424 guifg=#282c34
highlight MiniHipatternsHack guibg=#957FB8 guifg=#282c34
highlight MiniHipatternsNote guibg=#76946A guifg=#282c34
" Spelling
highlight clear SpellBad
highlight clear SpellRare
highlight clear SpellLocal
highlight SpellBad gui=undercurl guifg=pink
highlight SpellRare guifg=#E5C07B
highlight SpellLocal gui=undercurl guifg=#FFFEE2
" Snacks
highlight SnacksStatusColumnMark guibg=NONE guifg=#D27E99
endfunction
augroup HighlightGroupRefresher
autocmd!
autocmd ColorScheme * call s:ApplyCustomHighlights()
augroup END
call s:ApplyCustomHighlights()