Vim 我可以为jumplist中的条目配置最大数量吗
我只想列出使用(:jumplist)时刚找到的最新运动位置(例如,10或更少),默认值100太大,我必须向下翻页到最新的位置。首先,没有命令Vim 我可以为jumplist中的条目配置最大数量吗,vim,vi,Vim,Vi,我只想列出使用(:jumplist)时刚找到的最新运动位置(例如,10或更少),默认值100太大,我必须向下翻页到最新的位置。首先,没有命令:jumplist,我想你的意思是:jumps 该设置没有选项。但您可以做的是,像往常一样执行:跳转,当显示“长”列表时,按G将进入最近的列表。这里是:Tail(以及相应的:Head)命令的定义,该命令允许您将任何Vim命令的输出限制为10行: :Tail jumps (showing only the last 10 jumps) 程序段 有了这个插件,
:jumplist
,我想你的意思是:jumps
该设置没有选项。但您可以做的是,像往常一样执行
:跳转,当显示“长”列表时,按G
将进入最近的列表。这里是:Tail
(以及相应的:Head
)命令的定义,该命令允许您将任何Vim命令的输出限制为10行:
:Tail jumps
(showing only the last 10 jumps)
程序段
有了这个插件,你甚至可以覆盖内置的:jumps
。我想说不。我快速浏览了一下帮助,最大值似乎固定在100。我没有看到任何改变的方法
":[N]Head {cmd} Show only the first 10 / [N] lines of {cmd}'s output.
":[N]Tail {cmd} Show only the last 10 / [N] lines of {cmd}'s output.
function! s:CaptureCommand( command )
redir => l:commandOutput
silent! execute a:command
redir END
redraw " This is necessary because of the :redir done earlier.
return split(l:commandOutput, "\n")
endfunction
function! s:Head( count, command )
let l:lines = s:CaptureCommand(a:command)
for l:line in l:lines[0:(a:count ? a:count : 10)]
echo l:line
endfor
endfunction
function! s:Tail( count, command )
let l:lines = s:CaptureCommand(a:command)
for l:line in l:lines[-1 * min([(a:count ? a:count : 10), len(l:lines)]):-1]
echo l:line
endfor
endfunction
command! -range=0 -nargs=+ Head call <SID>Head(<count>, <q-args>)
command! -range=0 -nargs=+ Tail call <SID>Tail(<count>, <q-args>)
command! -range=0 Jumps <count>Tail jumps