Skip to content

Commit 28be2fe

Browse files
committed
vim-plug come back
1 parent e8f9762 commit 28be2fe

File tree

9 files changed

+308
-40
lines changed

9 files changed

+308
-40
lines changed

.gitignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88

99
test/pack/
1010
pack/
11-
bundle/repos
12-
bundle/.cache
11+
bundle/
1312
autoload/plug.vim
1413

1514
session/

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ This configuration may no be appropriate for you.
77
## Setup
88
```
99
bash -c "$(curl -fsSL https://raw.githubusercontent.com/jiaobuzuji/vimrc/master/install.sh)"
10+
vim --startuptime startuptime.log
1011
```

bundle/awesome.vim plugcfg/awesome.vim

+4-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
55
" vim:fdm=marker fmr={,}
66

7-
call dein#add(g:host.'mhinz/vim-startify') " {1
7+
Plug g:host.'mhinz/vim-startify' " {1
88
let g:startify_session_dir = $VIMFILES .'/session'
99
let g:startify_lists = [
1010
\ { 'type': 'sessions', 'header': [' Sessions'] },
@@ -27,8 +27,7 @@ nnoremap <Leader>ss :SSave<cr>
2727
nnoremap <Leader>sd :SDelete<cr>
2828
2929

30-
call dein#add(g:host.'preservim/nerdtree',{'lazy':1}) " {1 TODO
31-
" { 'on': ['NERDTreeToggle','NERDTreeFind'] }
30+
Plug g:host.'preservim/nerdtree' " {1
3231
let g:NERDTreeShowLineNumbers=1 "show line number
3332
let g:NERDTreeWinPos='left' "show nerdtree in the rigth side
3433
let g:NERDTreeIgnore=['\.py[cd]$', '\~$', '\.swo$', '\.swp$', '^\.git$', '^\.hg$', '^\.svn$', '\.bzr$']
@@ -42,12 +41,12 @@ nnoremap <leader>nf :NERDTreeFind<CR>
4241
nnoremap <Leader>nq :let g:NERDTreeQuitOnOpen = g:NERDTreeQuitOnOpen ? 0 : 1<cr>
4342
4443

45-
call dein#add(g:host.'preservim/nerdcommenter',{'lazy':1}) " {1
44+
Plug g:host.'preservim/nerdcommenter' " {1
4645
let g:NERDSpaceDelims=1
4746
let g:NERDMenuMode=1
4847

4948

50-
call dein#add(g:host.'mbbill/undotree',{'lazy':1}) " {1
49+
Plug g:host.'mbbill/undotree' " {1
5150
let g:undotree_WindowLayout=2
5251
let g:undotree_DiffpanelHeight=8
5352
let g:undotree_SetFocusWhenToggle=1

bundle/colorscheme.vim plugcfg/colorscheme.vim

+9-9
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
" Github: https://github.com/jiaobuzuji
44
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
55

6-
" call dein#add(g:host.'sjl/badwolf')
7-
" call dein#add(g:host.'tomasr/molokai')
8-
" call dein#add(g:host.'KabbAmine/yowish.vim')
9-
" call dein#add(g:host.'joshdick/onedark.vim')
10-
" call dein#add(g:host.'altercation/vim-colors-solarized')
6+
" Plug g:host.'sjl/badwolf'
7+
" Plug g:host.'tomasr/molokai'
8+
" Plug g:host.'KabbAmine/yowish.vim'
9+
" Plug g:host.'joshdick/onedark.vim'
10+
" Plug g:host.'altercation/vim-colors-solarized'
1111

12-
call dein#add(g:host.'morhetz/gruvbox')
12+
Plug g:host.'morhetz/gruvbox'
1313
let g:gruvbox_contrast_dark='hard'
1414
" let g:gruvbox_italic=1
1515

16-
call dein#add(g:host.'NLKNguyen/papercolor-theme')
16+
Plug g:host.'NLKNguyen/papercolor-theme'
1717
let g:PaperColor_Theme_Options = {
1818
\ 'theme': {
1919
\ 'default.dark': {
@@ -25,14 +25,14 @@ let g:PaperColor_Theme_Options = {
2525
\ }
2626
\ }
2727

28-
" call dein#add(g:host.'nanotech/jellybeans.vim')
28+
" Plug g:host.'nanotech/jellybeans.vim'
2929
" let g:jellybeans_overrides = {
3030
" \ 'background': { 'guibg': '000000' },
3131
" \ 'StatusLine': {'guibg': '282828', 'guifg': 'c7c7c7', 'ctermbg': '235', 'ctermfg': '255'},
3232
" \ 'StatusLineNC': {'guibg': '3a3a3a', 'guifg': '808080', 'ctermbg': '236', 'ctermfg': '244'},
3333
" \}
3434
" let g:jellybeans_use_term_italics = 1
3535
"
36-
" call dein#add(g:host. 'ayu-theme/ayu-vim')
36+
" Plug g:host. 'ayu-theme/ayu-vim'
3737
" let g:ayucolor="dark" " dart, mirage, light
3838

plugcfg/jump.vim

+249
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,249 @@
1+
" Vim Jump
2+
3+
" Github: https://github.com/jiaobuzuji
4+
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
5+
" vim:fdm=marker fmr={,}
6+
7+
" jump to somewhere:file,mru,bookmark
8+
" Plug 'Yggdroot/LeaderF' " {1
9+
" Plug 'Yggdroot/LeaderF-marks',{'on': 'LeaderfMarks'}
10+
" " show global mark
11+
" nnoremap <leader>pm :LeaderfMarks<Cr>
12+
13+
" "function
14+
" nnoremap <c-k> :LeaderfFunction<cr>
15+
" nnoremap <Leader>pk :LeaderfFunction<cr>
16+
" " buffer
17+
" nnoremap <Leader>pb :LeaderfBuffer<Cr>
18+
" " recent file
19+
" nnoremap <c-l> :LeaderfMru<cr>
20+
" nnoremap <Leader>pr :LeaderfMru<cr>
21+
" "file
22+
" nnoremap <Leader>pp :LeaderfFile<cr>
23+
" "leaderf cmd
24+
" nnoremap <Leader>ps :LeaderfSelf<cr>
25+
" nnoremap <Leader>pt :LeaderfBufTag<cr>
26+
" "colorsceme
27+
" nnoremap <Leader>pc :LeaderfColorscheme<cr>
28+
" "CtrlP cmd
29+
" let g:Lf_ShortcutF = '<C-P>'
30+
" let g:Lf_ShortcutB = '<C-j>'
31+
" let g:Lf_CacheDiretory=$VIMFILES
32+
" let g:Lf_DefaultMode='FullPath'
33+
" let g:Lf_StlColorscheme = 'default'
34+
" let g:Lf_StlSeparator = { 'left': '', 'right': '' }
35+
" let g:Lf_UseMemoryCache = 0
36+
" nnoremap <Leader><Leader> :LeaderfFile<cr>
37+
38+
" Plug 'Shougo/denite.nvim' " {1
39+
" Plug 'Shougo/neomru.vim'
40+
" autocmd misc_group VimEnter * silent! source $VIMFILES/rc/denite.vim
41+
" "keymapping for denite
42+
" nnoremap <c-p> :Denite file_rec<cr>
43+
" nnoremap <Leader><Leader> :Denite file_rec<cr>
44+
" nnoremap <c-j> :Denite buffer<cr>
45+
" nnoremap <c-l> :Denite file_mru<cr>
46+
" nnoremap <c-k> :Denite outline<cr>
47+
" nnoremap <Leader>pc :Denite colorscheme -no-quit<cr>
48+
" nnoremap <Leader>ff :Denite file<cr>
49+
" "mru
50+
" nnoremap <Leader>pr :Denite file_mru<cr>
51+
" "file
52+
" nnoremap <Leader>pp :Denite file_rec<cr>
53+
" "function
54+
" nnoremap <Leader>pp :Denite outline<cr>
55+
" "vim help
56+
" nnoremap <Leader>ph :Denite help<cr>
57+
" "command history
58+
" nnoremap <Leader>p: :Denite command_history<cr>
59+
" "fly on grep
60+
" nnoremap <Leader>pf :call denite#start([{'name': 'grep', 'args': ['', '', '!']}])<cr>
61+
62+
" " call denite#custom#var('file_rec', 'command',
63+
" " \ ['rg', '--hidden', '--files', '--glob', '!.git', '--glob', '']
64+
" " \ )
65+
66+
Plug 'ctrlpvim/ctrlp.vim' " {1
67+
Plug 'tacahiroy/ctrlp-funky',{'on': 'CtrlPFunky'}
68+
Plug 'fisadev/vim-ctrlp-cmdpalette',{'on': 'CtrlPCmdPalette'}
69+
Plug 'zeero/vim-ctrlp-help',{'on': 'CtrlPHelp'}
70+
"ctrlp thirdparty matchers
71+
Plug 'FelikZ/ctrlp-py-matcher'
72+
let g:ctrlp_match_func = { 'match': 'pymatcher#PyMatch' }
73+
" Set Ctrl-P to show match at top of list instead of at bottom, which is so
74+
" stupid that it's not default
75+
let g:ctrlp_match_window_reversed = 0
76+
let g:ctrlp_max_files = 70000
77+
let g:ctrlp_search_hidden=""
78+
79+
" Tell Ctrl-P to keep the current VIM working directory when starting a
80+
" search, another really stupid non default
81+
let g:ctrlp_working_path_mode = 'w'
82+
83+
let g:ctrlp_match_window = 'bottom,order:btt,min:1,max:20,results:20'
84+
" Ctrl-P ignore target dirs so VIM doesn't have to! Yay!
85+
let g:ctrlp_custom_ignore = {
86+
\ 'dir': '\v[\/]\.(git|svn|hg|build|sass-cache)$',
87+
\ 'file': '\v\.(exe|so|dll|o|d|proj|out)$',
88+
\ }
89+
let g:ctrlp_extensions = ['tag', 'buffertag', 'dir', 'bookmarkdir']
90+
91+
let g:ctrlp_use_caching = 50000
92+
" let g:ctrlp_use_caching = 0
93+
" let g:ctrlp_use_caching = 1
94+
95+
function! s:update_ctrlp_command() abort
96+
if executable('rg')
97+
let g:ctrlp_user_command = 'rg '.g:ctrlp_search_hidden.' %s --files --color=never --glob "!.git"'
98+
elseif executable('ag')
99+
"NOTE: --ignore option use wildcard PATTERN instead of regex PATTERN,and
100+
"it does not support {}
101+
"--hidden:enable seach hidden dirs and files
102+
"-g <regex PATTERN>:search file name that match the PATTERN
103+
let g:ctrlp_user_command = 'ag '.g:ctrlp_search_hidden.' %s -l --nocolor --nogroup
104+
\ --ignore "*.[odODaA]"
105+
\ --ignore "*.exe"
106+
\ --ignore "*.out"
107+
\ --ignore "*.hex"
108+
\ --ignore "cscope*"
109+
\ --ignore "*.so"
110+
\ --ignore "*.dll"
111+
\ --ignore ".git"
112+
\ -g ""'
113+
endif
114+
endfunction
115+
call s:update_ctrlp_command()
116+
117+
let g:user_command_async = 1
118+
let g:ctrlp_show_hidden = 1
119+
let g:ctrlp_funky_syntax_highlight = 0
120+
let g:ctrlp_funky_matchtype = 'path'
121+
122+
"handle bug of gitgutter
123+
function! s:ctrlp_funky()
124+
let g:gitgutter_async=0
125+
:CtrlPFunky
126+
let g:gitgutter_async=1
127+
endfunction
128+
nnoremap <c-k> :call <SID>ctrlp_funky()<cr>
129+
nnoremap <c-j> :CtrlPBuffer<Cr>
130+
131+
function! s:toggle_ctrlp_search_hidden() abort
132+
if g:ctrlp_search_hidden ==# ""
133+
let g:ctrlp_search_hidden = "--hidden"
134+
else
135+
let g:ctrlp_search_hidden = ""
136+
endif
137+
endfunction
138+
nnoremap <leader>ti :call <SID>toggle_ctrlp_search_hidden()<cr>:call <SID>update_ctrlp_command()<cr>
139+
" show global mark
140+
nnoremap <leader>pm :SignatureListGlobalMarks<Cr>
141+
" ctrlp buffer
142+
nnoremap <Leader>pb :CtrlPBuffer<Cr>
143+
nnoremap <c-l> :CtrlPMRUFiles<cr>
144+
"CtrlP mru
145+
nnoremap <Leader>pr :CtrlPMRUFiles<cr>
146+
"CtrlP file
147+
nnoremap <Leader>pp :CtrlP<cr>
148+
" narrow the list down with a word under cursor
149+
"CtrlP function
150+
nnoremap <Leader>pU :execute 'CtrlPFunky ' . expand('<cword>')<Cr>
151+
"CtrlP colorsceme
152+
"nnoremap <Leader>pc :call te#ctrlp#colorscheme#start()<cr>
153+
"CtrlP function
154+
nnoremap <Leader>pk :CtrlPFunky<cr>
155+
"CtrlP cmd
156+
nnoremap <Leader><Leader> :CtrlP<cr>
157+
"spacemacs :SPC ff
158+
nnoremap <Leader>ff :call te#ctrlp#dir#start()<cr>
159+
" CtrlP TODO {2
160+
" "CtrlP git branch
161+
" nnoremap <Leader>pgb :call te#ctrlp#git#start(1)<cr>
162+
" "CtrlP git show diff of specified commit
163+
" nnoremap <Leader>pgl :call te#ctrlp#git#start(2)<cr>
164+
" "CtrlP git log checkout
165+
" nnoremap <Leader>pgc :call te#ctrlp#git#start(3)<cr>
166+
" "CtrlP git remote branch
167+
" nnoremap <Leader>pgr :call te#ctrlp#git#start(4)<cr>
168+
"vim help
169+
nnoremap <Leader>ph :CtrlPHelp<cr>
170+
171+
" vim-easymotion {1
172+
Plug 'easymotion/vim-easymotion', { 'on': [ '<Plug>(easymotion-lineforward)',
173+
\ '<Plug>(easymotion-linebackward)','<Plug>(easymotion-overwin-w)' ]}
174+
map W <Plug>(easymotion-lineforward)
175+
map B <Plug>(easymotion-linebackward)
176+
" MultiWindow easymotion for word
177+
nmap <Leader>jw <Plug>(easymotion-overwin-w)
178+
xmap <Leader>jw <Plug>(easymotion-bd-w)
179+
omap <Leader>jw <Plug>(easymotion-bd-w)
180+
" Multi Input Find Motion:s
181+
nmap <Leader>js <Plug>(easymotion-sn)
182+
xmap <Leader>js <Plug>(easymotion-sn)
183+
omap <Leader>js <Plug>(easymotion-sn)
184+
" Multi Input Find Motion:t
185+
nmap <Leader>jt <Plug>(easymotion-tn)
186+
xmap <Leader>jt <Plug>(easymotion-tn)
187+
omap <Leader>jt <Plug>(easymotion-tn)
188+
" MultiWindow easymotion for line
189+
nmap <Leader>jl <Plug>(easymotion-overwin-line)
190+
xmap <Leader>jl <Plug>(easymotion-bd-jk)
191+
omap <Leader>jl <Plug>(easymotion-bd-jk)
192+
" MultiWindow easymotion for char
193+
nmap <Leader>jj <Plug>(easymotion-overwin-f)
194+
xmap <Leader>jj <Plug>(easymotion-bd-f)
195+
omap <Leader>jj <Plug>(easymotion-bd-f)
196+
map <LocalLeader><LocalLeader> <Plug>(easymotion-prefix)
197+
198+
let g:EasyMotion_startofline = 0
199+
let g:EasyMotion_show_prompt = 0
200+
let g:EasyMotion_verbose = 0
201+
202+
" Plug 't9md/vim-choosewin',{'on': '<Plug>(choosewin)'} " {1
203+
" let g:choosewin_overlay_enable = 1
204+
" nmap <Leader>wc <Plug>(choosewin)
205+
206+
Plug 'kshenoy/vim-signature' " {1
207+
let g:SignatureEnabledAtStartup = 1
208+
let g:SignatureMarkTextHLDynamic = 1
209+
let g:SignatureMarkerTextHLDynamic = 1
210+
211+
Plug 'MattesGroeger/vim-bookmarks', { 'on': ['BookmarkShowAll', 'BookmarkToggle', 'BookmarkAnnotate']} " {1
212+
let g:bookmark_auto_save = 1
213+
let g:bookmark_no_default_key_mappings = 1
214+
let g:bookmark_save_per_working_dir = 1
215+
let g:bookmark_sign = '>>'
216+
let g:bookmark_annotation_sign = '##'
217+
let g:bookmark_auto_close = 1
218+
"Bookmark annotate
219+
nnoremap <leader>mi :BookmarkAnnotate<CR>
220+
"Bookmark toggle
221+
nnoremap <leader>ma :BookmarkToggle<cr>
222+
"Bookmark annotate
223+
vnoremap <leader>mi :<c-u>exec ':BookmarkAnnotate '.getline("'<")[getpos("'<")[2]-1:getpos("'>")[2]-1]<cr>
224+
"Bookmark clear
225+
nnoremap <leader>mc :BookmarkClear<cr>
226+
"Bookmark show all
227+
nnoremap <leader>mb :BookmarkShowAll<CR>
228+
229+
" if get(g:,'feat_enable_airline') == 0 " {1
230+
" Plug 'tracyone/vim-buftabline'
231+
" let g:buftabline_numbers=2
232+
" let g:buftabline_show=1
233+
" let g:buftabline_indicators=1
234+
" endif
235+
236+
Plug 'ronakg/quickr-preview.vim', { 'for': ['qf']} " {1
237+
let g:quickr_preview_keymaps = 0
238+
autocmd filetype_group FileType qf nmap <buffer> <down> <down><plug>(quickr_preview)
239+
autocmd filetype_group FileType qf nmap <buffer> <up> <up><plug>(quickr_preview)
240+
autocmd filetype_group FileType qf nmap <buffer> <Space><Space> <plug>(quickr_preview)
241+
242+
" TODO {1
243+
" if get(g:,'feat_enable_airline') == 0
244+
" Plug 'tracyone/vim-buftabline'
245+
" let g:buftabline_numbers=2
246+
" let g:buftabline_show=1
247+
" let g:buftabline_indicators=1
248+
" endif
249+
"
File renamed without changes.

test/autoload/bundle.vim

+21
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,24 @@ endfunction
4040
"Plug 'scrooloose/nerdcommenter'
4141
"call plug#end()
4242

43+
" " Plugins
44+
" let g:host = 'https://github.com.cnpmjs.org/' " mirror
45+
" set runtimepath+=$VIMFILES/bundle/repos/github.com.cnpmjs.org/Shougo/dein.vim
46+
" call dein#begin($VIMFILES.'/bundle')
47+
" call dein#add(g:host.'Shougo/dein.vim',{'rtp':''})
48+
" source $VIMFILES/bundle/colorscheme.vim
49+
" " source $VIMFILES/bundle/statusline.vim
50+
" source $VIMFILES/bundle/awesome.vim " miscellaneous lifechange
51+
" " source $VIMFILES/bundle/git.vim
52+
" " source $VIMFILES/bundle/jump.vim
53+
" " source $VIMFILES/bundle/help.vim
54+
" " source $VIMFILES/bundle/edit.vim
55+
" " source $VIMFILES/bundle/complete.vim " snippet lsp
56+
" " source $VIMFILES/bundle/markdown.vim
57+
" " source $VIMFILES/bundle/writing.vim
58+
" " source $VIMFILES/bundle/tools.vim
59+
" call dein#end() " All of your Plugins must be added before the following line
60+
"
61+
" filetype plugin indent on
62+
" syntax on
63+
"

tools/installer.sh

+9-9
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,16 @@ rm -f "${HOME}/.vim" # remove link
7878
lnif "${REPO_PATH}/vimrc.git" "${HOME}/.vim" # relink
7979
mkdir -p ${HOME}/.vim/{undodir,session} # ,backup}
8080

81-
# Shougo dein
82-
# bash -c "$(curl -fsSL https://raw.githubusercontent.com/Shougo/dein.vim/master/bin/installer.sh)" "${HOME}/.vim/bundle"
83-
repo_sync "${HOME}/.vim/bundle/repos/${GITSRVURL}/Shougo" \
84-
"https://${GITSRVURL}/Shougo/dein.vim" \
85-
"master" \
86-
"dein.vim"
81+
# # Shougo dein
82+
# # bash -c "$(curl -fsSL https://raw.githubusercontent.com/Shougo/dein.vim/master/bin/installer.sh)" "${HOME}/.vim/bundle"
83+
# repo_sync "${HOME}/.vim/bundle/repos/${GITSRVURL}/Shougo" \
84+
# "https://${GITSRVURL}/Shougo/dein.vim" \
85+
# "master" \
86+
# "dein.vim"
8787

88-
# # junegunn vim-plug
89-
# curl -fLo ${HOME}/.vim/autoload/plug.vim --create-dirs \
90-
# https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
88+
# junegunn vim-plug
89+
curl -fLo ${HOME}/.vim/autoload/plug.vim --create-dirs \
90+
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
9191

9292
# # K-takata minpac
9393
# git clone --depth=1 https://github.com/ ~/.vim//

0 commit comments

Comments
 (0)