From dc23b36e30b420ea47f69de07fdf20e15f31079e Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Fri, 30 Mar 2018 21:27:59 +0800 Subject: [PATCH] Fix unite layer key bindings --- config/plugins/unite.vim | 35 ++++++++++++----------------------- docs/documentation.md | 26 ++++++++++++-------------- 2 files changed, 24 insertions(+), 37 deletions(-) diff --git a/config/plugins/unite.vim b/config/plugins/unite.vim index 6af95ac22..002626b32 100644 --- a/config/plugins/unite.vim +++ b/config/plugins/unite.vim @@ -269,27 +269,26 @@ function! s:unite_my_settings() " Play nice with supertab let b:SuperTabDisabled=1 + " Enable navigation with control-j and control-k in insert mode - imap (unite_select_next_line) - nmap (unite_select_next_line) + imap (unite_select_next_line) + nmap (unite_select_next_line) imap (unite_select_next_line) nmap (unite_select_next_line) - imap (unite_select_previous_line) - nmap (unite_select_previous_line) + imap (unite_select_previous_line) + nmap (unite_select_previous_line) imap (unite_select_previous_line) nmap (unite_select_previous_line) - - - imap jj (unite_insert_leave) - "imap (unite_delete_backward_path) - - imap j unite#smart_map('j', '') imap (unite_delete_backward_path) + imap j unite#smart_map('j', '') + + " Runs "split" action by . + imap unite#do_action('split') + nmap unite#do_action('split') + + imap ' (unite_quick_match_default_action) nmap ' (unite_quick_match_default_action) - imap x - \ unite#smart_map('x', "\(unite_quick_match_choose_action)") - nmap x (unite_quick_match_choose_action) nmap (unite_toggle_transpose_window) imap (unite_toggle_transpose_window) imap (unite_narrowing_path) @@ -298,23 +297,13 @@ function! s:unite_my_settings() imap (unite_toggle_auto_preview) nmap (unite_narrowing_input_history) imap (unite_narrowing_input_history) - nnoremap l - \ unite#smart_map('l', unite#do_action('default')) - let unite = unite#get_current_unite() if unite.profile_name ==# 'search' nnoremap r unite#do_action('replace') else nnoremap r unite#do_action('rename') endif - nnoremap cd unite#do_action('lcd') - nnoremap S unite#mappings#set_current_filters( - \ empty(unite#mappings#get_current_filters()) ? - \ ['sorter_reverse'] : []) - - " Runs "split" action by . - imap unite#do_action('split') endfunction " vim:set et sw=2 cc=80: diff --git a/docs/documentation.md b/docs/documentation.md index cc6d518ec..c4d51b57a 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -738,10 +738,15 @@ all source marked as `no` will roll back to unite extension. | key bindings | Mode | description | | --------------------- | ------ | ----------------------------------------- | -| `Tab`/`` | Insert | Select next line | -| `Shift + Tab`/`` | Insert | Select previous line | +| `Tab`/`` | - | Select next line | +| `Shift + Tab`/`` | - | Select previous line | | `jk` | Insert | Leave Insert mode (Only for denite/unite) | | `Ctrl`+`w` | Insert | Delete backward path | +| `Enter` | - | Run default action | +| `Ctrl`+`v` | - | Open in a split | +| `Ctrl`+`s` | - | Open in a vertical split | +| `Ctrl`+`t` | - | Open in a new tab | +| `Ctrl`+`g` | - | Exit unite | **Denite/Unite normal mode key bindings** @@ -751,11 +756,6 @@ all source marked as `no` will roll back to unite extension. | `Ctrl`+`l` | Normal | Redraw | | `Tab` | Normal | Select actions | | `Space` | Normal | Toggle mark current candidate, up | -| `Enter` | Normal | Run default action | -| `Ctrl`+`v` | Normal | Open in a split | -| `Ctrl`+`s` | Normal | Open in a vertical split | -| `Ctrl`+`t` | Normal | Open in a new tab | -| `Ctrl` + `g` | Normal | Exit unite | | `r` | Normal | Replace ('search' profile) or rename | | `Ctrl`+`z` | Normal/insert | Toggle transpose window | @@ -770,13 +770,11 @@ The prefix can be `[SPC]`, `[Window]`, `[denite]`, `` and `[unite]`. The default key of these prefix is: -| Prefix name | custom option and default value | description | -| ----------- | ------------------------------------------------------------------------ | ---------------------------------- | -| `[SPC]` | NONE / `` | default mapping prefix of SpaceVim | -| `[Window]` | `g:spacevim_windows_leader` / `s` | window mapping prefix of SpaceVim | -| `[denite]` | `g:spacevim_denite_leader` / `F` | denite mapping prefix of SpaceVim | -| `[unite]` | `g:spacevim_unite_leader` / `f` | unite mapping prefix of SpaceVim | -| `` | `mapleader` / `\` \| default leader prefix of vim/neovim | | +| Prefix name | custom option and default value | description | +| ----------- | --------------------------------- | ----------------------------------- | +| `[SPC]` | NONE / `` | default mapping prefix of SpaceVim | +| `[Window]` | `g:spacevim_windows_leader` / `s` | window mapping prefix of SpaceVim | +| `` | default vim leader | default leader prefix of vim/neovim | By default the guide buffer will be displayed 1000ms after the key has been pressed. You can change the delay by setting `'timeoutlen'` option to your liking (the value is in milliseconds).