-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.spacevim
168 lines (140 loc) · 5.15 KB
/
.spacevim
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
" Comment the following line if you don't want Vim and NeoVim to share the
" same plugin download directory.
let g:spacevim_plug_home = '~/.vim/plugged'
" Uncomment the following line to override the leader key. The default value is space key "<\Space>".
" let g:spacevim_leader = "<\Space>"
" Uncomment the following line to override the local leader key. The default value is comma ','.
" let g:spacevim_localleader = ','
" Enable the existing layers in space-vim.
" Refer to https://github.com/liuchengxu/space-vim/blob/master/layers/LAYERS.md for all available layers.
let g:spacevim_layers = [
\ 'fzf',
\ 'better-defaults',
\ 'which-key',
\ 'typescript',
\ 'html',
\ 'vue',
\ 'markdown',
\ 'text-align',
\ 'airline',
\ 'git'
\ ]
" Uncomment the following line if your terminal(-emulator) supports true colors.
let g:spacevim_enable_true_color = 1
" Uncomment the following if you have some nerd font installed.
let g:spacevim_nerd_fonts = 1
let g:airline#extensions#tabline#enabled = 1
" Display buffer number in the bufferline
let g:lightline#bufferline#show_number = 1
let g:lightline#bufferline#enable_nerdfont = 1
let g:lightline#bufferline#unicode_symbols = 1
let g:airline#extensions#taglist#enabled = 0
" Ranger setup
let g:ranger_map_keys = 0
nmap <space>fe :Ranger<CR>
" If you want to have more control over the layer, try using Layer command.
" if g:spacevim.gui
" Layer 'airline'
" endif
" Manage your own plugins.
" Refer to https://github.com/junegunn/vim-plug for more detials.
function! UserInit()
" Add your own plugin via Plug command.
Plug 'junegunn/seoul256.vim'
Plug 'NLKNguyen/papercolor-theme'
Plug 'editorconfig/editorconfig-vim'
Plug 'francoiscabrol/ranger.vim'
Plug 'liuchengxu/vim-clap'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-fugitive'
Plug 'vim-airline/vim-airline'
Plug 'mengelbrecht/lightline-bufferline'
Plug 'tikhomirov/vim-glsl'
Plug 'jiangmiao/auto-pairs'
Plug 'yegappan/taglist'
Plug 'evanleck/vim-svelte'
Plug 'neovimhaskell/haskell-vim'
endfunction
" Override the default settings from space-vim as well as adding extras
function! UserConfig()
" Override the default settings.
" Uncomment the following line to disable relative number.
set norelativenumber
set tabstop=2
set softtabstop=2
set shiftwidth=2
set history=1000
colo Papercolor
"colo seoul256
set background=dark
":call Toggle_transparent_background()
" javascript only autocomplete
:set omnifunc=javascriptcomplete#CompleteJS
" Adding extras.
" Uncomment the following line If you have installed the powerline fonts.
" It is good for airline layer.
let g:airline_powerline_fonts = 1
" Customize fzf colors to match your color scheme
" - fzf#wrap translates this to a set of `--color` options
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'] }
let g:clap_popup_input_delay = 0
let g:clap_theme = 'material_design_light'
nmap <Leader>1 <Plug>lightline#bufferline#go(1)
nmap <Leader>2 <Plug>lightline#bufferline#go(2)
nmap <Leader>3 <Plug>lightline#bufferline#go(3)
nmap <Leader>4 <Plug>lightline#bufferline#go(4)
nmap <Leader>5 <Plug>lightline#bufferline#go(5)
nmap <Leader>6 <Plug>lightline#bufferline#go(6)
nmap <Leader>7 <Plug>lightline#bufferline#go(7)
nmap <Leader>8 <Plug>lightline#bufferline#go(8)
nmap <Leader>9 <Plug>lightline#bufferline#go(9)
nmap <Leader>0 <Plug>lightline#bufferline#go(10)
nnoremap <localleader>g :Clap grep2<CR>
nnoremap <localleader>s :Clap git_files<CR>
nnoremap <localleader>f :Clap files<CR>
nnoremap <localleader>e :Clap filer<CR>
nnoremap <localleader>c :Clap commits<CR>
nnoremap <localleader>r :Ag <C-R><C-W><CR>
endfunction
let t:is_transparent = 1
function! Toggle_transparent_background()
if t:is_transparent == 0
hi Normal guibg=#111111 ctermbg=black
let t:is_transparent = 1
else
hi Normal guibg=NONE ctermbg=NONE
let t:is_transparent = 0
endif
endfunction
nnoremap <C-x><C-t> :call Toggle_transparent_background()<CR>
function! DelTagOfFile(file)
let fullpath = a:file
let cwd = getcwd()
let tagfilename = cwd . "/tags"
let f = substitute(fullpath, cwd . "/", "", "")
let f = escape(f, './')
let cmd = 'sed -i "/' . f . '/d" "' . tagfilename . '"'
let resp = system(cmd)
endfunction
function! UpdateTags()
let f = expand("%:p")
let cwd = getcwd()
let tagfilename = cwd . "/tags"
let cmd = 'ctags -a -f ' . tagfilename . ' --c++-kinds=+p --fields=+iaS --extra=+q ' . '"' . f . '"'
call DelTagOfFile(f)
let resp = system(cmd)
endfunction
autocmd BufWritePost *.ts,*.js,*.esm,*.svelte,*.vue,*.html,*.css,*.scss call UpdateTags()