mirror of
https://github.com/junegunn/fzf.vim.git
synced 2025-12-06 20:54:28 +08:00
@@ -76,6 +76,7 @@ Commands
|
|||||||
| `:Tags [QUERY]` | Tags in the project (`ctags -R`) |
|
| `:Tags [QUERY]` | Tags in the project (`ctags -R`) |
|
||||||
| `:BTags [QUERY]` | Tags in the current buffer |
|
| `:BTags [QUERY]` | Tags in the current buffer |
|
||||||
| `:Marks` | Marks |
|
| `:Marks` | Marks |
|
||||||
|
| `:Jumps` | Jumps |
|
||||||
| `:Windows` | Windows |
|
| `:Windows` | Windows |
|
||||||
| `:Locate PATTERN` | `locate` command output |
|
| `:Locate PATTERN` | `locate` command output |
|
||||||
| `:History` | `v:oldfiles` and open buffers |
|
| `:History` | `v:oldfiles` and open buffers |
|
||||||
|
|||||||
@@ -1169,6 +1169,47 @@ function! fzf#vim#marks(...)
|
|||||||
\ 'options': '+m -x --ansi --tiebreak=index --header-lines 1 --tiebreak=begin --prompt "Marks> "'}, a:000)
|
\ 'options': '+m -x --ansi --tiebreak=index --header-lines 1 --tiebreak=begin --prompt "Marks> "'}, a:000)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" ------------------------------------------------------------------
|
||||||
|
" Jumps
|
||||||
|
" ------------------------------------------------------------------
|
||||||
|
function! s:jump_format(line)
|
||||||
|
return substitute(a:line, '[0-9]\+', '\=s:yellow(submatch(0), "Number")', '')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:jump_sink(lines)
|
||||||
|
if len(a:lines) < 2
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
let cmd = s:action_for(a:lines[0])
|
||||||
|
if !empty(cmd)
|
||||||
|
execute 'silent' cmd
|
||||||
|
endif
|
||||||
|
let idx = index(s:jumplist, a:lines[1])
|
||||||
|
if idx == -1
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
let current = match(s:jumplist, '\v^\s*\>')
|
||||||
|
let delta = idx - current
|
||||||
|
if delta < 0
|
||||||
|
execute 'normal! ' . -delta . "\<C-O>"
|
||||||
|
else
|
||||||
|
execute 'normal! ' . delta . "\<C-I>"
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! fzf#vim#jumps(...)
|
||||||
|
redir => cout
|
||||||
|
silent jumps
|
||||||
|
redir END
|
||||||
|
let s:jumplist = split(cout, '\n')
|
||||||
|
let current = -match(s:jumplist, '\v^\s*\>')
|
||||||
|
return s:fzf('jumps', {
|
||||||
|
\ 'source' : extend(s:jumplist[0:0], map(s:jumplist[1:], 's:jump_format(v:val)')),
|
||||||
|
\ 'sink*' : s:function('s:jump_sink'),
|
||||||
|
\ 'options' : '+m -x --ansi --tiebreak=index --cycle --scroll-off 999 --sync --bind start:pos:'.current.' --tac --header-lines 1 --tiebreak=begin --prompt "Jumps> "',
|
||||||
|
\ }, a:000)
|
||||||
|
endfunction
|
||||||
|
|
||||||
" ------------------------------------------------------------------
|
" ------------------------------------------------------------------
|
||||||
" Help tags
|
" Help tags
|
||||||
" ------------------------------------------------------------------
|
" ------------------------------------------------------------------
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ COMMANDS *fzf-vim-commands*
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
||||||
*:Files* *:GFiles* *:Buffers* *:Colors* *:Ag* *:Rg* *:RG* *:Lines* *:BLines* *:Tags* *:BTags* *:Marks*
|
*:Files* *:GFiles* *:Buffers* *:Colors* *:Ag* *:Rg* *:RG* *:Lines* *:BLines* *:Tags* *:BTags* *:Marks*
|
||||||
*:Windows* *:Locate* *:History* *:Snippets* *:Commits* *:BCommits* *:Commands* *:Maps*
|
*:Jumps* *:Windows* *:Locate* *:History* *:Snippets* *:Commits* *:BCommits* *:Commands* *:Maps*
|
||||||
*:Helptags* *:Filetypes*
|
*:Helptags* *:Filetypes*
|
||||||
|
|
||||||
-----------------------+--------------------------------------------------------------------------------------
|
-----------------------+--------------------------------------------------------------------------------------
|
||||||
@@ -126,6 +126,7 @@ COMMANDS *fzf-vim-commands*
|
|||||||
`:Tags [QUERY]` | Tags in the project ( `ctags -R` )
|
`:Tags [QUERY]` | Tags in the project ( `ctags -R` )
|
||||||
`:BTags [QUERY]` | Tags in the current buffer
|
`:BTags [QUERY]` | Tags in the current buffer
|
||||||
`:Marks` | Marks
|
`:Marks` | Marks
|
||||||
|
`:Jumps` | Jumps
|
||||||
`:Windows` | Windows
|
`:Windows` | Windows
|
||||||
`:Locate PATTERN` | `locate` command output
|
`:Locate PATTERN` | `locate` command output
|
||||||
`:History` | `v:oldfiles` and open buffers
|
`:History` | `v:oldfiles` and open buffers
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ call s:defs([
|
|||||||
\'command! -bang -nargs=* BTags call fzf#vim#buffer_tags(<q-args>, fzf#vim#with_preview({ "placeholder": "{2}:{3..}" }), <bang>0)',
|
\'command! -bang -nargs=* BTags call fzf#vim#buffer_tags(<q-args>, fzf#vim#with_preview({ "placeholder": "{2}:{3..}" }), <bang>0)',
|
||||||
\'command! -bar -bang Snippets call fzf#vim#snippets(<bang>0)',
|
\'command! -bar -bang Snippets call fzf#vim#snippets(<bang>0)',
|
||||||
\'command! -bar -bang Commands call fzf#vim#commands(<bang>0)',
|
\'command! -bar -bang Commands call fzf#vim#commands(<bang>0)',
|
||||||
|
\'command! -bar -bang Jumps call fzf#vim#jumps(<bang>0)',
|
||||||
\'command! -bar -bang Marks call fzf#vim#marks(<bang>0)',
|
\'command! -bar -bang Marks call fzf#vim#marks(<bang>0)',
|
||||||
\'command! -bar -bang Helptags call fzf#vim#helptags(fzf#vim#with_preview({ "placeholder": "--tag {2}:{3}:{4}" }), <bang>0)',
|
\'command! -bar -bang Helptags call fzf#vim#helptags(fzf#vim#with_preview({ "placeholder": "--tag {2}:{3}:{4}" }), <bang>0)',
|
||||||
\'command! -bar -bang Windows call fzf#vim#windows(<bang>0)',
|
\'command! -bar -bang Windows call fzf#vim#windows(<bang>0)',
|
||||||
|
|||||||
Reference in New Issue
Block a user