forked from liuchengxu/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspacevim
158 lines (132 loc) · 4.89 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
scriptencoding utf-8
" Let Vim and NeoVim shares the same plugin directory.
" Comment it out if you don't like.
let g:spacevim_plug_home = '~/.vim/plugged'
" The default leader key is space key.
" let g:spacevim_leader = "\<Space>"
" The default local leader key is comma.
" let g:spacevim_localleader = ','
let g:spacevim_layers = [
\ 'fzf', 'unite', 'better-defaults',
\ 'syntax-checking',
\ 'auto-completion',
\ 'better-motion', 'file-manager', 'programming', 'editing', 'text-align', 'formatting',
\ 'go', 'rust', 'graphviz', 'javascript', 'solidity', 'python', 'c-c++', 'markdown',
\ 'git', 'github', 'chinese', 'latex', 'which-key',
\ 'auto-completion',
\ ]
let s:lsp_enable = 0
let s:use_ncm = 1
" if s:lsp_enable
" call add(g:spacevim_layers, 'lsp')
" call filter(g:spacevim_layers, 'v:val !~ "auto-completion"')
" elseif g:spacevim_nvim
" call add(g:spacevim_layers, 'auto-completion')
" call filter(g:spacevim_layers, 'v:val !~ "lsp"')
" call filter(g:spacevim_layers, 'v:val !~ "ycmd"')
" else
" call add(g:spacevim_layers, 'ycmd')
" call filter(g:spacevim_layers, 'v:val !~ "auto-completion"')
" call filter(g:spacevim_layers, 'v:val !~ "lsp"')
" nnoremap gd :YcmCompleter GoTo<CR>
" endif
" Add your own plugins
function! UserInit()
" Install personal plugins
" Plug 'sjl/gundo.vim'
Plug 'joshdick/onedark.vim'
Plug 'morhetz/gruvbox'
Plug 'ayu-theme/ayu-vim'
Plug 'skywind3000/quickmenu.vim'
Plug 'blueyed/vim-diminactive'
" Plug 'mhinz/vim-grepper'
Plug 'MattesGroeger/vim-bookmarks'
Plug 'lambdalisue/gina.vim'
Plug 'junegunn/vader.vim'
Plug 'romainl/vim-qf'
endfunction
" Override the default settings as well as adding extras
function! UserConfig()
let g:cm_matcher = {'module': 'cm_matchers.abbrev_matcher'}
let g:anzu_enable_CursorMoved_AnzuUpdateSearchStatus=1
" If you have installed the powerline fonts and want to enable airline layer
let g:airline_powerline_fonts=1
" Use gui colors in terminal if available
if has('termguicolors') && $TERM_PROGRAM =~# 'iTerm'
set termguicolors
if g:spacevim_tmux
" If use vim inside tmux, see https://github.com/vim/vim/issues/993
" set Vim-specific sequences for RGB colors
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
endif
if has('nvim')
hi Comment gui=None cterm=None
endif
endif
" if $TERM_PROGRAM =~ 'Terminal'
if !g:spacevim_gui
hi Normal ctermbg=NONE guibg=NONE
hi LineNr ctermbg=NONE guibg=NONE
hi SignColumn guibg=NONE ctermbg=NONE
endif
" endif
let g:tagbar_type_go = g:spacevim#lang#go#tagbar_type
let g:tagbar_type_rust = g:spacevim#lang#rust#tagbar_type
nnoremap <F10> :call spacevim#util#SyntaxHiGroup()<CR>
set wrap undofile
set lazyredraw
set guifont=Source\ Code\ Pro\ Light:h13
if !has('nvim')
set antialias " MacVim: smooth fonts
endif
command! Path :echo expand('%:p')
" set nocursorline
set synmaxcol=300
let g:ale_linters.go = ['golint']
nnoremap <Leader>mk :Marks<CR>
autocmd BufRead *bashrc* set ft=sh
command! -bang -nargs=* Rg
\ call fzf#vim#grep(
\ 'rg --column --line-number --no-heading --color=always '.shellescape(<q-args>), 1,
\ <bang>0 ? fzf#vim#with_preview('up:60%')
\ : fzf#vim#with_preview('right:50%:hidden', '?'),
\ <bang>0
\ )
nnoremap <Leader>rg :Rg<CR>
command! -nargs=* Terminal :terminal ++close bash
command! Lcd lcd %:p:h
nnoremap <F8> :call spacevim#menu#init()<CR>
" If buffer modified, update any 'Last modified: ' in the first 20 lines.
" 'Last modified: ' can have up to 10 characters before (they are retained).
" Restores cursor and window position using save_cursor variable.
function! LastModified()
if &modified
let save_cursor = getpos(".")
let n = min([20, line("$")])
keepjumps exe '1,' . n . 's#^\(.\{,10}Last modified: \).*#\1' .
\ strftime('%d/%m/%y %H:%M:%S') . '#e'
call histdel('search', -1)
call setpos('.', save_cursor)
endif
endfunction
autocmd BufWritePre exchanges.md call LastModified()
set list
set listchars=tab:│\ ,trail:•,extends:❯,precedes:❮
set listchars=tab:¦\ ,trail:•,extends:❯,precedes:❮
set fillchars+=vert:│
" if has('conceal')
" set conceallevel=1
" set listchars+=conceal:Δ
" endif
nnoremap <LocalLeader>o :call spacevim#plug#fzf#Open()<CR>
nnoremap <LocalLeader>v :call spacevim#plug#fzf#Open()<CR>
nnoremap <LocalLeader>p :call spacevim#plug#fzf#Rtp()<CR>
nnoremap <LocalLeader>fc :call spacevim#plug#fzf#FZFCmd()<CR>
nnoremap <LocalLeader>ff :call spacevim#plug#fzf#Func()<CR>
nnoremap <LocalLeader>sw :call spacevim#plug#fzf#SearchCword()<CR>
let g:ale_sign_error = "◉"
let g:ale_sign_warning = "◉"
highlight ALEErrorSign ctermfg=9 guifg=#C30500
highlight ALEWarningSign ctermfg=11 guifg=#ED6237
endfunction