From 6cb57388cc9f6d6f84eb59f477254b2115c7f877 Mon Sep 17 00:00:00 2001 From: Wang Shidong Date: Wed, 25 Sep 2019 12:22:24 +0800 Subject: [PATCH] Add keybinding for resize defx (#3084) --- config/plugins/defx.vim | 8 ++++ docs/cn/documentation.md | 2 + docs/documentation.md | 94 ++++++++++++++++++++-------------------- 3 files changed, 58 insertions(+), 46 deletions(-) diff --git a/config/plugins/defx.vim b/config/plugins/defx.vim index 15873f389..f3561507c 100644 --- a/config/plugins/defx.vim +++ b/config/plugins/defx.vim @@ -35,6 +35,10 @@ call defx#custom#column('icon', { \ 'root_icon': ' ', \ }) + call defx#custom#column('filename', { + \ 'max_width': -90, + \ }) + augroup vfinit au! autocmd FileType defx call s:defx_init() @@ -142,6 +146,10 @@ function! s:defx_init() nnoremap :call cursor(line('$'), 1) nnoremap \ defx#do_action('cd', SpaceVim#plugins#projectmanager#current_root()) + nnoremap > defx#do_action('resize', + \ defx#get_context().winwidth + 10) + nnoremap < defx#do_action('resize', + \ defx#get_context().winwidth - 10) endf " in this function we should vim-choosewin if possible diff --git a/docs/cn/documentation.md b/docs/cn/documentation.md index 47c1bae71..0c3de85cd 100644 --- a/docs/cn/documentation.md +++ b/docs/cn/documentation.md @@ -1176,6 +1176,8 @@ SpaceVim 的文件树提供了版本控制信息的接口,但是这一特性 | `p` | 预览文件 | | `i` | 切换至文件夹历史 | | `v` | 快速查看 | +| `>` | 放大文件树窗口宽度 | +| `<` | 缩小文件树窗口宽度 | | `g x` | 使用相关程序执行该文件 | | `'` | 标记光标下的文件(夹) | | `V` | 清除所有标记 | diff --git a/docs/documentation.md b/docs/documentation.md index 8cbb98797..671ea3422 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -1201,6 +1201,8 @@ Navigation is centered on the `hjkl` keys with the hope of providing a fast navi | `g x` | Execute with vimfiler associated | | `'` | Toggle mark current line | | `V` | Clear all marks | +| `>` | iecrease filetree screenwidth | +| `<` | dncrease filetree screenwidth | | `` | Jump to first line | | `` | Jump to last line | | `Ctrl-Home` | Switch to project root directory | @@ -1274,52 +1276,52 @@ which will tell you the functional of all mappings starting with `g`. After pressing prefix `z` in normal mode, if you do not remember the mappings, you will see the guide which will tell you the functional of all mappings starting with `z`. -| Key Bindings | Descriptions | -| ------------ | -------------------------------------------- | -| `z ` | scroll screen N characters to left | -| `z +` | cursor to screen top line N | -| `z -` | cursor to screen bottom line N | -| `z .` | cursor line to center | -| `z ` | cursor line to top | -| `z =` | spelling suggestions | -| `z A` | toggle folds recursively | -| `z C` | close folds recursively | -| `z D` | delete folds recursively | -| `z E` | eliminate all folds | -| `z F` | create a fold for N lines | -| `z G` | mark good spelled (update internal wordlist) | -| `z H` | scroll half a screenwidth to the right | -| `z L` | scroll half a screenwidth to the left | -| `z M` | set `foldlevel` to zero | -| `z N` | set `foldenable` | -| `z O` | open folds recursively | -| `z R` | set `foldlevel` to deepest fold | -| `z W` | mark wrong spelled (update internal wordlist)| -| `z X` | re-apply `foldlevel` | -| `z ^` | cursor to screen bottom line N | -| `z a` | toggle a fold | -| `z b` | redraw, cursor line at bottom | -| `z c` | close a fold | -| `z d` | delete a fold | -| `z e` | right scroll horizontally to cursor position | -| `z f` | create a fold for motion | -| `z g` | mark good spelled | -| `z h` | scroll screen N characters to right | -| `z i` | toggle foldenable | -| `z j` | mode to start of next fold | -| `z k` | mode to end of previous fold | -| `z l` | scroll screen N characters to left | -| `z m` | subtract one from `foldlevel` | -| `z n` | reset `foldenable` | -| `z o` | open fold | -| `z r` | add one to `foldlevel` | -| `z s` | left scroll horizontally to cursor position | -| `z t` | cursor line at top of window | -| `z v` | open enough folds to view cursor line | -| `z w` | mark wrong spelled | -| `z x` | re-apply foldlevel and do "zV" | -| `z z` | smart scroll | -| `z ` | scroll screen N characters to right | +| Key Bindings | Descriptions | +| ------------ | --------------------------------------------- | +| `z ` | scroll screen N characters to left | +| `z +` | cursor to screen top line N | +| `z -` | cursor to screen bottom line N | +| `z .` | cursor line to center | +| `z ` | cursor line to top | +| `z =` | spelling suggestions | +| `z A` | toggle folds recursively | +| `z C` | close folds recursively | +| `z D` | delete folds recursively | +| `z E` | eliminate all folds | +| `z F` | create a fold for N lines | +| `z G` | mark good spelled (update internal wordlist) | +| `z H` | scroll half a screenwidth to the right | +| `z L` | scroll half a screenwidth to the left | +| `z M` | set `foldlevel` to zero | +| `z N` | set `foldenable` | +| `z O` | open folds recursively | +| `z R` | set `foldlevel` to deepest fold | +| `z W` | mark wrong spelled (update internal wordlist) | +| `z X` | re-apply `foldlevel` | +| `z ^` | cursor to screen bottom line N | +| `z a` | toggle a fold | +| `z b` | redraw, cursor line at bottom | +| `z c` | close a fold | +| `z d` | delete a fold | +| `z e` | right scroll horizontally to cursor position | +| `z f` | create a fold for motion | +| `z g` | mark good spelled | +| `z h` | scroll screen N characters to right | +| `z i` | toggle foldenable | +| `z j` | mode to start of next fold | +| `z k` | mode to end of previous fold | +| `z l` | scroll screen N characters to left | +| `z m` | subtract one from `foldlevel` | +| `z n` | reset `foldenable` | +| `z o` | open fold | +| `z r` | add one to `foldlevel` | +| `z s` | left scroll horizontally to cursor position | +| `z t` | cursor line at top of window | +| `z v` | open enough folds to view cursor line | +| `z w` | mark wrong spelled | +| `z x` | re-apply foldlevel and do "zV" | +| `z z` | smart scroll | +| `z ` | scroll screen N characters to right | ### Searching