mirror of
https://oauth2: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@github.com/m1ngsama/chopsticks.git
synced 2026-05-13 20:41:04 +08:00
Move file search to leader mapping (#36)
This commit is contained in:
parent
e1c2ea3888
commit
d03f7129d8
4 changed files with 7 additions and 4 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ function! s:SmartFiles() abort
|
|||
endfunction
|
||||
|
||||
if exists('g:plugs["fzf.vim"]')
|
||||
nnoremap <C-p> :call <SID>SmartFiles()<CR>
|
||||
nnoremap <leader>ff :call <SID>SmartFiles()<CR>
|
||||
nnoremap <leader>b :Buffers<CR>
|
||||
nnoremap <leader>rg :Rg<CR>
|
||||
nnoremap <leader>rG :RgWord<CR>
|
||||
|
|
|
|||
|
|
@ -326,7 +326,7 @@ function! s:CheatSheet() abort
|
|||
\ ' ─────────────────────────────',
|
||||
\ '',
|
||||
\ ' ── files ──────────────────',
|
||||
\ ' Ctrl+p find file',
|
||||
\ ' ,ff files',
|
||||
\ ' ,b buffers',
|
||||
\ ' ,rg grep project',
|
||||
\ ' ,rG grep word',
|
||||
|
|
|
|||
|
|
@ -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("<Space>", "n") !=# "" | cquit | endif' \
|
||||
-c 'if maparg("<C-p>", "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
|
||||
|
|
|
|||
Loading…
Reference in a new issue