1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-04-13 15:09:09 +08:00

Add SPC w f for toggle follow mode (#4201)

This commit is contained in:
Wang Shidong 2021-04-12 23:02:09 +08:00 committed by GitHub
parent 7364584d31
commit e32b57446f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 16 deletions

View File

@ -79,6 +79,16 @@ function! SpaceVim#mapping#space#init() abort
\ ]
\ , 1)
let s:lnum = expand('<slnum>') + s:funcbeginline
call SpaceVim#mapping#space#def('nnoremap', ['w', 'f'], 'setlocal scrollbind!',
\ ['toggle-follow-mode',
\ [
\ '[SPC w f] is to toggle follow mode',
\ '',
\ 'Definition: ' . s:file . ':' . s:lnum,
\ ]
\ ]
\ , 1)
let s:lnum = expand('<slnum>') + s:funcbeginline
call SpaceVim#mapping#space#def('nnoremap', ['w', 'D'], 'ChooseWin | close | wincmd w',
\ ['delete-window-(other-windows)',
\ [
@ -89,27 +99,27 @@ function! SpaceVim#mapping#space#init() abort
\ ]
\ , 1)
let s:lnum = expand('<slnum>') + s:funcbeginline
call SpaceVim#mapping#space#def('nnoremap', ['w', 'f'], 'tabnew',
call SpaceVim#mapping#space#def('nnoremap', ['w', 'F'], 'tabnew',
\ ['create-new-tab',
\ [
\ '[SPC w f] is to create new tab',
\ '',
\ 'Definition: ' . s:file . ':' . s:lnum,
\ ]
\ ]
\ , 1)
let s:lnum = expand('<slnum>') + s:funcbeginline
call SpaceVim#mapping#space#def('nnoremap', ['w', 'F'], 'call call('
\ . string(function('s:create_new_named_tab'))
\ . ', [])',
\ ['create-new-named-tab',
\ [
\ '[SPC w F] is to create new named tab',
\ '[SPC w F] is to create new tab',
\ '',
\ 'Definition: ' . s:file . ':' . s:lnum,
\ ]
\ ]
\ , 1)
" let s:lnum = expand('<slnum>') + s:funcbeginline
" call SpaceVim#mapping#space#def('nnoremap', ['w', 'F'], 'call call('
" \ . string(function('s:create_new_named_tab'))
" \ . ', [])',
" \ ['create-new-named-tab',
" \ [
" \ '[SPC w F] is to create new named tab',
" \ '',
" \ 'Definition: ' . s:file . ':' . s:lnum,
" \ ]
" \ ]
" \ , 1)
let s:lnum = expand('<slnum>') + s:funcbeginline
call SpaceVim#mapping#space#def('nnoremap', ['w', 'h'], 'wincmd h',
\ ['window-left',

View File

@ -1212,6 +1212,7 @@ SpaceVim 选项 `window_leader` 的值来设为其它按键:
| `SPC w C` | 选择某一个窗口,并且进入阅读模式 (需要 tools 模块) |
| `SPC w d` | 删除一个窗口 |
| `SPC w D` | 选择一个窗口并关闭 |
| `SPC w f` | 切换同步滚屏 |
| `SPC w F` | 新建一个新的标签页 |
| `SPC w h` | 移至左边窗口 |
| `SPC w H` | 将窗口向左移动 |

View File

@ -1294,8 +1294,8 @@ Windows manipulation commands (start with `w`):
| `SPC w D` | delete another window using vim-choosewin |
| `SPC u SPC w D` | delete another window and its current buffer using vim-choosewin (TODO) |
| `SPC w t` | toggle window dedication (dedicated window cannot be reused by a mode) (TODO) |
| `SPC w f` | toggle follow mode (TODO) |
| `SPC w F` | create new tab(frame) |
| `SPC w f` | toggle follow mode |
| `SPC w F` | create new tab |
| `SPC w h` | move to window on the left |
| `SPC w H` | move window to the left |
| `SPC w j` | move to window below |