aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.vim/init.vim1
-rw-r--r--.vim/plugins/ack.vim7
-rw-r--r--.vim/plugins/airline.vim4
-rw-r--r--.vim/plugins/ale.vim24
-rw-r--r--.vim/plugins/gutentags.vim8
-rw-r--r--.vim/plugins/init.vim19
-rw-r--r--.vim/plugins/leaderf.vim22
-rw-r--r--.vim/plugins/misc.vim19
-rw-r--r--.vim/plugins/vimwiki.vim4
-rw-r--r--.vim/plugins/youcompleteme.vim12
-rw-r--r--.vimrc108
11 files changed, 122 insertions, 106 deletions
diff --git a/.vim/init.vim b/.vim/init.vim
new file mode 100644
index 0000000..2a5d6df
--- /dev/null
+++ b/.vim/init.vim
@@ -0,0 +1 @@
+source ~/.dotfiles/.vim/plugins/init.vim
diff --git a/.vim/plugins/ack.vim b/.vim/plugins/ack.vim
new file mode 100644
index 0000000..dd96e47
--- /dev/null
+++ b/.vim/plugins/ack.vim
@@ -0,0 +1,7 @@
+Plug 'mileszs/ack.vim'
+
+if executable('ag')
+ let g:ackprg = 'ag --vimgrep'
+endif
+cnoreabbrev Ack Ack!
+nnoremap <Leader>a :Ack!<Space>
diff --git a/.vim/plugins/airline.vim b/.vim/plugins/airline.vim
new file mode 100644
index 0000000..a1c1b94
--- /dev/null
+++ b/.vim/plugins/airline.vim
@@ -0,0 +1,4 @@
+Plug 'vim-airline/vim-airline'
+Plug 'vim-airline/vim-airline-themes'
+
+let g:airline#extensions#tabline#enabled = 1
diff --git a/.vim/plugins/ale.vim b/.vim/plugins/ale.vim
new file mode 100644
index 0000000..f092c62
--- /dev/null
+++ b/.vim/plugins/ale.vim
@@ -0,0 +1,24 @@
+Plug 'dense-analysis/ale'
+
+let g:ale_linters_explicit = 1
+let g:ale_completion_delay = 500
+let g:ale_echo_delay = 20
+let g:ale_lint_delay = 500
+let g:ale_echo_msg_format = '[%linter%] %code: %%s'
+let g:ale_lint_on_text_changed = 'normal'
+let g:ale_lint_on_insert_leave = 1
+let g:airline#extensions#ale#enabled = 1
+
+let g:ale_c_gcc_options = '-Wall -O2 -std=c99'
+let g:ale_cpp_gcc_options = '-Wall -O2 -std=c++14'
+let g:ale_c_cppcheck_options = ''
+let g:ale_cpp_cppcheck_options = ''
+
+let g:ale_sign_error = "\ue009\ue009"
+hi! clear SpellBad
+hi! clear SpellCap
+hi! clear SpellRare
+hi! SpellBad gui=undercurl guisp=red
+hi! SpellCap gui=undercurl guisp=blue
+hi! SpellRare gui=undercurl guisp=magenta
+
diff --git a/.vim/plugins/gutentags.vim b/.vim/plugins/gutentags.vim
new file mode 100644
index 0000000..c2a7090
--- /dev/null
+++ b/.vim/plugins/gutentags.vim
@@ -0,0 +1,8 @@
+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/plugins/init.vim b/.vim/plugins/init.vim
new file mode 100644
index 0000000..590f18c
--- /dev/null
+++ b/.vim/plugins/init.vim
@@ -0,0 +1,19 @@
+if empty(glob('~/.vim/autoload/plug.vim'))
+ silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
+ \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
+ autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
+endif
+
+let s:plugins = split(expand('~/.dotfiles/.vim/plugins/*.vim'))
+
+function! s:load_plugins()
+ for plugin in s:plugins
+ if plugin !~ 'init.vim'
+ exec "source " . plugin
+ endif
+ endfor
+endfunction
+
+call plug#begin('~/.vim/plugged')
+call s:load_plugins()
+call plug#end()
diff --git a/.vim/plugins/leaderf.vim b/.vim/plugins/leaderf.vim
new file mode 100644
index 0000000..4d6d0ac
--- /dev/null
+++ b/.vim/plugins/leaderf.vim
@@ -0,0 +1,22 @@
+Plug 'Yggdroot/LeaderF', {'do': './install.sh'}
+
+" " Show icons, icons are shown by default
+let g:Lf_ShowDevIcons = 1
+
+" For GUI vim, the icon font can be specify like this, for example
+let g:Lf_DevIconsFont = "DejaVuSansMono Nerd Font Mono"
+let g:Lf_WindowPosition = 'popup'
+let g:Lf_ShortcutF = "<leader>ff"
+
+noremap <leader>fb :<C-U><C-R>=printf("Leaderf buffer %s", "")<CR><CR>
+noremap <leader>fm :<C-U><C-R>=printf("Leaderf mru %s", "")<CR><CR>
+noremap <leader>ft :<C-U><C-R>=printf("Leaderf bufTag %s", "")<CR><CR>
+noremap <leader>fl :<C-U><C-R>=printf("Leaderf line %s", "")<CR><CR>
+noremap <C-B> :<C-U><C-R>=printf("Leaderf! rg --current-buffer -e %s ", expand("<cword>"))<CR>
+noremap <C-F> :<C-U><C-R>=printf("Leaderf! rg -e %s ", expand("<cword>"))<CR>
+
+" search visually selected text literally
+xnoremap gf :<C-U><C-R>=printf("Leaderf! rg -F -e %s ", leaderf#Rg#visual())<CR>
+noremap go :<C-U>Leaderf! rg --recall<CR>
+let g:Lf_RootMarkers = ['.project', '.root', '.svn', '.git']
+let g:Lf_WorkingDirectoryMode = 'AF'
diff --git a/.vim/plugins/misc.vim b/.vim/plugins/misc.vim
new file mode 100644
index 0000000..a07c23c
--- /dev/null
+++ b/.vim/plugins/misc.vim
@@ -0,0 +1,19 @@
+Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'}
+
+map <C-n> :NERDTreeToggle<CR>
+
+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 'puremourning/vimspector'
+
+let g:vimspector_enable_mappings = 'HUMAN'
+
+Plug 'mhinz/vim-signify'
+Plug 'tpope/vim-unimpaired'
+Plug 'godlygeek/tabular'
+Plug 'ledger/vim-ledger', {'for': 'ledger'}
diff --git a/.vim/plugins/vimwiki.vim b/.vim/plugins/vimwiki.vim
new file mode 100644
index 0000000..226e135
--- /dev/null
+++ b/.vim/plugins/vimwiki.vim
@@ -0,0 +1,4 @@
+Plug 'vimwiki/vimwiki'
+
+let g:vimwiki_list = [{'path': '~/Documents/notes',
+ \ 'syntax': 'markdown', 'ext': '.md'}]
diff --git a/.vim/plugins/youcompleteme.vim b/.vim/plugins/youcompleteme.vim
new file mode 100644
index 0000000..449e8ff
--- /dev/null
+++ b/.vim/plugins/youcompleteme.vim
@@ -0,0 +1,12 @@
+Plug 'Valloric/YouCompleteMe', {'do': 'python3 ./install.py --clangd-completer'}
+
+let g:ycm_server_log_level = 'info'
+let g:ycm_add_preview_to_completeopt = 0
+let g:ycm_show_diagnostics_ui = 0
+let g:ycm_collect_identifiers_from_comments_and_strings = 1
+let g:ycm_complete_in_strings = 1
+
+let g:ycm_filetype_whilelist = {
+ \ "c": 1, "cpp": 1, "sh": 1, "zsh": 1,
+ \ "python": 1,
+ \ }
diff --git a/.vimrc b/.vimrc
index 21f9983..092ea6b 100644
--- a/.vimrc
+++ b/.vimrc
@@ -77,111 +77,7 @@ nnoremap <leader>n :bn<CR>
nnoremap <leader>p :bp<CR>
nnoremap <leader>d :bd<CR>
-" Plugin
-if empty(glob('~/.vim/autoload/plug.vim'))
- silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
- \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
- autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
+if filereadable(expand('~/.dotfiles/.vim/init.vim'))
+ exec "source " . '~/.dotfiles/.vim/init.vim'
endif
-call plug#begin('~/.vim/plugged')
-Plug 'Valloric/YouCompleteMe', {'do': 'python3 ./install.py --clangd-completer'}
-Plug 'vim-airline/vim-airline'
-Plug 'vim-airline/vim-airline-themes'
-Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'}
-Plug 'ludovicchabant/vim-gutentags'
-Plug 'skywind3000/asyncrun.vim'
-Plug 'Yggdroot/LeaderF', {'do': './install.sh'}
-Plug 'dense-analysis/ale'
-Plug 'mhinz/vim-signify'
-Plug 'tpope/vim-unimpaired'
-Plug 'godlygeek/tabular'
-Plug 'ledger/vim-ledger', {'for': 'ledger'}
-Plug 'puremourning/vimspector'
-Plug 'mileszs/ack.vim'
-call plug#end()
-
-" Plugin config
-
-let g:airline#extensions#tabline#enabled = 1
-map <C-n> :NERDTreeToggle<CR>
-
-" YouCompleteMe
-let g:ycm_server_log_level = 'info'
-let g:ycm_add_preview_to_completeopt = 0
-let g:ycm_show_diagnostics_ui = 0
-let g:ycm_collect_identifiers_from_comments_and_strings = 1
-let g:ycm_complete_in_strings = 1
-
-let g:ycm_filetype_whilelist = {
- \ "c": 1, "cpp": 1, "sh": 1, "zsh": 1,
- \ "python": 1,
- \ }
-
-" 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']
-
-" 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>
-
-" vim-easy-align
-xmap ga <Plug>(EasyAlign)
-nmap ga <Plug>(EasyAlign)
-
-" LeaderF
-" " Show icons, icons are shown by default
-let g:Lf_ShowDevIcons = 1
-" For GUI vim, the icon font can be specify like this, for example
-let g:Lf_DevIconsFont = "DejaVuSansMono Nerd Font Mono"
-let g:Lf_WindowPosition = 'popup'
-let g:Lf_ShortcutF = "<leader>ff"
-noremap <leader>fb :<C-U><C-R>=printf("Leaderf buffer %s", "")<CR><CR>
-noremap <leader>fm :<C-U><C-R>=printf("Leaderf mru %s", "")<CR><CR>
-noremap <leader>ft :<C-U><C-R>=printf("Leaderf bufTag %s", "")<CR><CR>
-noremap <leader>fl :<C-U><C-R>=printf("Leaderf line %s", "")<CR><CR>
-noremap <C-B> :<C-U><C-R>=printf("Leaderf! rg --current-buffer -e %s ", expand("<cword>"))<CR>
-noremap <C-F> :<C-U><C-R>=printf("Leaderf! rg -e %s ", expand("<cword>"))<CR>
-" search visually selected text literally
-xnoremap gf :<C-U><C-R>=printf("Leaderf! rg -F -e %s ", leaderf#Rg#visual())<CR>
-noremap go :<C-U>Leaderf! rg --recall<CR>
-let g:Lf_RootMarkers = ['.project', '.root', '.svn', '.git']
-
-" ALE
-let g:ale_linters_explicit = 1
-let g:ale_completion_delay = 500
-let g:ale_echo_delay = 20
-let g:ale_lint_delay = 500
-let g:ale_echo_msg_format = '[%linter%] %code: %%s'
-let g:ale_lint_on_text_changed = 'normal'
-let g:ale_lint_on_insert_leave = 1
-let g:airline#extensions#ale#enabled = 1
-
-let g:ale_c_gcc_options = '-Wall -O2 -std=c99'
-let g:ale_cpp_gcc_options = '-Wall -O2 -std=c++14'
-let g:ale_c_cppcheck_options = ''
-let g:ale_cpp_cppcheck_options = ''
-
-let g:ale_sign_error = "\ue009\ue009"
-hi! clear SpellBad
-hi! clear SpellCap
-hi! clear SpellRare
-hi! SpellBad gui=undercurl guisp=red
-hi! SpellCap gui=undercurl guisp=blue
-hi! SpellRare gui=undercurl guisp=magenta
-
-" Vimspector
-let g:vimspector_enable_mappings = 'HUMAN'
-
-" Ack.vim
-if executable('ag')
- let g:ackprg = 'ag --vimgrep'
-endif
-cnoreabbrev Ack Ack!
-nnoremap <Leader>a :Ack!<Space>