mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-02 22:40:06 +08:00
Improve unite layer (#1487)
All unite key bindings begins with `<Leader> f` " The default sources: " file: <Leader>ff " register: <Leader>fe " jump: <Leader>fj " messages: <Leader>fm " history/yank source <Leader>fh " quickfix source <Leader>fq " outline source <Leader>fo " localtion source <Leader>fl `SPC T s` is for colorscheme.
This commit is contained in:
parent
dac04f3e71
commit
9b8b054d91
@ -62,7 +62,7 @@ through search tools: `ag`, `rg`, `ack`, `pt` and `grep`, Choose one you like.
|
|||||||
[**Mnemonic key bindings navigation**](http://spacevim.org/mnemonic-key-bindings-navigation/)
|
[**Mnemonic key bindings navigation**](http://spacevim.org/mnemonic-key-bindings-navigation/)
|
||||||
|
|
||||||
You don't need to remember any key bindings, as the mapping guide will show up after the <kbd>SPC</kbd> is pressed.
|
You don't need to remember any key bindings, as the mapping guide will show up after the <kbd>SPC</kbd> is pressed.
|
||||||
The mapping guide is also available for `g`, `z`, `s`, `f` and `F`.
|
The mapping guide is also available for `g`, `z`, and `s`.
|
||||||
|
|
||||||
![mapping guide](https://user-images.githubusercontent.com/13142418/35568184-9a318082-058d-11e8-9d88-e0eafd1d498d.gif)
|
![mapping guide](https://user-images.githubusercontent.com/13142418/35568184-9a318082-058d-11e8-9d88-e0eafd1d498d.gif)
|
||||||
|
|
||||||
|
@ -616,7 +616,6 @@ function! SpaceVim#end() abort
|
|||||||
endif
|
endif
|
||||||
call SpaceVim#mapping#g#init()
|
call SpaceVim#mapping#g#init()
|
||||||
call SpaceVim#mapping#z#init()
|
call SpaceVim#mapping#z#init()
|
||||||
call SpaceVim#mapping#leader#defindglobalMappings()
|
|
||||||
call SpaceVim#mapping#leader#defindKEYs()
|
call SpaceVim#mapping#leader#defindKEYs()
|
||||||
call SpaceVim#mapping#space#init()
|
call SpaceVim#mapping#space#init()
|
||||||
if !SpaceVim#mapping#guide#has_configuration()
|
if !SpaceVim#mapping#guide#has_configuration()
|
||||||
|
@ -152,6 +152,53 @@ function! SpaceVim#default#layers() abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! SpaceVim#default#keyBindings() abort
|
function! SpaceVim#default#keyBindings() abort
|
||||||
|
if g:spacevim_enable_insert_leader
|
||||||
|
inoremap <silent> <Leader><Tab> <C-r>=MyLeaderTabfunc()<CR>
|
||||||
|
endif
|
||||||
|
|
||||||
|
" yark and paste
|
||||||
|
xnoremap <Leader>y "+y
|
||||||
|
xnoremap <Leader>d "+d
|
||||||
|
nnoremap <Leader>p "+p
|
||||||
|
nnoremap <Leader>P "+P
|
||||||
|
xnoremap <Leader>p "+p
|
||||||
|
xnoremap <Leader>P "+P
|
||||||
|
|
||||||
|
cnoremap <Leader><C-F> <C-F>
|
||||||
|
|
||||||
|
" Location list movement
|
||||||
|
let g:_spacevim_mappings.l = {'name' : '+Location movement'}
|
||||||
|
call SpaceVim#mapping#def('nnoremap', '<Leader>lj', ':lnext<CR>',
|
||||||
|
\ 'Jump to next location list position',
|
||||||
|
\ 'lnext',
|
||||||
|
\ 'Next location list')
|
||||||
|
call SpaceVim#mapping#def('nnoremap', '<Leader>lk', ':lprev<CR>',
|
||||||
|
\ 'Jump to previous location list position',
|
||||||
|
\ 'lprev',
|
||||||
|
\ 'Previous location list')
|
||||||
|
call SpaceVim#mapping#def('nnoremap', '<Leader>lq', ':lclose<CR>',
|
||||||
|
\ 'Close the window showing the location list',
|
||||||
|
\ 'lclose',
|
||||||
|
\ 'Close location list window')
|
||||||
|
|
||||||
|
" quickfix list movement
|
||||||
|
let g:_spacevim_mappings.q = {'name' : '+Quickfix movement'}
|
||||||
|
call SpaceVim#mapping#def('nnoremap', '<Leader>qj', ':cnext<CR>',
|
||||||
|
\ 'Jump to next quickfix list position',
|
||||||
|
\ 'cnext',
|
||||||
|
\ 'Next quickfix list')
|
||||||
|
call SpaceVim#mapping#def('nnoremap', '<Leader>qk', ':cprev<CR>',
|
||||||
|
\ 'Jump to previous quickfix list position',
|
||||||
|
\ 'cprev',
|
||||||
|
\ 'Previous quickfix list')
|
||||||
|
call SpaceVim#mapping#def('nnoremap', '<Leader>qq', ':cclose<CR>',
|
||||||
|
\ 'Close quickfix list window',
|
||||||
|
\ 'cclose',
|
||||||
|
\ 'Close quickfix list window')
|
||||||
|
call SpaceVim#mapping#def('nnoremap <silent>', '<Leader>qr', 'q',
|
||||||
|
\ 'Toggle recording',
|
||||||
|
\ '',
|
||||||
|
\ 'Toggle recording mode')
|
||||||
|
|
||||||
" Save a file with sudo
|
" Save a file with sudo
|
||||||
" http://forrst.com/posts/Use_w_to_sudo_write_a_file_with_Vim-uAN
|
" http://forrst.com/posts/Use_w_to_sudo_write_a_file_with_Vim-uAN
|
||||||
|
@ -192,7 +192,6 @@ function! SpaceVim#layers#colorscheme#config() abort
|
|||||||
call SpaceVim#mapping#space#def('nnoremap', ['T', 'n'],
|
call SpaceVim#mapping#space#def('nnoremap', ['T', 'n'],
|
||||||
\ 'call call(' . string(s:_function('s:cycle_spacevim_theme'))
|
\ 'call call(' . string(s:_function('s:cycle_spacevim_theme'))
|
||||||
\ . ', [])', 'cycle-spacevim-theme', 1)
|
\ . ', [])', 'cycle-spacevim-theme', 1)
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['T', 's'], 'Unite colorscheme', 'unite-colorschemes', 1)
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,75 +7,35 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
|
|
||||||
function! SpaceVim#layers#unite#plugins() abort
|
function! SpaceVim#layers#unite#plugins() abort
|
||||||
|
" The default sources:
|
||||||
|
" file: <Leader>ff
|
||||||
|
" register: <Leader>fe
|
||||||
|
" jump: <Leader>fj
|
||||||
|
" messages: <Leader>fm
|
||||||
let plugins = [
|
let plugins = [
|
||||||
\ ['Shougo/unite.vim',{ 'merged' : 0 , 'loadconf' : 1}],
|
\ ['Shougo/unite.vim',{ 'merged' : 0 , 'loadconf' : 1}],
|
||||||
\ ['Shougo/neoyank.vim'],
|
\ ['thinca/vim-unite-history', {'merged' : 0}],
|
||||||
\ ['soh335/unite-qflist'],
|
\ ['Shougo/unite-help', {'merged' : 0}],
|
||||||
\ ['SpaceVim/unite-unicode'],
|
\ ['wsdjeg/unite-radio.vim', {'loadconf' : 1, 'merged' : 0}],
|
||||||
\ ['ujihisa/unite-equery'],
|
|
||||||
\ ['m2mdas/unite-file-vcs'],
|
|
||||||
\ ['Shougo/neomru.vim'],
|
|
||||||
\ ['andreicristianpetcu/vim-van'],
|
|
||||||
\ ['kmnk/vim-unite-svn'],
|
|
||||||
\ ['basyura/unite-rails'],
|
|
||||||
\ ['nobeans/unite-grails'],
|
|
||||||
\ ['choplin/unite-vim_hacks'],
|
|
||||||
\ ['mattn/webapi-vim'],
|
|
||||||
\ ['mattn/gist-vim', {'loadconf' : 1}],
|
|
||||||
\ ['henices/unite-stock'],
|
|
||||||
\ ['mattn/wwwrenderer-vim'],
|
|
||||||
\ ['thinca/vim-openbuf'],
|
|
||||||
\ ['ujihisa/unite-haskellimport'],
|
|
||||||
\ ['oppara/vim-unite-cake'],
|
|
||||||
\ ['thinca/vim-ref', {'loadconf' : 1}],
|
|
||||||
\ ['heavenshell/unite-zf'],
|
|
||||||
\ ['heavenshell/unite-sf2'],
|
|
||||||
\ ['osyo-manga/unite-vimpatches'],
|
|
||||||
\ ['rhysd/unite-emoji.vim'],
|
|
||||||
\ ['Shougo/unite-outline'],
|
|
||||||
\ ['hewes/unite-gtags' ,{'loadconf' : 1}],
|
|
||||||
\ ['rafi/vim-unite-issue'],
|
|
||||||
\ ['joker1007/unite-pull-request'],
|
|
||||||
\ ['tsukkee/unite-tag'],
|
|
||||||
\ ['ujihisa/unite-launch'],
|
|
||||||
\ ['ujihisa/unite-gem'],
|
|
||||||
\ ['osyo-manga/unite-filetype'],
|
|
||||||
\ ['thinca/vim-unite-history'],
|
|
||||||
\ ['Shougo/neobundle-vim-recipes'],
|
|
||||||
\ ['Shougo/unite-help'],
|
|
||||||
\ ['ujihisa/unite-locate'],
|
|
||||||
\ ['kmnk/vim-unite-giti'],
|
|
||||||
\ ['ujihisa/unite-font'],
|
|
||||||
\ ['t9md/vim-unite-ack'],
|
|
||||||
\ ['mileszs/ack.vim',{'on_cmd' : 'Ack'}],
|
|
||||||
\ ['albfan/ag.vim',{'on_cmd' : 'Ag' , 'loadconf' : 1}],
|
|
||||||
\ ['dyng/ctrlsf.vim',{'on_cmd' : 'CtrlSF', 'on_map' : '<Plug>CtrlSF', 'loadconf' : 1 , 'loadconf_before' : 1}],
|
|
||||||
\ ['daisuzu/unite-adb'],
|
|
||||||
\ ['osyo-manga/unite-airline_themes'],
|
|
||||||
\ ['mattn/unite-vim_advent-calendar'],
|
|
||||||
\ ['mattn/unite-remotefile'],
|
|
||||||
\ ['sgur/unite-everything'],
|
|
||||||
\ ['wsdjeg/unite-dwm'],
|
|
||||||
\ ['raw1z/unite-projects'],
|
|
||||||
\ ['SpaceVim/unite-ctags'],
|
|
||||||
\ ['Shougo/unite-session'],
|
|
||||||
\ ['osyo-manga/unite-quickfix'],
|
|
||||||
\ ['ujihisa/unite-colorscheme'],
|
|
||||||
\ ['mattn/unite-gist'],
|
|
||||||
\ ['tacroe/unite-mark'],
|
|
||||||
\ ['tacroe/unite-alias'],
|
|
||||||
\ ['tex/vim-unite-id'],
|
|
||||||
\ ['sgur/unite-qf'],
|
|
||||||
\ ['lambdalisue/vim-gista-unite'],
|
|
||||||
\ ['wsdjeg/unite-radio.vim', {'loadconf' : 1}],
|
|
||||||
\ ['lambdalisue/unite-grep-vcs', {
|
|
||||||
\ 'autoload': {
|
|
||||||
\ 'unite_sources': ['grep/git', 'grep/hg'],
|
|
||||||
\ }}],
|
|
||||||
\ ['lambdalisue/vim-gista', {
|
|
||||||
\ 'on_cmd': 'Gista'
|
|
||||||
\ }],
|
|
||||||
\ ]
|
\ ]
|
||||||
|
|
||||||
|
" \ ['mileszs/ack.vim',{'on_cmd' : 'Ack'}],
|
||||||
|
" \ ['albfan/ag.vim',{'on_cmd' : 'Ag' , 'loadconf' : 1}],
|
||||||
|
" \ ['dyng/ctrlsf.vim',{'on_cmd' : 'CtrlSF', 'on_map' : '<Plug>CtrlSF', 'loadconf' : 1 , 'loadconf_before' : 1}],
|
||||||
|
|
||||||
|
" history/yank source <Leader>fh
|
||||||
|
call add(plugins, ['Shougo/neoyank.vim', {'merged' : 0}])
|
||||||
|
" quickfix source <Leader>fq
|
||||||
|
call add(plugins, ['osyo-manga/unite-quickfix', {'merged' : 0}])
|
||||||
|
" outline source <Leader>fo
|
||||||
|
call add(plugins, ['Shougo/unite-outline', {'merged' : 0}])
|
||||||
|
call add(plugins, ['Shougo/neomru.vim', {'merged' : 0}])
|
||||||
|
|
||||||
|
" This repo merge:
|
||||||
|
" - https://github.com/sgur/unite-qf locationlist
|
||||||
|
" - https://github.com/ujihisa/unite-colorscheme colorscheme
|
||||||
|
" - unicode
|
||||||
|
call add(plugins, ['SpaceVim/Unite-sources', {'merged' : 0}])
|
||||||
if g:spacevim_enable_googlesuggest
|
if g:spacevim_enable_googlesuggest
|
||||||
call add(plugins, ['mopp/googlesuggest-source.vim'])
|
call add(plugins, ['mopp/googlesuggest-source.vim'])
|
||||||
call add(plugins, ['mattn/googlesuggest-complete-vim'])
|
call add(plugins, ['mattn/googlesuggest-complete-vim'])
|
||||||
@ -98,286 +58,122 @@ endfunction
|
|||||||
let s:file = expand('<sfile>:~')
|
let s:file = expand('<sfile>:~')
|
||||||
let s:unite_lnum = expand('<slnum>') + 3
|
let s:unite_lnum = expand('<slnum>') + 3
|
||||||
function! s:defind_fuzzy_finder() abort
|
function! s:defind_fuzzy_finder() abort
|
||||||
nnoremap <silent> <Leader>fr
|
nnoremap <silent> <Leader>fr
|
||||||
\ :<C-u>Unite -buffer-name=resume resume<CR>
|
\ :<C-u>Unite -buffer-name=resume resume<CR>
|
||||||
|
let lnum = expand('<slnum>') + s:unite_lnum - 4
|
||||||
|
let g:_spacevim_mappings.f.r = ['Unite -buffer-name=resume resume',
|
||||||
|
\ 'resume unite window',
|
||||||
|
\ [
|
||||||
|
\ '[Leader f r ] is to resume unite window',
|
||||||
|
\ '',
|
||||||
|
\ 'Definition: ' . s:file . ':' . lnum,
|
||||||
|
\ ]
|
||||||
|
\ ]
|
||||||
|
if has('nvim')
|
||||||
|
nnoremap <silent> <Leader>ff
|
||||||
|
\ :<C-u>Unite file_rec/neovim<cr>
|
||||||
let lnum = expand('<slnum>') + s:unite_lnum - 4
|
let lnum = expand('<slnum>') + s:unite_lnum - 4
|
||||||
let g:_spacevim_mappings.f.r = ['Unite -buffer-name=resume resume',
|
let g:_spacevim_mappings.f.f = ['Unite file_rec/neovim',
|
||||||
\ 'resume unite window',
|
\ 'fuzzy find file',
|
||||||
\ [
|
\ [
|
||||||
\ '[Leader f r ] is to resume unite window',
|
\ '[Leader f f ] is to fuzzy find file',
|
||||||
\ '',
|
\ '',
|
||||||
\ 'Definition: ' . s:file . ':' . lnum,
|
\ 'Definition: ' . s:file . ':' . lnum,
|
||||||
\ ]
|
\ ]
|
||||||
\ ]
|
\ ]
|
||||||
return
|
else
|
||||||
if has('nvim')
|
nnoremap <silent> <Leader>ff
|
||||||
nnoremap <silent> [unite]f
|
\ :<C-u>Unite file_rec/async<cr>
|
||||||
\ :<C-u>Unite file_rec/neovim<cr>
|
|
||||||
let lnum = expand('<slnum>') + s:unite_lnum - 4
|
|
||||||
let g:_spacevim_mappings_unite.f = ['Unite file_rec/neovim',
|
|
||||||
\ 'file_rec',
|
|
||||||
\ [
|
|
||||||
\ '[UNITE f ] is to open unite file_rec source',
|
|
||||||
\ '',
|
|
||||||
\ 'Definition: ' . s:file . ':' . lnum,
|
|
||||||
\ ]
|
|
||||||
\ ]
|
|
||||||
else
|
|
||||||
nnoremap <silent> [unite]f
|
|
||||||
\ :<C-u>Unite file_rec/async<cr>
|
|
||||||
let lnum = expand('<slnum>') + s:unite_lnum - 4
|
|
||||||
let g:_spacevim_mappings_unite.f = ['Unite file_rec/async',
|
|
||||||
\ 'file_rec',
|
|
||||||
\ [
|
|
||||||
\ '[UNITE f ] is to open unite file_rec source',
|
|
||||||
\ '',
|
|
||||||
\ 'Definition: ' . s:file . ':' . lnum,
|
|
||||||
\ ]
|
|
||||||
\ ]
|
|
||||||
endif
|
|
||||||
nnoremap <silent> [unite]i
|
|
||||||
\ :<C-u>Unite file_rec/git<cr>
|
|
||||||
let lnum = expand('<slnum>') + s:unite_lnum - 4
|
let lnum = expand('<slnum>') + s:unite_lnum - 4
|
||||||
let g:_spacevim_mappings_unite.i = ['Unite file_rec/git',
|
let g:_spacevim_mappings.f.f = ['Unite file_rec/async',
|
||||||
\ 'git files',
|
\ 'fuzzy find file',
|
||||||
\ [
|
\ [
|
||||||
\ '[UNITE f ] is to open unite file_rec source',
|
\ '[Leader f f ] is to fuzzy find file',
|
||||||
\ '',
|
|
||||||
\ 'Definition: ' . s:file . ':' . lnum,
|
|
||||||
\ ]
|
|
||||||
\ ]
|
|
||||||
nnoremap <silent> [unite]g
|
|
||||||
\ :<C-u>Unite grep<cr>
|
|
||||||
let lnum = expand('<slnum>') + s:unite_lnum - 4
|
|
||||||
let g:_spacevim_mappings_unite.g = ['Unite grep',
|
|
||||||
\ 'unite grep',
|
|
||||||
\ [
|
|
||||||
\ '[UNITE g ] is to open unite grep source',
|
|
||||||
\ '',
|
|
||||||
\ 'Definition: ' . s:file . ':' . lnum,
|
|
||||||
\ ]
|
|
||||||
\ ]
|
|
||||||
nnoremap <silent> [unite]u
|
|
||||||
\ :<C-u>Unite source<CR>
|
|
||||||
let lnum = expand('<slnum>') + s:unite_lnum - 4
|
|
||||||
let g:_spacevim_mappings_unite.u = ['Unite source',
|
|
||||||
\ 'unite source',
|
|
||||||
\ [
|
|
||||||
\ '[UNITE u ] is to open unite source',
|
|
||||||
\ '',
|
|
||||||
\ 'Definition: ' . s:file . ':' . lnum,
|
|
||||||
\ ]
|
|
||||||
\ ]
|
|
||||||
nnoremap <silent> [unite]t
|
|
||||||
\ :<C-u>Unite tag<CR>
|
|
||||||
let lnum = expand('<slnum>') + s:unite_lnum - 4
|
|
||||||
let g:_spacevim_mappings_unite.t = ['Unite tag',
|
|
||||||
\ 'unite tag',
|
|
||||||
\ [
|
|
||||||
\ '[UNITE t ] is to open unite tag source',
|
|
||||||
\ '',
|
|
||||||
\ 'Definition: ' . s:file . ':' . lnum,
|
|
||||||
\ ]
|
|
||||||
\ ]
|
|
||||||
nnoremap <silent> [unite]T
|
|
||||||
\ :<C-u>Unite tag/include<CR>
|
|
||||||
let lnum = expand('<slnum>') + s:unite_lnum - 4
|
|
||||||
let g:_spacevim_mappings_unite.T = ['Unite tag/include',
|
|
||||||
\ 'unite tag/include',
|
|
||||||
\ [
|
|
||||||
\ '[UNITE T ] is to open unite tag/include source',
|
|
||||||
\ '',
|
|
||||||
\ 'Definition: ' . s:file . ':' . lnum,
|
|
||||||
\ ]
|
|
||||||
\ ]
|
|
||||||
nnoremap <silent> [unite]l
|
|
||||||
\ :<C-u>Unite locationlist<CR>
|
|
||||||
let lnum = expand('<slnum>') + s:unite_lnum - 4
|
|
||||||
let g:_spacevim_mappings_unite.l = ['Unite locationlist',
|
|
||||||
\ 'unite locationlist',
|
|
||||||
\ [
|
|
||||||
\ '[UNITE l ] is to open unite locationlist source',
|
|
||||||
\ '',
|
|
||||||
\ 'Definition: ' . s:file . ':' . lnum,
|
|
||||||
\ ]
|
|
||||||
\ ]
|
|
||||||
nnoremap <silent> [unite]q
|
|
||||||
\ :<C-u>Unite quickfix<CR>
|
|
||||||
let lnum = expand('<slnum>') + s:unite_lnum - 4
|
|
||||||
let g:_spacevim_mappings_unite.q = ['Unite quickfix',
|
|
||||||
\ 'unite quickfix',
|
|
||||||
\ [
|
|
||||||
\ '[UNITE q ] is to open unite quickfix source',
|
|
||||||
\ '',
|
|
||||||
\ 'Definition: ' . s:file . ':' . lnum,
|
|
||||||
\ ]
|
|
||||||
\ ]
|
|
||||||
nnoremap <silent> [unite]e :<C-u>Unite
|
|
||||||
\ -buffer-name=register register<CR>
|
|
||||||
let lnum = expand('<slnum>') + s:unite_lnum - 4
|
|
||||||
let g:_spacevim_mappings_unite.e = ['Unite register',
|
|
||||||
\ 'unite register',
|
|
||||||
\ [
|
|
||||||
\ '[UNITE l ] is to open unite locationlist source',
|
|
||||||
\ '',
|
|
||||||
\ 'Definition: ' . s:file . ':' . lnum,
|
|
||||||
\ ]
|
|
||||||
\ ]
|
|
||||||
nnoremap <silent> [unite]j
|
|
||||||
\ :<C-u>Unite jump<CR>
|
|
||||||
let lnum = expand('<slnum>') + s:unite_lnum - 4
|
|
||||||
let g:_spacevim_mappings_unite.j = ['Unite jump',
|
|
||||||
\ 'unite jump',
|
|
||||||
\ [
|
|
||||||
\ '[UNITE j ] is to open unite jump source',
|
|
||||||
\ '',
|
|
||||||
\ 'Definition: ' . s:file . ':' . lnum,
|
|
||||||
\ ]
|
|
||||||
\ ]
|
|
||||||
nnoremap <silent> [unite]h
|
|
||||||
\ :<C-u>Unite history/yank<CR>
|
|
||||||
let lnum = expand('<slnum>') + s:unite_lnum - 4
|
|
||||||
let g:_spacevim_mappings_unite.h = ['Unite history/yank',
|
|
||||||
\ 'unite history/yank',
|
|
||||||
\ [
|
|
||||||
\ '[UNITE h ] is to open unite history/yank source',
|
|
||||||
\ '',
|
|
||||||
\ 'Definition: ' . s:file . ':' . lnum,
|
|
||||||
\ ]
|
|
||||||
\ ]
|
|
||||||
nnoremap <silent> [unite]<C-h>
|
|
||||||
\ :<C-u>UniteWithCursorWord help<CR>
|
|
||||||
let lnum = expand('<slnum>') + s:unite_lnum - 4
|
|
||||||
let g:_spacevim_mappings_unite['<C-h>'] = ['UniteWithCursorWord help',
|
|
||||||
\ 'unite with cursor word help',
|
|
||||||
\ [
|
|
||||||
\ '[UNITE <c-h> ] is to open unite help source for cursor word',
|
|
||||||
\ '',
|
|
||||||
\ 'Definition: ' . s:file . ':' . lnum,
|
|
||||||
\ ]
|
|
||||||
\ ]
|
|
||||||
nnoremap <silent> [unite]s
|
|
||||||
\ :<C-u>Unite session<CR>
|
|
||||||
let lnum = expand('<slnum>') + s:unite_lnum - 4
|
|
||||||
let g:_spacevim_mappings_unite.s = ['Unite session',
|
|
||||||
\ 'unite session',
|
|
||||||
\ [
|
|
||||||
\ '[UNITE s ] is to open unite session source',
|
|
||||||
\ '',
|
|
||||||
\ 'Definition: ' . s:file . ':' . lnum,
|
|
||||||
\ ]
|
|
||||||
\ ]
|
|
||||||
nnoremap <silent> [unite]o :<C-u>Unite -buffer-name=outline
|
|
||||||
\ -start-insert -auto-preview -split outline<CR>
|
|
||||||
let lnum = expand('<slnum>') + s:unite_lnum - 4
|
|
||||||
let g:_spacevim_mappings_unite.o = ['Unite outline',
|
|
||||||
\ 'unite outline',
|
|
||||||
\ [
|
|
||||||
\ '[UNITE o ] is to open unite outline source',
|
|
||||||
\ '',
|
|
||||||
\ 'Definition: ' . s:file . ':' . lnum,
|
|
||||||
\ ]
|
|
||||||
\ ]
|
|
||||||
|
|
||||||
" menu
|
|
||||||
nnoremap <silent> [unite]ma
|
|
||||||
\ :<C-u>Unite mapping<CR>
|
|
||||||
nnoremap <silent> [unite]me
|
|
||||||
\ :<C-u>Unite output:message<CR>
|
|
||||||
let lnum = expand('<slnum>') + s:unite_lnum - 6
|
|
||||||
let g:_spacevim_mappings_unite.m = {'name' : '+Menus',
|
|
||||||
\ 'a' : ['Unite mapping', 'unite mappings',
|
|
||||||
\ [
|
|
||||||
\ '[UNITE m a ] is to open unite mapping menu',
|
|
||||||
\ '',
|
|
||||||
\ 'Definition: ' . s:file . ':' . lnum,
|
|
||||||
\ ]
|
|
||||||
\ ],
|
|
||||||
\ 'e' : ['Unite output:message', 'unite messages',
|
|
||||||
\ [
|
|
||||||
\ '[UNITE o ] is to open unite message menu',
|
|
||||||
\ '',
|
|
||||||
\ 'Definition: ' . s:file . ':' . (lnum + 2),
|
|
||||||
\ ]
|
|
||||||
\ ]
|
|
||||||
\ }
|
|
||||||
|
|
||||||
nnoremap <silent> [unite]c :<C-u>UniteWithCurrentDir
|
|
||||||
\ -buffer-name=files buffer bookmark file<CR>
|
|
||||||
let lnum = expand('<slnum>') + s:unite_lnum - 4
|
|
||||||
let g:_spacevim_mappings_unite.c =
|
|
||||||
\ ['UniteWithCurrentDir -buffer-name=files buffer bookmark file',
|
|
||||||
\ 'unite files in current dir',
|
|
||||||
\ [
|
|
||||||
\ '[UNITE c ] is to open unite outline source',
|
|
||||||
\ '',
|
|
||||||
\ 'Definition: ' . s:file . ':' . lnum,
|
|
||||||
\ ]
|
|
||||||
\ ]
|
|
||||||
nnoremap <silent> [unite]b :<C-u>UniteWithBufferDir
|
|
||||||
\ -buffer-name=files -prompt=%\ buffer bookmark file<CR>
|
|
||||||
let lnum = expand('<slnum>') + s:unite_lnum - 4
|
|
||||||
let g:_spacevim_mappings_unite.b =
|
|
||||||
\ ['UniteWithBufferDir -buffer-name=files' .
|
|
||||||
\ ' buffer bookmark file',
|
|
||||||
\ 'unite files in current dir',
|
|
||||||
\ [
|
|
||||||
\ '[UNITE b ] is to open unite buffer and bookmark source with cursor',
|
|
||||||
\ 'word',
|
|
||||||
\ '',
|
|
||||||
\ 'Definition: ' . s:file . ':' . lnum,
|
|
||||||
\ ]
|
|
||||||
\ ]
|
|
||||||
nnoremap <silent> [unite]n
|
|
||||||
\ :<C-u>Unite session/new<CR>
|
|
||||||
let lnum = expand('<slnum>') + s:unite_lnum - 4
|
|
||||||
let g:_spacevim_mappings_unite.n = ['Unite session/new',
|
|
||||||
\ 'unite session/new',
|
|
||||||
\ [
|
|
||||||
\ '[UNITE n ] is to create new vim session',
|
|
||||||
\ '',
|
|
||||||
\ 'Definition: ' . s:file . ':' . lnum,
|
|
||||||
\ ]
|
|
||||||
\ ]
|
|
||||||
nnoremap <silent> [unite]/
|
|
||||||
\ :Unite grep:.<cr>
|
|
||||||
let lnum = expand('<slnum>') + s:unite_lnum - 4
|
|
||||||
let g:_spacevim_mappings_unite['/'] = ['Unite grep:.',
|
|
||||||
\ 'unite grep with preview',
|
|
||||||
\ [
|
|
||||||
\ '[UNITE / ] is to open unite grep source',
|
|
||||||
\ '',
|
|
||||||
\ 'Definition: ' . s:file . ':' . lnum,
|
|
||||||
\ ]
|
|
||||||
\ ]
|
|
||||||
nnoremap <silent> [unite]w
|
|
||||||
\ :<C-u>Unite -buffer-name=files -no-split
|
|
||||||
\ jump_point file_point buffer_tab
|
|
||||||
\ file_rec:! file file/new<CR>
|
|
||||||
let lnum = expand('<slnum>') + s:unite_lnum - 6
|
|
||||||
let g:_spacevim_mappings_unite.w= ['Unite -buffer-name=files -no-split' .
|
|
||||||
\ ' jump_point file_point buffer_tab file_rec:! file file/new',
|
|
||||||
\ 'unite all file and jump',
|
|
||||||
\ [
|
|
||||||
\ '[UNITE w ] is to open unite jump_point file_point and buffer_tab',
|
|
||||||
\ 'source',
|
|
||||||
\ '',
|
|
||||||
\ 'Definition: ' . s:file . ':' . lnum,
|
|
||||||
\ ]
|
|
||||||
\ ]
|
|
||||||
nnoremap <silent>[unite]<Space> :Unite -silent -ignorecase -winheight=17
|
|
||||||
\ -start-insert menu:CustomKeyMaps<CR>
|
|
||||||
let lnum = expand('<slnum>') + s:unite_lnum - 4
|
|
||||||
let g:_spacevim_mappings_unite['[SPC]'] = ['Unite -silent -ignorecase' .
|
|
||||||
\ ' -winheight=17 -start-insert menu:CustomKeyMaps',
|
|
||||||
\ 'unite customkeymaps',
|
|
||||||
\ [
|
|
||||||
\ '[UNITE o ] is to open unite outline source',
|
|
||||||
\ '',
|
\ '',
|
||||||
\ 'Definition: ' . s:file . ':' . lnum,
|
\ 'Definition: ' . s:file . ':' . lnum,
|
||||||
\ ]
|
\ ]
|
||||||
\ ]
|
\ ]
|
||||||
|
endif
|
||||||
|
nnoremap <silent> <Leader>fe :<C-u>Unite
|
||||||
|
\ -buffer-name=register register<CR>
|
||||||
|
let lnum = expand('<slnum>') + s:unite_lnum - 4
|
||||||
|
let g:_spacevim_mappings.f.e = ['Unite register',
|
||||||
|
\ 'fuzzy find register',
|
||||||
|
\ [
|
||||||
|
\ '[Leader f e] is to fuzzy find content in register',
|
||||||
|
\ '',
|
||||||
|
\ 'Definition: ' . s:file . ':' . lnum,
|
||||||
|
\ ]
|
||||||
|
\ ]
|
||||||
|
nnoremap <silent> <Leader>fh
|
||||||
|
\ :<C-u>Unite history/yank<CR>
|
||||||
|
let lnum = expand('<slnum>') + s:unite_lnum - 4
|
||||||
|
let g:_spacevim_mappings.f.h = ['Unite history/yank',
|
||||||
|
\ 'fuzzy find history/yank',
|
||||||
|
\ [
|
||||||
|
\ '[Leader f h] is to fuzzy find history and yank content',
|
||||||
|
\ '',
|
||||||
|
\ 'Definition: ' . s:file . ':' . lnum,
|
||||||
|
\ ]
|
||||||
|
\ ]
|
||||||
|
nnoremap <silent> <Leader>fj
|
||||||
|
\ :<C-u>Unite jump<CR>
|
||||||
|
let lnum = expand('<slnum>') + s:unite_lnum - 4
|
||||||
|
let g:_spacevim_mappings.f.j = ['Unite jump',
|
||||||
|
\ 'fuzzy find jump list',
|
||||||
|
\ [
|
||||||
|
\ '[Leader f j] is to fuzzy find jump list',
|
||||||
|
\ '',
|
||||||
|
\ 'Definition: ' . s:file . ':' . lnum,
|
||||||
|
\ ]
|
||||||
|
\ ]
|
||||||
|
nnoremap <silent> <Leader>fl
|
||||||
|
\ :<C-u>Unite locationlist<CR>
|
||||||
|
let lnum = expand('<slnum>') + s:unite_lnum - 4
|
||||||
|
let g:_spacevim_mappings.f.l = ['Unite locationlist',
|
||||||
|
\ 'fuzzy find location list',
|
||||||
|
\ [
|
||||||
|
\ '[Leader f l] is to fuzzy find location list',
|
||||||
|
\ '',
|
||||||
|
\ 'Definition: ' . s:file . ':' . lnum,
|
||||||
|
\ ]
|
||||||
|
\ ]
|
||||||
|
nnoremap <silent> <Leader>fm
|
||||||
|
\ :<C-u>Unite output:message<CR>
|
||||||
|
let lnum = expand('<slnum>') + s:unite_lnum - 4
|
||||||
|
let g:_spacevim_mappings.f.m = ['Unite output:message',
|
||||||
|
\ 'fuzzy find message',
|
||||||
|
\ [
|
||||||
|
\ '[Leader f m] is to fuzzy find message',
|
||||||
|
\ '',
|
||||||
|
\ 'Definition: ' . s:file . ':' . lnum,
|
||||||
|
\ ]
|
||||||
|
\ ]
|
||||||
|
nnoremap <silent> <Leader>fq
|
||||||
|
\ :<C-u>Unite quickfix<CR>
|
||||||
|
let lnum = expand('<slnum>') + s:unite_lnum - 4
|
||||||
|
let g:_spacevim_mappings.f.q = ['Unite quickfix',
|
||||||
|
\ 'fuzzy find quickfix list',
|
||||||
|
\ [
|
||||||
|
\ '[Leader f q] is to fuzzy find quickfix list',
|
||||||
|
\ '',
|
||||||
|
\ 'Definition: ' . s:file . ':' . lnum,
|
||||||
|
\ ]
|
||||||
|
\ ]
|
||||||
|
nnoremap <silent> <Leader>fo :<C-u>Unite -buffer-name=outline
|
||||||
|
\ -start-insert -auto-preview -split outline<CR>
|
||||||
|
let lnum = expand('<slnum>') + s:unite_lnum - 4
|
||||||
|
let g:_spacevim_mappings.f.o = ['Unite outline',
|
||||||
|
\ 'fuzzy find outline',
|
||||||
|
\ [
|
||||||
|
\ '[Leader f o] is to fuzzy find outline',
|
||||||
|
\ '',
|
||||||
|
\ 'Definition: ' . s:file . ':' . lnum,
|
||||||
|
\ ]
|
||||||
|
\ ]
|
||||||
|
call SpaceVim#mapping#space#def('nnoremap', ['T', 's'], 'Unite colorscheme', 'unite-colorschemes', 1)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:run_shell_cmd() abort
|
function! s:run_shell_cmd() abort
|
||||||
let cmd = input('Please input shell command:', '', 'customlist,SpaceVim#plugins#bashcomplete#complete')
|
let cmd = input('Please input shell command:', '', 'customlist,SpaceVim#plugins#bashcomplete#complete')
|
||||||
if !empty(cmd)
|
if !empty(cmd)
|
||||||
|
@ -7,57 +7,6 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
|
|
||||||
let s:file = expand('<sfile>:~')
|
let s:file = expand('<sfile>:~')
|
||||||
|
|
||||||
function! SpaceVim#mapping#leader#defindglobalMappings() abort
|
|
||||||
if g:spacevim_enable_insert_leader
|
|
||||||
inoremap <silent> <Leader><Tab> <C-r>=MyLeaderTabfunc()<CR>
|
|
||||||
endif
|
|
||||||
|
|
||||||
" yark and paste
|
|
||||||
xnoremap <Leader>y "+y
|
|
||||||
xnoremap <Leader>d "+d
|
|
||||||
nnoremap <Leader>p "+p
|
|
||||||
nnoremap <Leader>P "+P
|
|
||||||
xnoremap <Leader>p "+p
|
|
||||||
xnoremap <Leader>P "+P
|
|
||||||
|
|
||||||
cnoremap <Leader><C-F> <C-F>
|
|
||||||
|
|
||||||
" Location list movement
|
|
||||||
let g:_spacevim_mappings.l = {'name' : '+Location movement'}
|
|
||||||
call SpaceVim#mapping#def('nnoremap', '<Leader>lj', ':lnext<CR>',
|
|
||||||
\ 'Jump to next location list position',
|
|
||||||
\ 'lnext',
|
|
||||||
\ 'Next location list')
|
|
||||||
call SpaceVim#mapping#def('nnoremap', '<Leader>lk', ':lprev<CR>',
|
|
||||||
\ 'Jump to previous location list position',
|
|
||||||
\ 'lprev',
|
|
||||||
\ 'Previous location list')
|
|
||||||
call SpaceVim#mapping#def('nnoremap', '<Leader>lq', ':lclose<CR>',
|
|
||||||
\ 'Close the window showing the location list',
|
|
||||||
\ 'lclose',
|
|
||||||
\ 'Close location list window')
|
|
||||||
|
|
||||||
" quickfix list movement
|
|
||||||
let g:_spacevim_mappings.q = {'name' : '+Quickfix movement'}
|
|
||||||
call SpaceVim#mapping#def('nnoremap', '<Leader>qj', ':cnext<CR>',
|
|
||||||
\ 'Jump to next quickfix list position',
|
|
||||||
\ 'cnext',
|
|
||||||
\ 'Next quickfix list')
|
|
||||||
call SpaceVim#mapping#def('nnoremap', '<Leader>qk', ':cprev<CR>',
|
|
||||||
\ 'Jump to previous quickfix list position',
|
|
||||||
\ 'cprev',
|
|
||||||
\ 'Previous quickfix list')
|
|
||||||
call SpaceVim#mapping#def('nnoremap', '<Leader>qq', ':cclose<CR>',
|
|
||||||
\ 'Close quickfix list window',
|
|
||||||
\ 'cclose',
|
|
||||||
\ 'Close quickfix list window')
|
|
||||||
call SpaceVim#mapping#def('nnoremap <silent>', '<Leader>qr', 'q',
|
|
||||||
\ 'Toggle recording',
|
|
||||||
\ '',
|
|
||||||
\ 'Toggle recording mode')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
let s:lnum = expand('<slnum>') + 3
|
let s:lnum = expand('<slnum>') + 3
|
||||||
function! SpaceVim#mapping#leader#defindWindowsLeader(key) abort
|
function! SpaceVim#mapping#leader#defindWindowsLeader(key) abort
|
||||||
if !empty(a:key)
|
if !empty(a:key)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
nmap <leader>sf <Plug>CtrlSFPrompt
|
" nmap <leader>sf <Plug>CtrlSFPrompt
|
||||||
vmap <leader>sf <Plug>CtrlSFVwordPath
|
" vmap <leader>sf <Plug>CtrlSFVwordPath
|
||||||
vmap <leader>sF <Plug>CtrlSFVwordExec
|
" vmap <leader>sF <Plug>CtrlSFVwordExec
|
||||||
nmap <leader>sp <Plug>CtrlSFPwordPath
|
" nmap <leader>sp <Plug>CtrlSFPwordPath
|
||||||
nnoremap <leader>so :CtrlSFOpen<CR>
|
" nnoremap <leader>so :CtrlSFOpen<CR>
|
||||||
nnoremap <leader>st :CtrlSFToggle<CR>
|
" nnoremap <leader>st :CtrlSFToggle<CR>
|
||||||
inoremap <leader>st <Esc>:CtrlSFToggle<CR>
|
" inoremap <leader>st <Esc>:CtrlSFToggle<CR>
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
"nnoremap <leader>gd :execute 'Unite -auto-preview -start-insert -no-split gtags/def:'.expand('<cword>')<CR>
|
"nnoremap <leader>gd :execute 'Unite -auto-preview -start-insert -no-split gtags/def:'.expand('<cword>')<CR>
|
||||||
"nnoremap <leader>gc :execute 'Unite -auto-preview -start-insert -no-split gtags/context'<CR>
|
"nnoremap <leader>gc :execute 'Unite -auto-preview -start-insert -no-split gtags/context'<CR>
|
||||||
nnoremap <leader>gr :execute 'Unite -auto-preview -start-insert -no-split gtags/ref'<CR>
|
" nnoremap <leader>gr :execute 'Unite -auto-preview -start-insert -no-split gtags/ref'<CR>
|
||||||
nnoremap <leader>gg :execute 'Unite -auto-preview -start-insert -no-split gtags/grep'<CR>
|
" nnoremap <leader>gg :execute 'Unite -auto-preview -start-insert -no-split gtags/grep'<CR>
|
||||||
"nnoremap <leader>gp :execute 'Unite -auto-preview -start-insert -no-split gtags/completion'<CR>
|
"nnoremap <leader>gp :execute 'Unite -auto-preview -start-insert -no-split gtags/completion'<CR>
|
||||||
vnoremap <leader>gd <ESC>:execute 'Unite -auto-preview -start-insert -no-split gtags/def:'.GetVisualSelection()<CR>
|
" vnoremap <leader>gd <ESC>:execute 'Unite -auto-preview -start-insert -no-split gtags/def:'.GetVisualSelection()<CR>
|
||||||
let g:unite_source_gtags_project_config = get(g:, 'unite_source_gtags_project_config', {
|
" let g:unite_source_gtags_project_config = get(g:, 'unite_source_gtags_project_config', {
|
||||||
\ '_': { 'treelize': 0 }
|
" \ '_': { 'treelize': 0 }
|
||||||
\ })
|
" \ })
|
||||||
|
|
||||||
" vim:set et sw=2:
|
" vim:set et sw=2:
|
||||||
|
@ -27,10 +27,5 @@ endfunction
|
|||||||
function! g:ref_source_webdict_sites.wiki.filter(output)
|
function! g:ref_source_webdict_sites.wiki.filter(output)
|
||||||
return join(split(a:output, "\n")[17 :], "\n")
|
return join(split(a:output, "\n")[17 :], "\n")
|
||||||
endfunction
|
endfunction
|
||||||
nnoremap <Leader>rj :<C-u>Ref webdict je<Space>
|
|
||||||
nnoremap <Leader>re :<C-u>Ref webdict ej<Space>
|
|
||||||
nnoremap <Leader>rc :<C-u>Ref webdict cn<Space>
|
|
||||||
nnoremap <Leader>rw :<C-u>Ref webdict wikipedia:en<Space>
|
|
||||||
nnoremap <Leader>rb :<C-u>Ref webdict bing<Space>
|
|
||||||
|
|
||||||
" vim:set et sw=2:
|
" vim:set et sw=2:
|
||||||
|
@ -1 +1 @@
|
|||||||
nmap <silent><leader>sn <Plug>CtrlSFCwordExec
|
" nmap <silent><leader>sn <Plug>CtrlSFCwordExec
|
||||||
|
@ -17,29 +17,15 @@ This is a fuzzy finder layer for SpaceVim, and it is based on unite.vim. In Spac
|
|||||||
|
|
||||||
## Key bindings
|
## Key bindings
|
||||||
|
|
||||||
| Key | Mode | Action |
|
| Key bindings | Discription |
|
||||||
| ------------------- | :-----------: | ---------------------------------------------------------- |
|
| -------------------- | ----------------------------- |
|
||||||
| `[unite]`+`r` | Normal | Resumes Unite window |
|
| `<Leader> f <space>` | Fuzzy find menu:CustomKeyMaps |
|
||||||
| `[unite]`+`f` | Normal | Opens Unite file recursive search |
|
| `<Leader> f e` | Fuzzy find register |
|
||||||
| `[unite]`+`i` | Normal | Opens Unite git file search |
|
| `<Leader> f f` | Fuzzy find file |
|
||||||
| `[unite]`+`g` | Normal | Opens Unite grep with ag (the_silver_searcher) |
|
| `<Leader> f h` | Fuzzy find history/yank |
|
||||||
| `[unite]`+`u` | Normal | Opens Unite source |
|
| `<Leader> f j` | Fuzzy find jump, change |
|
||||||
| `[unite]`+`t` | Normal | Opens Unite tag |
|
| `<Leader> f l` | Fuzzy find location list |
|
||||||
| `[unite]`+`T` | Normal | Opens Unite tag/include |
|
| `<Leader> f m` | Fuzzy find output messages |
|
||||||
| `[unite]`+`l` | Normal | Opens Unite location list |
|
| `<Leader> f o` | Fuzzy find outline |
|
||||||
| `[unite]`+`q` | Normal | Opens Unite quick fix |
|
| `<Leader> f q` | Fuzzy find quick fix |
|
||||||
| `[unite]`+`e` | Normal | Opens Unite register |
|
| `<Leader> f r` | Resumes Unite window |
|
||||||
| `[unite]`+`j` | Normal | Opens Unite jump, change |
|
|
||||||
| `[unite]`+`h` | Normal | Opens Unite history/yank |
|
|
||||||
| `[unite]`+`s` | Normal | Opens Unite session |
|
|
||||||
| `[unite]`+`n` | Normal | Opens Unite session/new |
|
|
||||||
| `[unite]`+`o` | Normal | Opens Unite outline |
|
|
||||||
| `[unite]`+`c` | Normal | Opens Unite buffer bookmark file in current directory |
|
|
||||||
| `[unite]`+`b` | Normal | Opens Unite buffer bookmark file in buffer directory |
|
|
||||||
| `[unite]`+`ma` | Normal | Opens Unite mapping |
|
|
||||||
| `[unite]`+`<space>` | Normal | Opens Unite menu:CustomKeyMaps |
|
|
||||||
| `[unite]`+`me` | Normal | Opens Unite output messages |
|
|
||||||
| `<leader>`+`bl` | Normal | Opens Unite buffers, mru, bookmark |
|
|
||||||
| `<leader>`+`ta` | Normal | Opens Unite tab |
|
|
||||||
| `<leader>`+`ugf` | Normal | Opens Unite file with word at cursor |
|
|
||||||
| `<leader>`+`ugt` | Normal/visual | Opens Unite tag with word at cursor |
|
|
||||||
|
Loading…
Reference in New Issue
Block a user