aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuangxiong Lin <[email protected]>2021-12-12 14:29:06 +0800
committerGuangxiong Lin <[email protected]>2021-12-12 14:30:26 +0800
commit768bcbd402cbd8b705d5b21423724af43b9ee543 (patch)
treebb5ecd873101403c396cba1c79b19eaee109ca86
parent7103b9113ce640ce9500eb5fcf1c33c6e4875ff6 (diff)
downloaddotfiles-768bcbd402cbd8b705d5b21423724af43b9ee543.tar.gz
dotfiles-768bcbd402cbd8b705d5b21423724af43b9ee543.tar.bz2
dotfiles-768bcbd402cbd8b705d5b21423724af43b9ee543.zip
Purge vim-plug
-rw-r--r--.vim/.gitignore2
-rw-r--r--.vim/filetype.vim4
-rw-r--r--.vim/plugin/init.vim153
-rw-r--r--.vim/plugin/misc.vim5
-rw-r--r--.vim/plugin/nnn.vim1
-rw-r--r--.vimrc9
-rwxr-xr-xbin/vim-pack46
7 files changed, 55 insertions, 165 deletions
diff --git a/.vim/.gitignore b/.vim/.gitignore
index 61c6b82..e455cfb 100644
--- a/.vim/.gitignore
+++ b/.vim/.gitignore
@@ -1,5 +1,3 @@
-plugged
-autoload
.swp
.netrwhist
pack/vendor
diff --git a/.vim/filetype.vim b/.vim/filetype.vim
index 82fa01c..c29f97e 100644
--- a/.vim/filetype.vim
+++ b/.vim/filetype.vim
@@ -4,3 +4,7 @@ augroup filetypedetect
autocmd BufRead,BufNewFile /etc/nginx*.conf setfiletype nginx
autocmd BufRead,BufNewFile *mutt-* setfiletype mail
augroup end
+
+autocmd FileType html setlocal shiftwidth=2 softtabstop=2 expandtab
+autocmd FileType css setlocal shiftwidth=2 softtabstop=2 expandtab
+autocmd FileType javascript setlocal shiftwidth=2 softtabstop=2 expandtab
diff --git a/.vim/plugin/init.vim b/.vim/plugin/init.vim
deleted file mode 100644
index 7a01616..0000000
--- a/.vim/plugin/init.vim
+++ /dev/null
@@ -1,153 +0,0 @@
-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:settings = split(expand('~/.vim/plugin/*.vim'))
-
-function! s:load_settings()
- for setting in s:settings
- if setting !~ 'init.vim'
- exec "source " . setting
- endif
- endfor
-endfunction
-
-function! BuildYCM(info)
- let ycm_install_options=' --clangd-completer'
-
- if !empty(glob("/usr/bin/go")) || !empty(glob("/usr/local/bin/go"))
- let ycm_install_options = ycm_install_options . ' --go-completer'
- endif
-
- exec '!python3 ./install.py' . ycm_install_options
-endfunction
-
-call plug#begin('~/.vim/plugged')
-
-" General
-Plug 'Valloric/YouCompleteMe', {
- \ 'do': function('BuildYCM'),
- \ }
-Plug 'SirVer/ultisnips'
-Plug 'honza/vim-snippets'
-Plug 'prabirshrestha/vim-lsp'
-Plug 'mbbill/undotree'
-
-Plug 'dense-analysis/ale'
-Plug 'junegunn/fzf'
-Plug 'junegunn/fzf.vim'
-Plug 'tpope/vim-eunuch'
-Plug 'tpope/vim-sleuth' " Automatically adjust indent
-Plug 'godlygeek/tabular'
-Plug 'airblade/vim-rooter'
-Plug 'ludovicchabant/vim-gutentags'
-
-Plug 'vim-airline/vim-airline'
-Plug 'vim-airline/vim-airline-themes'
-
-let g:airline#extensions#tabline#enabled = 1
-Plug 'tpope/vim-fugitive'
-Plug 'junegunn/gv.vim'
-
-Plug 'easymotion/vim-easymotion'
-
-map <Space> <Plug>(easymotion-prefix)
-
-Plug 'editorconfig/editorconfig-vim'
-
-" Language specific
-Plug 'habamax/vim-godot', {'for': 'gdscript'}
-Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'}
-Plug 'ledger/vim-ledger', {'for': 'ledger'}
-
-Plug 'iamcco/markdown-preview.nvim', {
- \ 'do': {-> mkdp#util#install()},
- \ 'for': ['markdown', 'vim-plug']
- \ }
-
-Plug 'mhinz/vim-signify'
-Plug 'tpope/vim-unimpaired'
-Plug 'voldikss/vim-floaterm' " Use :FloatermNew to open floating terminal
-
-Plug 'joshdick/onedark.vim'
-Plug 'liuchengxu/vista.vim'
-
-let g:vista_default_executive = 'ctags'
-
-let g:vista_executive_for = {
- \ 'go': 'vim_lsp',
- \ }
-
-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/misc.vim b/.vim/plugin/misc.vim
new file mode 100644
index 0000000..f8c5d9d
--- /dev/null
+++ b/.vim/plugin/misc.vim
@@ -0,0 +1,5 @@
+packadd! onedark.vim
+silent colorscheme onedark
+
+let g:airline#extensions#tabline#enabled = 1
+map <Space> <Plug>(easymotion-prefix)
diff --git a/.vim/plugin/nnn.vim b/.vim/plugin/nnn.vim
deleted file mode 100644
index 071e694..0000000
--- a/.vim/plugin/nnn.vim
+++ /dev/null
@@ -1 +0,0 @@
-command! NnnPicker packadd nnn.vim | NnnPicker
diff --git a/.vimrc b/.vimrc
index b15394a..e1138b4 100644
--- a/.vimrc
+++ b/.vimrc
@@ -8,6 +8,7 @@ set fileencodings=ucs=bom,utf-8,utf-16,gbk,big5,gb18030,latin1
set showcmd
set autoread
set mouse=a
+filetype on
filetype indent on
set modeline
set textwidth=72
@@ -63,10 +64,6 @@ set shiftwidth=4
set expandtab
set softtabstop=4
-autocmd FileType html setlocal shiftwidth=2 softtabstop=2 expandtab
-autocmd FileType css setlocal shiftwidth=2 softtabstop=2 expandtab
-autocmd FileType javascript setlocal shiftwidth=2 softtabstop=2 expandtab
-
set wrap
"set nowrap
"set wrapmargin=4
@@ -103,15 +100,13 @@ set tags=./.tags;,.tags
let mapleader=',' " change the key <leader>
nnoremap <leader>cd :cd %:p:h<CR> :pwd<CR>
-source ~/.vim/plugin/init.vim
source ~/.vim/keybindings.vim
source ~/.vim/notes.vim
-silent colorscheme onedark
-
highlight Pmenu ctermbg=grey
set exrc
if !empty(glob('~/.vim_local'))
source ~/.vim_local
endif
+
diff --git a/bin/vim-pack b/bin/vim-pack
index 0a6240e..f03cfa0 100755
--- a/bin/vim-pack
+++ b/bin/vim-pack
@@ -7,19 +7,28 @@ package_dirs=()
update_package () {
name=$1
remote_url=$2
- load_type=$3
+
+ load_type='start'
+ [ $# -ge 3 ] && load_type=$3
package_dir="$HOME/.vim/pack/vendor/$load_type/$name"
package_dirs+=($package_dir)
if [ ! -d $package_dir ]; then
echo "$name : Installing ... "
mkdir -p $package_dir
+ cd $package_dir
git clone --depth 1 $remote_url $package_dir && echo "$name : Done" || echo "$name : FAIL"
else
cd $package_dir
echo "$name : Updating ... "
git pull && echo "$name : Done" || echo "$name : FAIL"
fi
+
+ git submodule update --init --recursive --depth 1
+
+ if [ $# -ge 4 ]; then
+ $4
+ fi
}
clean () {
@@ -37,6 +46,39 @@ clean () {
done
}
-update_package "nnn.vim" "[email protected]:mcchrish/nnn.vim.git" "opt"
+install_ycm () {
+ opts=' --clangd-completer'
+
+ if [ -f /usr/bin/go -o -f /usr/local/bin/go ]; then
+ opts="$opts --go-completer"
+ fi
+
+ python3 ./install.py $opts
+}
+
+update_package 'YouCompleteMe' '[email protected]:ycm-core/YouCompleteMe.git' 'start' 'install_ycm'
+update_package "nnn.vim" "[email protected]:mcchrish/nnn.vim.git"
+update_package 'vim-fugitive' '[email protected]:tpope/vim-fugitive.git'
+update_package 'fzf' '[email protected]:junegunn/fzf.git'
+update_package 'fzf.vim' '[email protected]:junegunn/fzf.vim.git'
+update_package 'ultisnips' '[email protected]:SirVer/ultisnips.git'
+update_package 'vim-snippets' '[email protected]:honza/vim-snippets.git'
+update_package 'onedark.vim' '[email protected]:joshdick/onedark.vim.git' 'opt'
+update_package vim-lsp [email protected]:prabirshrestha/vim-lsp.git
+update_package undotree [email protected]:mbbill/undotree.git
+update_package ale [email protected]:dense-analysis/ale.git
+update_package vim-eunuch [email protected]:tpope/vim-eunuch.git
+update_package vim-sleuth [email protected]:tpope/vim-sleuth.git
+update_package tabular [email protected]:godlygeek/tabular.git
+update_package vim-rooter [email protected]:airblade/vim-rooter.git
+update_package vim-gutentags [email protected]:ludovicchabant/vim-gutentags.git
+update_package vim-airline [email protected]:vim-airline/vim-airline.git
+update_package vim-airline-themes [email protected]:vim-airline/vim-airline-themes.git
+update_package vim-easymotion [email protected]:easymotion/vim-easymotion.git
+update_package editorconfig-vim [email protected]:editorconfig/editorconfig-vim.git
+update_package vim-godot [email protected]:habamax/vim-godot.git
+update_package vim-ledger [email protected]:ledger/vim-ledger.git
+update_package vim-signify [email protected]:mhinz/vim-signify.git
+update_package vim-unimpaired [email protected]:tpope/vim-unimpaired.git
clean