From e628e1eebfdfece73b77a5d0ebfd4f6f436a7dc5 Mon Sep 17 00:00:00 2001 From: Wang Shidong Date: Thu, 14 Mar 2019 23:32:20 +0800 Subject: [PATCH] Change plugin list key binding (#2665) * Change plugin list key binding * Fix doc --- autoload/SpaceVim/layers/denite.vim | 10 +++++ autoload/SpaceVim/layers/unite.vim | 10 +++++ autoload/SpaceVim/mapping/space.vim | 2 +- autoload/zvim/plug.vim | 2 - docs/cn/documentation.md | 57 ++++++++++++++--------------- docs/documentation.md | 1 - 6 files changed, 49 insertions(+), 33 deletions(-) diff --git a/autoload/SpaceVim/layers/denite.vim b/autoload/SpaceVim/layers/denite.vim index a5a571041..476faeeae 100644 --- a/autoload/SpaceVim/layers/denite.vim +++ b/autoload/SpaceVim/layers/denite.vim @@ -250,6 +250,16 @@ function! s:defind_fuzzy_finder() abort \ 'Definition: ' . s:file . ':' . lnum, \ ] \ ] + nnoremap fp :Denite menu:AddedPlugins + let lnum = expand('') + s:unite_lnum - 4 + let g:_spacevim_mappings.f.p = ['Denite menu:AddedPlugins', + \ 'fuzzy find vim packages', + \ [ + \ '[Leader f p] is to fuzzy find vim packages installed in SpaceVim', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] endfunction function! s:warp_denite(cmd) abort diff --git a/autoload/SpaceVim/layers/unite.vim b/autoload/SpaceVim/layers/unite.vim index a135a2297..e72e821a6 100644 --- a/autoload/SpaceVim/layers/unite.vim +++ b/autoload/SpaceVim/layers/unite.vim @@ -198,6 +198,16 @@ function! s:defind_fuzzy_finder() abort \ 'Definition: ' . s:file . ':' . lnum, \ ] \ ] + nnoremap fp :Unite menu:AddedPlugins + let lnum = expand('') + s:unite_lnum - 4 + let g:_spacevim_mappings.f.p = ['Unite menu:AddedPlugins', + \ 'fuzzy find vim packages', + \ [ + \ '[Leader f p] is to fuzzy find vim packages installed in SpaceVim', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] endfunction function! s:run_shell_cmd() abort diff --git a/autoload/SpaceVim/mapping/space.vim b/autoload/SpaceVim/mapping/space.vim index 6bf144530..be4f96476 100644 --- a/autoload/SpaceVim/mapping/space.vim +++ b/autoload/SpaceVim/mapping/space.vim @@ -21,7 +21,7 @@ function! SpaceVim#mapping#space#init() abort let g:_spacevim_mappings_space.j = {'name' : '+Jump/Join/Split'} let g:_spacevim_mappings_space.m = {'name' : '+Major-mode'} let g:_spacevim_mappings_space.w = {'name' : '+Windows'} - let g:_spacevim_mappings_space.p = {'name' : '+Projects'} + let g:_spacevim_mappings_space.p = {'name' : '+Projects/Packages'} let g:_spacevim_mappings_space.h = {'name' : '+Help'} let g:_spacevim_mappings_space.n = {'name' : '+Narrow/Numbers'} let g:_spacevim_mappings_space.q = {'name' : '+Quit'} diff --git a/autoload/zvim/plug.vim b/autoload/zvim/plug.vim index ac9af7973..1070f515b 100644 --- a/autoload/zvim/plug.vim +++ b/autoload/zvim/plug.vim @@ -88,8 +88,6 @@ function! zvim#plug#begin(path) abort \ 'All the Added plugins' \ . ' lp'} let g:unite_source_menu_menus.AddedPlugins.command_candidates = [] - nnoremap lp :Unite -silent - \ -winheight=17 -start-insert menu:AddedPlugins if g:spacevim_plugin_manager ==# 'neobundle' call neobundle#begin(a:path) elseif g:spacevim_plugin_manager ==# 'dein' diff --git a/docs/cn/documentation.md b/docs/cn/documentation.md index 03ab02e59..19ed3adb7 100644 --- a/docs/cn/documentation.md +++ b/docs/cn/documentation.md @@ -671,40 +671,39 @@ can be get by ` q r` | Key | Mode | Action | | --------------- | --------------------- | ------------------------------------------ | -| ``+`cd` | Normal | Switch to the directory of the open buffer | -| ``+`w` | Normal/Visual | Write (:w) | +| `SPC f s` | Normal/Visual | Write (:w) | | `Ctrl-s` | Normal/Visual/Command | Write (:w) | | `:w!!` | Command | Write as root (%!sudo tee > /dev/null %) | ### Editor UI -| Key | Mode | Action | -| ----------------------------------------------- | ------------- | ---------------------------------------------------------------- | -| `` | _All_ | Toggle tagbar | -| `` | _All_ | Toggle Vimfiler | -| `` + num | Normal | Jump to the buffer with the num index | -| `` + num | Normal | Jump to the buffer with the num index, this only works in Neovim | -| `Alt-h` / `` | Normal | Jump to left buffer in the tabline, this only works in Neovim | -| `Alt-l` / `` | Normal | Jump to Right buffer in the tabline, this only works in Neovim | -| ``+`ts` | Normal | Toggle spell-checker (:setlocal spell!) | -| ``+`tn` | Normal | Toggle line numbers (:setlocal nonumber!) | -| ``+`tl` | Normal | Toggle hidden characters (:setlocal nolist!) | -| ``+`th` | Normal | Toggle highlighted search (:set hlsearch!) | -| ``+`tw` | Normal | Toggle wrap (:setlocal wrap! breakindent!) | -| `g0` | Normal | Go to first tab (:tabfirst) | -| `g$` | Normal | Go to last tab (:tablast) | -| `gr` | Normal | Go to previous tab (:tabprevious) | -| `Ctrl-` | Normal | Move to split below (Ctrl-w j) | -| `Ctrl-` | Normal | Move to upper split (Ctrl-w k) | -| `Ctrl-` | Normal | Move to left split (Ctrl-w h) | -| `Ctrl-` | Normal | Move to right split (Ctrl-w l) | -| `*` | Visual | Search selection forwards | -| `#` | Visual | Search selection backwards | -| `,`` | Normal | Remove all spaces at EOL | -| `Ctrl-r` | Visual | Replace selection | -| ` l j` | Normal | Next on location list | -| ` l k` | Normal | Previous on location list | -| ` S` | Normal/Visual | Source selection | +| Key | Mode | Action | +| ------------------- | ------------- | ---------------------------------------------------------------- | +| `` | _All_ | Toggle tagbar | +| `` | _All_ | Toggle Vimfiler | +| `` + num | Normal | Jump to the buffer with the num index | +| `` + num | Normal | Jump to the buffer with the num index, this only works in Neovim | +| `Alt-h` / `` | Normal | Jump to left buffer in the tabline, this only works in Neovim | +| `Alt-l` / `` | Normal | Jump to Right buffer in the tabline, this only works in Neovim | +| ``+`ts` | Normal | Toggle spell-checker (:setlocal spell!) | +| ``+`tn` | Normal | Toggle line numbers (:setlocal nonumber!) | +| ``+`tl` | Normal | Toggle hidden characters (:setlocal nolist!) | +| ``+`th` | Normal | Toggle highlighted search (:set hlsearch!) | +| ``+`tw` | Normal | Toggle wrap (:setlocal wrap! breakindent!) | +| `g0` | Normal | Go to first tab (:tabfirst) | +| `g$` | Normal | Go to last tab (:tablast) | +| `gr` | Normal | Go to previous tab (:tabprevious) | +| `Ctrl-` | Normal | Move to split below (Ctrl-w j) | +| `Ctrl-` | Normal | Move to upper split (Ctrl-w k) | +| `Ctrl-` | Normal | Move to left split (Ctrl-w h) | +| `Ctrl-` | Normal | Move to right split (Ctrl-w l) | +| `*` | Visual | Search selection forwards | +| `#` | Visual | Search selection backwards | +| `, ` | Normal | Remove all spaces at EOL | +| `Ctrl-r` | Visual | Replace selection | +| ` l j` | Normal | Next on location list | +| ` l k` | Normal | Previous on location list | +| ` S` | Normal/Visual | Source selection | ### Native functions diff --git a/docs/documentation.md b/docs/documentation.md index 08a30fb8a..a851a67b9 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -697,7 +697,6 @@ can be get by ` q r`, if you want to disable this feature, you can use ` | Key Bindings | Descriptions | | -------------- | ------------------------------------------ | -| ` c d` | Switch to the directory of the open buffer | | `SPC f s` | Write (:w) | | `Ctrl-s` | Write (:w) | | `SPC f W` | Write as root (need sudo layer) |