Restore native Ctrl window keys (#38)

This commit is contained in:
m1ngsama 2026-05-13 13:56:28 +08:00 committed by GitHub
parent d03f7129d8
commit f278e9f3b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 6 additions and 13 deletions

View file

@ -92,7 +92,7 @@ Alt+j / Alt+k move line
## Navigate
```
Ctrl+h/j/k/l splits + tmux panes
<C-w>h/j/k/l splits
,h / ,l prev / next buffer
,z maximize window
,tv / ,th terminal

View file

@ -125,7 +125,7 @@ jk exit insert mode ,? cheat sheet
### Windows
`Ctrl+hjkl` navigate (+ tmux) | `,z` maximize | `,h` `,l` buffers | `,bd` close buffer | `,=` `,` resize | `,tv` `,th` terminal | `Esc Esc` exit terminal
`<C-w>hjkl` navigate | `,z` maximize | `,h` `,l` buffers | `,bd` close buffer | `,=` `,` resize | `,tv` `,th` terminal | `Esc Esc` exit terminal
### Markdown

View file

@ -86,15 +86,6 @@ command! -bang -nargs=* RgWord
\ .shellescape(expand('<cword>')), 1, s:Preview(), <bang>0)
command! -bang -nargs=? GFiles call fzf#vim#gitfiles(<q-args>, s:Preview(), <bang>0)
" ── Window Navigation ───────────────────────────────────────────────────────
if empty($TMUX)
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
endif
" ── Window Maximize Toggle ──────────────────────────────────────────────────
function! s:ToggleMaximize() abort

View file

@ -402,7 +402,7 @@ function! s:CheatSheet() abort
\ ' [x ]x conflict markers',
\ '',
\ ' ── windows ───────────────',
\ ' Ctrl+hjkl navigate splits',
\ ' <C-w>hjkl navigate splits',
\ ' ,h ,l prev / next buf',
\ ' ,bd close buffer',
\ ' ,z maximize toggle',

View file

@ -203,6 +203,7 @@ check_vim() {
XDG_CONFIG_HOME="$EMPTY_XDG" vim -u .vimrc -i NONE -es -N \
-c 'if maparg("0", "n") !=# "" || maparg("0", "v") !=# "" || maparg("Y", "n") !=# "" || maparg("Q", "n") !=# "" || maparg("<Space>", "n") !=# "" | cquit | endif' \
-c 'if maparg("<C-h>", "n") !=# "" || maparg("<C-j>", "n") !=# "" || maparg("<C-k>", "n") !=# "" || maparg("<C-l>", "n") !=# "" | cquit | endif' \
-c 'if maparg("<C-p>", "n") !=# "" | cquit | endif' \
-c 'if maparg(",ff", "n") !~# "SmartFiles" | cquit | endif' \
-c 'qa!' 2>&1
@ -266,7 +267,8 @@ check_vim() {
grep -Fq ',dd definition' "$TMP_ROOT/cheat-default.txt"
grep -Fq ',dk hover docs' "$TMP_ROOT/cheat-default.txt"
grep -Fq ',dp ,dn LSP diagnostics' "$TMP_ROOT/cheat-default.txt"
if grep -Eq 'Ctrl\\+p find file|gd definition|K hover docs|\\[g \\]g LSP diagnostics' "$TMP_ROOT/cheat-default.txt"; then
grep -Fq '<C-w>hjkl navigate splits' "$TMP_ROOT/cheat-default.txt"
if grep -Eq 'Ctrl\\+p find file|Ctrl\\+hjkl navigate splits|gd definition|K hover docs|\\[g \\]g LSP diagnostics' "$TMP_ROOT/cheat-default.txt"; then
cat "$TMP_ROOT/cheat-default.txt"
exit 1
fi