• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修订版adef1bf66b7076f04818738fef3fd21a7b53d965 (tree)
时间2023-05-05 19:01:14
作者Markus Prepens <markus.prepens@gmai...>
CommiterMarkus Prepens

Log Message

RgFiles accepts 2nd parameter

更改概述

差异

--- a/autoload/run.vim
+++ b/autoload/run.vim
@@ -118,10 +118,12 @@ export def CloseCb(ch: channel)
118118 popup_create(done_str, g:WinoptsDone())
119119 else
120120 var b = bufadd(d.name)
121+ lines = getbufinfo(b)[0].linecount
121122 execute "drop" d.name
122- setline(line("$") + 1, [d.full_cmd] + getbufline(d.bufnr, 1, "$"))
123- setlocal buftype=nofile nomodified
124-
123+ setlocal noreadonly
124+ setline(lines + 1, ['# ' .. d.full_cmd] + getbufline(d.bufnr, 1, "$"))
125+ setlocal buftype=nofile nomodified readonly
126+ setpos(".", [b, lines + 1, 0, 0])
125127 endif
126128
127129 execute "silent bwipe" d.bufnr
--- a/plugin/ripgrep.vim
+++ b/plugin/ripgrep.vim
@@ -2,12 +2,12 @@ vim9script
22 # Vim plugin FIF - find in files
33 # Description: Some minor extensions to run ripgrep or Windows own findstr.
44
5-import autoload "run.vim"
6-
75 if !executable("rg")
86 finish
97 endif
108
9+import autoload "run.vim"
10+
1111 g:rg_glob_patterns = {
1212 c: '-g *.c -g *.h -g *.850 -g *.s',
1313 cpp: '-tcpp -tc',
@@ -43,10 +43,10 @@ enddef
4343 set grepprg=rg\ --vimgrep\ $*
4444 set grepformat=%f:%l:%c:%m
4545
46-command! -complete=file -nargs=* RgFiles run.RunStart({cmd: "rg --files" .. g:RgGlobSwitch() .. join(split('<args>', " "), g:RgGlobSwitch() ), name: "RgFiles"})
46+command! -complete=file -nargs=* RgFiles run.RunStart({cmd: "rg --files" .. g:RgGlobSwitch() .. ' <args>', name: "RgFiles"})
4747 command! -complete=file -nargs=* Rg run.RunStart({cmd: 'rg --vimgrep ' .. ' <args> ' .. join(g:rg_paths, " "), regexp: &grepformat, no_popup: true})
4848
49-nnoremap <Leader>F :RgFiles **<Left>
49+nnoremap <Leader>F :RgFiles ** .<Left><Left><Left>
5050 nnoremap <Leader>R :Rg <C-r>=g:RgExcludes()<CR> <C-r>=RgIncludes(&ft)<CR> <C-r>=RgPattern()<CR>
5151 nnoremap <silent> <Leader>r :Rg <C-r>=g:RgExcludes()<CR> <C-r>=RgIncludes(&ft)<CR> <C-r>=RgPattern()<CR><CR>
5252