From d03f7129d80e76805cbe987fdc2a063923186d5f Mon Sep 17 00:00:00 2001 From: m1ngsama Date: Wed, 13 May 2026 13:50:27 +0800 Subject: [PATCH] Move file search to leader mapping (#36) --- README.md | 2 +- modules/navigation.vim | 2 +- modules/tools.vim | 2 +- scripts/test.sh | 5 ++++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 317d923..4e29559 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,7 @@ jk exit insert mode ,? cheat sheet ### Files -`Ctrl+p` find | `,b` buffers | `,rg` grep | `,rG` grep word | `,fh` recent | `,fl` lines | `,e` browser | `,E` browser (file dir) | `,,` last file +`,ff` find | `,b` buffers | `,rg` grep | `,rG` grep word | `,fh` recent | `,fl` lines | `,e` browser | `,E` browser (file dir) | `,,` last file ### Code diff --git a/modules/navigation.vim b/modules/navigation.vim index b03dbe5..0841534 100644 --- a/modules/navigation.vim +++ b/modules/navigation.vim @@ -47,7 +47,7 @@ function! s:SmartFiles() abort endfunction if exists('g:plugs["fzf.vim"]') - nnoremap :call SmartFiles() + nnoremap ff :call SmartFiles() nnoremap b :Buffers nnoremap rg :Rg nnoremap rG :RgWord diff --git a/modules/tools.vim b/modules/tools.vim index 3ac843f..ae434c4 100644 --- a/modules/tools.vim +++ b/modules/tools.vim @@ -326,7 +326,7 @@ function! s:CheatSheet() abort \ ' ─────────────────────────────', \ '', \ ' ── files ──────────────────', - \ ' Ctrl+p find file', + \ ' ,ff files', \ ' ,b buffers', \ ' ,rg grep project', \ ' ,rG grep word', diff --git a/scripts/test.sh b/scripts/test.sh index 38d29f1..a9639f5 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -203,6 +203,8 @@ 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("", "n") !=# "" | cquit | endif' \ + -c 'if maparg("", "n") !=# "" | cquit | endif' \ + -c 'if maparg(",ff", "n") !~# "SmartFiles" | cquit | endif' \ -c 'qa!' 2>&1 XDG_CONFIG_HOME="$EMPTY_XDG" vim -u .vimrc -i NONE -es -N \ @@ -260,10 +262,11 @@ check_vim() { -c 'redir END' \ -c 'qa!' 2>&1 grep -Fq ':ChopsticksStatus check LSP setup' "$TMP_ROOT/cheat-default.txt" + grep -Fq ',ff files' "$TMP_ROOT/cheat-default.txt" 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 'gd definition|K hover docs|\\[g \\]g LSP diagnostics' "$TMP_ROOT/cheat-default.txt"; then + if grep -Eq 'Ctrl\\+p find file|gd definition|K hover docs|\\[g \\]g LSP diagnostics' "$TMP_ROOT/cheat-default.txt"; then cat "$TMP_ROOT/cheat-default.txt" exit 1 fi