aboutsummaryrefslogtreecommitdiff
path: root/.vim
diff options
context:
space:
mode:
authorgxlin <[email protected]>2021-08-01 23:51:46 +0800
committergxlin <[email protected]>2021-08-01 23:51:46 +0800
commitdd7e28d3a92f901b8a1853cdd70656aa09bb4540 (patch)
tree2b7cb31608aa4d6015c70eda0fd3d4ac15d92ca0 /.vim
parent7d84531e60d5fdddf16b1c4d61332075127ce1c8 (diff)
downloaddotfiles-dd7e28d3a92f901b8a1853cdd70656aa09bb4540.tar.gz
dotfiles-dd7e28d3a92f901b8a1853cdd70656aa09bb4540.tar.bz2
dotfiles-dd7e28d3a92f901b8a1853cdd70656aa09bb4540.zip
Modify vim config
Diffstat (limited to '.vim')
-rw-r--r--.vim/plugin/airline.plug4
-rw-r--r--.vim/plugin/asyncrun.plug5
-rw-r--r--.vim/plugin/easymotion.plug3
-rw-r--r--.vim/plugin/fugitive.plug7
-rw-r--r--.vim/plugin/general.plug15
-rw-r--r--.vim/plugin/gutentags.plug8
-rw-r--r--.vim/plugin/init.vim176
-rw-r--r--.vim/plugin/lang.plug4
-rw-r--r--.vim/plugin/ledger.plug14
-rw-r--r--.vim/plugin/markdown.plug4
-rw-r--r--.vim/plugin/misc.plug14
-rw-r--r--.vim/plugin/slime.plug15
-rw-r--r--.vim/plugin/tex.plug1
-rw-r--r--.vim/plugin/vimspector.plug68
-rw-r--r--.vim/plugin/vimwiki.plug12
-rw-r--r--.vim/plugin/vista.plug9
16 files changed, 168 insertions, 191 deletions
diff --git a/.vim/plugin/airline.plug b/.vim/plugin/airline.plug
deleted file mode 100644
index a1c1b94..0000000
--- a/.vim/plugin/airline.plug
+++ /dev/null
@@ -1,4 +0,0 @@
-Plug 'vim-airline/vim-airline'
-Plug 'vim-airline/vim-airline-themes'
-
-let g:airline#extensions#tabline#enabled = 1
diff --git a/.vim/plugin/asyncrun.plug b/.vim/plugin/asyncrun.plug
deleted file mode 100644
index bed9473..0000000
--- a/.vim/plugin/asyncrun.plug
+++ /dev/null
@@ -1,5 +0,0 @@
-let g:asyncrun_open = 6 " the number of lines of quickfix window
-let g:asyncrun_bell = 1 " the bell rings when the task is done
-" use f10 to open/close asyncrun quickfix window
-nnoremap <F10> :call asyncrun#quickfix_toggle(6)<cr>
-
diff --git a/.vim/plugin/easymotion.plug b/.vim/plugin/easymotion.plug
deleted file mode 100644
index ce87f12..0000000
--- a/.vim/plugin/easymotion.plug
+++ /dev/null
@@ -1,3 +0,0 @@
-Plug 'easymotion/vim-easymotion'
-
-map <Space> <Plug>(easymotion-prefix)
diff --git a/.vim/plugin/fugitive.plug b/.vim/plugin/fugitive.plug
deleted file mode 100644
index 8dd25b2..0000000
--- a/.vim/plugin/fugitive.plug
+++ /dev/null
@@ -1,7 +0,0 @@
-" vim: ft=vim
-
-Plug 'tpope/vim-fugitive'
-
-nnoremap <silent> <leader>gl :Gclog! -- %<CR>
-nnoremap <silent> <leader>gd :Gdiffsplit <CR>
-nnoremap <silent> <leader>gs :G<CR>
diff --git a/.vim/plugin/general.plug b/.vim/plugin/general.plug
deleted file mode 100644
index 5f690d8..0000000
--- a/.vim/plugin/general.plug
+++ /dev/null
@@ -1,15 +0,0 @@
-" vim: ft=vim
-
-Plug 'Valloric/YouCompleteMe', {
- \ 'do': 'python3 ./install.py --clangd-completer',
- \ }
-Plug 'prabirshrestha/vim-lsp'
-Plug 'mattn/vim-lsp-settings'
-
-Plug 'dense-analysis/ale'
-Plug 'sheerun/vim-polyglot'
-Plug 'Yggdroot/LeaderF', {'do': ':LeaderfInstallCExtension'}
-Plug 'tpope/vim-eunuch'
-
-let g:ycm_language_server = []
-let g:Lf_RootMarkers = []
diff --git a/.vim/plugin/gutentags.plug b/.vim/plugin/gutentags.plug
deleted file mode 100644
index c2a7090..0000000
--- a/.vim/plugin/gutentags.plug
+++ /dev/null
@@ -1,8 +0,0 @@
-Plug 'ludovicchabant/vim-gutentags'
-
-let g:gutentags_project_root = ['.root', '.svn', '.git', '.hg', '.project']
-let g:gutentags_ctags_tagfile = '.tags'
-let g:gutentags_ctags_extra_args = ['--fields=+niazS', '--extra=+q']
-let g:gutentags_ctags_extra_args = ['--c++-kinds=+px']
-let g:gutentags_ctags_extra_args = ['--c-kinds=+px']
-
diff --git a/.vim/plugin/init.vim b/.vim/plugin/init.vim
index 7f71d9c..1d02fcd 100644
--- a/.vim/plugin/init.vim
+++ b/.vim/plugin/init.vim
@@ -4,15 +4,8 @@ if empty(glob('~/.vim/autoload/plug.vim'))
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
-let s:plugins = split(expand('~/.vim/plugin/*.plug'))
let s:settings = split(expand('~/.vim/plugin/*.vim'))
-function! s:load_plugins()
- for plugin in s:plugins
- exec "source " . plugin
- endfor
-endfunction
-
function! s:load_settings()
for setting in s:settings
if setting !~ 'init.vim'
@@ -22,7 +15,174 @@ function! s:load_settings()
endfunction
call plug#begin('~/.vim/plugged')
-call s:load_plugins()
+
+" General
+Plug 'Valloric/YouCompleteMe', {
+ \ 'do': 'python3 ./install.py --clangd-completer',
+ \ }
+Plug 'prabirshrestha/vim-lsp'
+Plug 'mattn/vim-lsp-settings'
+
+Plug 'dense-analysis/ale'
+Plug 'sheerun/vim-polyglot'
+Plug 'Yggdroot/LeaderF', {'do': ':LeaderfInstallCExtension'}
+Plug 'tpope/vim-eunuch'
+Plug 'godlygeek/tabular'
+Plug 'ludovicchabant/vim-gutentags'
+
+let g:gutentags_project_root = ['.root', '.svn', '.git', '.hg', '.project']
+let g:gutentags_ctags_tagfile = '.tags'
+let g:gutentags_ctags_extra_args = ['--fields=+niazS', '--extra=+q']
+let g:gutentags_ctags_extra_args = ['--c++-kinds=+px']
+let g:gutentags_ctags_extra_args = ['--c-kinds=+px']
+
+
+let g:ycm_language_server = []
+let g:Lf_RootMarkers = []
+Plug 'vim-airline/vim-airline'
+Plug 'vim-airline/vim-airline-themes'
+
+let g:airline#extensions#tabline#enabled = 1
+Plug 'tpope/vim-fugitive'
+
+nnoremap <silent> <leader>gl :Gclog! -- %<CR>
+nnoremap <silent> <leader>gd :Gdiffsplit <CR>
+nnoremap <silent> <leader>gs :G<CR>
+Plug 'easymotion/vim-easymotion'
+
+map <Space> <Plug>(easymotion-prefix)
+
+" Language specific
+Plug 'habamax/vim-godot', {'for': 'gdscript'}
+Plug 'plasticboy/vim-markdown'
+Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'}
+Plug 'ledger/vim-ledger', {'for': 'ledger'}
+
+let g:ledger_bin = 'ledger'
+let g:ledger_align_at = 50
+let g:ledger_commodity_before = 0
+
+au FileType ledger call s:ledger_keymap()
+
+function! s:ledger_keymap() abort
+ noremap { ?^\d<CR>
+ noremap } /^\d<CR>
+ inoremap <silent> <Tab> <C-r>=ledger#autocomplete_and_align()<CR>
+ vnoremap <silent> <Tab> :LedgerAlign<CR>
+endfunction
+Plug 'iamcco/markdown-preview.nvim', {
+ \ 'do': {-> mkdp#util#install()},
+ \ 'for': ['markdown', 'vim-plug']
+ \ }
+
+" REPL
+Plug 'jpalardy/vim-slime', {
+ \'on': [
+ \'<Plug>SlimeRegionSend',
+ \'<Plug>SlimeParagraphSend',
+ \'<Plug>SlimeConfig'
+ \]
+ \}
+
+let g:slime_no_mappings = 1
+
+xmap <c-c><c-c> <Plug>SlimeRegionSend
+nmap <c-c><c-c> <Plug>SlimeParagraphSend
+nmap <c-c>v <Plug>SlimeConfig
+
+let g:slime_target = 'tmux'
+
+" Misc
+Plug 'skywind3000/asyncrun.vim'
+
+let g:asyncrun_open = 6 " the number of lines of quickfix window
+let g:asyncrun_bell = 1 " the bell rings when the task is done
+" use f10 to open/close asyncrun quickfix window
+nnoremap <F10> :call asyncrun#quickfix_toggle(6)<cr>
+
+
+Plug 'mhinz/vim-signify'
+Plug 'tpope/vim-unimpaired'
+
+Plug 'joshdick/onedark.vim'
+Plug 'liuchengxu/vista.vim'
+
+let g:vista_default_executive = 'ctags'
+
+let g:vista_executive_for = {
+ \ 'go': 'vim_lsp',
+ \ }
+
+nnoremap <leader>s :Vista<CR>
+
+Plug 'puremourning/vimspector', { 'on': '<Plug>VimspectorContinue' }
+
+let g:vimspector_install_gadgets = ['debugpy']
+
+nmap <silent> <Leader>dc <Plug>VimspectorContinue
+nmap <silent> <Leader>dq <Plug>VimspectorStop
+nmap <silent> <Leader>db <Plug>VimspectorToggleBreakpoint
+nmap <silent> <Leader>dn <Plug>VimspectorStepOver
+nmap <silent> <Leader>ds <Plug>VimspectorStepInto
+nmap <silent> <Leader>df <Plug>VimspectorStepOut
+nmap <silent> <Leader>di <Plug>VimspectorBalloonEval
+xmap <silent> <Leader>di <Plug>VimspectorBalloonEval
+
+let s:mapped = {}
+
+function! s:set_debug_keymaps() abort
+ if has_key(s:mapped, string(bufnr()))
+ return
+ endif
+
+ " nmap <silent> <buffer> c <Plug>VimspectorContinue
+ " nmap <silent> <buffer> q <Plug>VimspectorStop
+ " nmap <silent> <buffer> b <Plug>VimspectorToggleBreakpoint
+ nmap <silent> <buffer> m <Plug>VimspectorStepOver
+ " nmap <silent> <buffer> s <Plug>VimspectorStepInto
+ " nmap <silent> <buffer> f <Plug>VimspectorStepOut
+ " nmap <silent> <buffer> i <Plug>VimspectorBalloonEval
+ " xmap <silent> <buffer> i <Plug>VimspectorBalloonEval
+
+ let s:mapped[string(bufnr())] = {'modifiable': &modifiable}
+
+ setlocal nomodifiable
+endfunction
+
+function! s:unset_debug_keymaps() abort
+ let original_buf = bufnr()
+ let hidden = &hidden
+
+ try
+ set hidden
+ for bufnr in keys(s:mapped)
+ try
+ execute 'noautocmd buffer' bufnr
+ " silent! nunmap <buffer> c
+ " silent! nunmap <buffer> q
+ " silent! nunmap <buffer> b
+ silent! nunmap <buffer> m
+ " silent! nunmap <buffer> s
+ " silent! nunmap <buffer> f
+ " silent! nunmap <buffer> i
+ " silent! xunmap <buffer> i
+
+ let &l:modifiable = s:mapped[bufnr]['modifiable']
+ endtry
+ endfor
+ finally
+ execute 'noautocmd buffer' original_buf
+ let &hidden = hidden
+ endtry
+
+ let s:mapped = {}
+endfunction
+
+augroup CustomMappings
+ au!
+ autocmd User VimspectorJumpedToFrame call s:set_debug_keymaps()
+ autocmd User VimspectorDebugEnded call s:unset_debug_keymaps()
+augroup end
call plug#end()
call s:load_settings()
diff --git a/.vim/plugin/lang.plug b/.vim/plugin/lang.plug
deleted file mode 100644
index 6c40e71..0000000
--- a/.vim/plugin/lang.plug
+++ /dev/null
@@ -1,4 +0,0 @@
-" vim: ft=vim
-
-Plug 'habamax/vim-godot', {'for': 'gdscript'}
-
diff --git a/.vim/plugin/ledger.plug b/.vim/plugin/ledger.plug
deleted file mode 100644
index b3a1e25..0000000
--- a/.vim/plugin/ledger.plug
+++ /dev/null
@@ -1,14 +0,0 @@
-Plug 'ledger/vim-ledger', {'for': 'ledger'}
-
-let g:ledger_bin = 'ledger'
-let g:ledger_align_at = 50
-let g:ledger_commodity_before = 0
-
-au FileType ledger call s:ledger_keymap()
-
-function! s:ledger_keymap() abort
- noremap { ?^\d<CR>
- noremap } /^\d<CR>
- inoremap <silent> <Tab> <C-r>=ledger#autocomplete_and_align()<CR>
- vnoremap <silent> <Tab> :LedgerAlign<CR>
-endfunction
diff --git a/.vim/plugin/markdown.plug b/.vim/plugin/markdown.plug
deleted file mode 100644
index 1e12dad..0000000
--- a/.vim/plugin/markdown.plug
+++ /dev/null
@@ -1,4 +0,0 @@
-Plug 'iamcco/markdown-preview.nvim', {
- \ 'do': {-> mkdp#util#install()},
- \ 'for': ['markdown', 'vim-plug']
- \ }
diff --git a/.vim/plugin/misc.plug b/.vim/plugin/misc.plug
deleted file mode 100644
index a634210..0000000
--- a/.vim/plugin/misc.plug
+++ /dev/null
@@ -1,14 +0,0 @@
-Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'}
-
-Plug 'skywind3000/asyncrun.vim'
-
-let g:asyncrun_open = 6 " the number of lines of quickfix window
-let g:asyncrun_bell = 1 " the bell rings when the task is done
-" use f10 to open/close asyncrun quickfix window
-nnoremap <F10> :call asyncrun#quickfix_toggle(6)<cr>
-
-Plug 'mhinz/vim-signify'
-Plug 'tpope/vim-unimpaired'
-Plug 'godlygeek/tabular'
-
-Plug 'joshdick/onedark.vim'
diff --git a/.vim/plugin/slime.plug b/.vim/plugin/slime.plug
deleted file mode 100644
index 0989a66..0000000
--- a/.vim/plugin/slime.plug
+++ /dev/null
@@ -1,15 +0,0 @@
-Plug 'jpalardy/vim-slime', {
- \'on': [
- \'<Plug>SlimeRegionSend',
- \'<Plug>SlimeParagraphSend',
- \'<Plug>SlimeConfig'
- \]
- \}
-
-let g:slime_no_mappings = 1
-
-xmap <c-c><c-c> <Plug>SlimeRegionSend
-nmap <c-c><c-c> <Plug>SlimeParagraphSend
-nmap <c-c>v <Plug>SlimeConfig
-
-let g:slime_target = 'tmux'
diff --git a/.vim/plugin/tex.plug b/.vim/plugin/tex.plug
deleted file mode 100644
index 6c3f788..0000000
--- a/.vim/plugin/tex.plug
+++ /dev/null
@@ -1 +0,0 @@
-" Plug 'lervag/vimtex'
diff --git a/.vim/plugin/vimspector.plug b/.vim/plugin/vimspector.plug
deleted file mode 100644
index a39d4bd..0000000
--- a/.vim/plugin/vimspector.plug
+++ /dev/null
@@ -1,68 +0,0 @@
-Plug 'puremourning/vimspector', { 'on': '<Plug>VimspectorContinue' }
-
-let g:vimspector_install_gadgets = ['debugpy']
-
-nmap <silent> <Leader>dc <Plug>VimspectorContinue
-nmap <silent> <Leader>dq <Plug>VimspectorStop
-nmap <silent> <Leader>db <Plug>VimspectorToggleBreakpoint
-nmap <silent> <Leader>dn <Plug>VimspectorStepOver
-nmap <silent> <Leader>ds <Plug>VimspectorStepInto
-nmap <silent> <Leader>df <Plug>VimspectorStepOut
-nmap <silent> <Leader>di <Plug>VimspectorBalloonEval
-xmap <silent> <Leader>di <Plug>VimspectorBalloonEval
-
-let s:mapped = {}
-
-function! s:set_debug_keymaps() abort
- if has_key(s:mapped, string(bufnr()))
- return
- endif
-
- " nmap <silent> <buffer> c <Plug>VimspectorContinue
- " nmap <silent> <buffer> q <Plug>VimspectorStop
- " nmap <silent> <buffer> b <Plug>VimspectorToggleBreakpoint
- nmap <silent> <buffer> m <Plug>VimspectorStepOver
- " nmap <silent> <buffer> s <Plug>VimspectorStepInto
- " nmap <silent> <buffer> f <Plug>VimspectorStepOut
- " nmap <silent> <buffer> i <Plug>VimspectorBalloonEval
- " xmap <silent> <buffer> i <Plug>VimspectorBalloonEval
-
- let s:mapped[string(bufnr())] = {'modifiable': &modifiable}
-
- setlocal nomodifiable
-endfunction
-
-function! s:unset_debug_keymaps() abort
- let original_buf = bufnr()
- let hidden = &hidden
-
- try
- set hidden
- for bufnr in keys(s:mapped)
- try
- execute 'noautocmd buffer' bufnr
- " silent! nunmap <buffer> c
- " silent! nunmap <buffer> q
- " silent! nunmap <buffer> b
- silent! nunmap <buffer> m
- " silent! nunmap <buffer> s
- " silent! nunmap <buffer> f
- " silent! nunmap <buffer> i
- " silent! xunmap <buffer> i
-
- let &l:modifiable = s:mapped[bufnr]['modifiable']
- endtry
- endfor
- finally
- execute 'noautocmd buffer' original_buf
- let &hidden = hidden
- endtry
-
- let s:mapped = {}
-endfunction
-
-augroup CustomMappings
- au!
- autocmd User VimspectorJumpedToFrame call s:set_debug_keymaps()
- autocmd User VimspectorDebugEnded call s:unset_debug_keymaps()
-augroup end
diff --git a/.vim/plugin/vimwiki.plug b/.vim/plugin/vimwiki.plug
deleted file mode 100644
index 76de8f5..0000000
--- a/.vim/plugin/vimwiki.plug
+++ /dev/null
@@ -1,12 +0,0 @@
-" vim: ft=vim
-
-Plug 'vimwiki/vimwiki'
-
-let g:vimwiki_list = [{'path': '~/Documents/notes',
- \ 'syntax': 'markdown', 'ext': '.md'}]
-
-au FileType vimwiki setlocal textwidth=72
-
-let g:vimwiki_CJK_length = 1
-let g:vimwiki_url_maxsave = 0
-let g:vimwiki_global_ext = 0
diff --git a/.vim/plugin/vista.plug b/.vim/plugin/vista.plug
deleted file mode 100644
index 02264b9..0000000
--- a/.vim/plugin/vista.plug
+++ /dev/null
@@ -1,9 +0,0 @@
-Plug 'liuchengxu/vista.vim'
-
-let g:vista_default_executive = 'ctags'
-
-let g:vista_executive_for = {
- \ 'go': 'vim_lsp',
- \ }
-
-nnoremap <leader>s :Vista<CR>