From ed51e65daf32170919413dcfdeedc9693357d160 Mon Sep 17 00:00:00 2001 From: Wang Shidong Date: Thu, 11 Apr 2019 11:28:50 +0800 Subject: [PATCH] Change home and end key in defx buffer (#2738) * Change home and end key in defx buffer * Add Ctrl-home key binding * Update doc --- config/plugins/defx.vim | 6 ++++-- docs/cn/documentation.md | 2 +- docs/documentation.md | 5 ++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/config/plugins/defx.vim b/config/plugins/defx.vim index 2b721cd46..48d2f1ad8 100644 --- a/config/plugins/defx.vim +++ b/config/plugins/defx.vim @@ -129,8 +129,10 @@ function! s:defx_init() \ defx#do_action('redraw') nnoremap \ defx#do_action('print') - nnoremap cd - \ defx#do_action('change_vim_cwd') + nnoremap :call cursor(2, 1) + nnoremap :call cursor(line('$'), 1) + nnoremap + \ defx#do_action('cd', SpaceVim#plugins#projectmanager#current_root()) endf " in this function we should vim-choosewin if possible diff --git a/docs/cn/documentation.md b/docs/cn/documentation.md index f8e2278fb..0d2618543 100644 --- a/docs/cn/documentation.md +++ b/docs/cn/documentation.md @@ -1097,7 +1097,7 @@ Buffer 操作相关快捷键都是以 `SPC b` 为前缀的: | `SPC f E` | open a file with elevated privileges (sudo edit)(TODO) | | `SPC f f` | 打开文件 | | `SPC f F` | 打开光标下的文件 | -| `SPC f o` | open a file using the default external program(TODO) | +| `SPC f o` | 代开文件树,并定位到当前文件 | | `SPC f R` | rename the current file(TODO) | | `SPC f s` | 保存文件 | | `SPC f S` | 保存所有文件 | diff --git a/docs/documentation.md b/docs/documentation.md index da26f1d9f..fa8e69c6c 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -1117,7 +1117,7 @@ Files manipulation commands (start with f): | `SPC f W` | save a file with elevated privileges (sudo layer) | | `SPC f f` | open file | | `SPC f F` | try to open the file under point | -| `SPC f o` | open a file using the default external program(TODO) | +| `SPC f o` | Find current file in file tree | | `SPC f R` | rename the current file(TODO) | | `SPC f s` | save a file | | `SPC f S` | save all files | @@ -1191,6 +1191,9 @@ 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 | +| `` | Jump to first line | +| `` | Jump to last line | +| `Ctrl-Home` | Switch to project root directory | | `Ctrl-r` | Redraw | ##### Open file with file tree.