mirror of
https://github.com/junegunn/fzf.vim.git
synced 2026-09-20 18:53:12 +08:00
Compare commits
2
Commits
3ed6ac56d0
...
98dcd77a18
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98dcd77a18 | ||
|
|
a2ed9fb885 |
@@ -79,6 +79,7 @@ Commands
|
|||||||
| `:BTags [QUERY]` | Tags in the current buffer |
|
| `:BTags [QUERY]` | Tags in the current buffer |
|
||||||
| `:Changes` | Changelist across all open buffers |
|
| `:Changes` | Changelist across all open buffers |
|
||||||
| `:Marks` | Marks |
|
| `:Marks` | Marks |
|
||||||
|
| `:BMarks` | Marks in the current buffer |
|
||||||
| `:Jumps` | Jumps |
|
| `:Jumps` | Jumps |
|
||||||
| `:Windows` | Windows |
|
| `:Windows` | Windows |
|
||||||
| `:Locate PATTERN` | `locate` command output |
|
| `:Locate PATTERN` | `locate` command output |
|
||||||
|
|||||||
+17
-7
@@ -1008,7 +1008,7 @@ function! fzf#vim#grep2(command_prefix, query, ...)
|
|||||||
let name = join(words, '-')
|
let name = join(words, '-')
|
||||||
let fallback = s:is_win ? '' : ' || :'
|
let fallback = s:is_win ? '' : ' || :'
|
||||||
let opts = {
|
let opts = {
|
||||||
\ 'source': s:is_win ? 'cd .' : ':',
|
\ 'source': s:is_win ? 'cd .' : ':',
|
||||||
\ 'options': ['--ansi', '--prompt', toupper(name).'> ', '--query', a:query,
|
\ 'options': ['--ansi', '--prompt', toupper(name).'> ', '--query', a:query,
|
||||||
\ '--disabled',
|
\ '--disabled',
|
||||||
\ '--multi', '--bind', 'alt-a:select-all,alt-d:deselect-all',
|
\ '--multi', '--bind', 'alt-a:select-all,alt-d:deselect-all',
|
||||||
@@ -1362,15 +1362,25 @@ function! s:mark_sink(lines)
|
|||||||
execute 'normal! `'.matchstr(a:lines[1], '\S').'zz'
|
execute 'normal! `'.matchstr(a:lines[1], '\S').'zz'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! fzf#vim#marks(...)
|
function! fzf#vim#marks(...) abort
|
||||||
|
let [initial_marks, extra] = (a:0 && type(a:1) == type('')) ?
|
||||||
|
\ [a:1, a:000[1:]] : ['', a:000]
|
||||||
|
|
||||||
redir => cout
|
redir => cout
|
||||||
silent marks
|
execute 'silent! marks' initial_marks
|
||||||
redir END
|
redir END
|
||||||
|
|
||||||
let list = split(cout, "\n")
|
let list = split(cout, "\n")
|
||||||
|
|
||||||
|
" If first line is not the expected header, no marks found
|
||||||
|
if empty(list) || list[0] =~# '^E'
|
||||||
|
return s:warn('No marks found')
|
||||||
|
endif
|
||||||
|
|
||||||
return s:fzf('marks', {
|
return s:fzf('marks', {
|
||||||
\ 'source': extend(list[0:0], map(list[1:], 's:format_mark(v:val)')),
|
\ 'source': extend(list[0:0], map(list[1:], 's:format_mark(v:val)')),
|
||||||
\ 'sink*': s:function('s:mark_sink'),
|
\ 'sink*': s:function('s:mark_sink'),
|
||||||
\ '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> "'}, extra)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" ------------------------------------------------------------------
|
" ------------------------------------------------------------------
|
||||||
@@ -1420,9 +1430,9 @@ function! fzf#vim#jumps(...)
|
|||||||
let s:jump_current = pos
|
let s:jump_current = pos
|
||||||
let current = -pos-1
|
let current = -pos-1
|
||||||
return s:fzf('jumps', {
|
return s:fzf('jumps', {
|
||||||
\ 'source' : map(s:jumplist, 's:jump_format(v:val)'),
|
\ 'source': map(s:jumplist, 's:jump_format(v:val)'),
|
||||||
\ 'sink*' : s:function('s:jump_sink'),
|
\ 'sink*': s:function('s:jump_sink'),
|
||||||
\ 'options' : ['+m', '-x', '--ansi', '--tiebreak=index', '--cycle', '--scroll-off=999', '--sync', '--bind', 'start:pos('.current.')+offset-middle', '--tac', '--tiebreak=begin', '--prompt', 'Jumps> ', '--preview-window', '+{3}/2', '--tabstop=2', '--delimiter', '[:\s]+'],
|
\ 'options': ['+m', '-x', '--ansi', '--tiebreak=index', '--cycle', '--scroll-off=999', '--sync', '--bind', 'start:pos('.current.')+offset-middle', '--tac', '--tiebreak=begin', '--prompt', 'Jumps> ', '--preview-window', '+{3}/2', '--tabstop=2', '--delimiter', '[:\s]+'],
|
||||||
\ }, a:000)
|
\ }, a:000)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
+4
-3
@@ -1,4 +1,4 @@
|
|||||||
fzf-vim.txt fzf-vim Last change: March 3 2025
|
fzf-vim.txt fzf-vim Last change: June 8 2025
|
||||||
FZF-VIM - TABLE OF CONTENTS *fzf-vim* *fzf-vim-toc*
|
FZF-VIM - TABLE OF CONTENTS *fzf-vim* *fzf-vim-toc*
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
||||||
@@ -110,8 +110,8 @@ COMMANDS *fzf-vim-commands*
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
||||||
*:Files* *:GFiles* *:Buffers* *:Colors* *:Ag* *:Rg* *:RG* *:Lines* *:BLines* *:Tags* *:BTags*
|
*:Files* *:GFiles* *:Buffers* *:Colors* *:Ag* *:Rg* *:RG* *:Lines* *:BLines* *:Tags* *:BTags*
|
||||||
*:Changes* *:Marks* *:Jumps* *:Windows* *:Locate* *:History* *:Snippets* *:Commits* *:BCommits*
|
*:Changes* *:Marks* *:BMarks* *:Jumps* *:Windows* *:Locate* *:History* *:Snippets* *:Commits*
|
||||||
*:Commands* *:Maps* *:Helptags* *:Filetypes*
|
*:BCommits* *:Commands* *:Maps* *:Helptags* *:Filetypes*
|
||||||
|
|
||||||
-----------------------+--------------------------------------------------------------------------------------
|
-----------------------+--------------------------------------------------------------------------------------
|
||||||
Command | List ~
|
Command | List ~
|
||||||
@@ -130,6 +130,7 @@ COMMANDS *fzf-vim-commands*
|
|||||||
`:BTags [QUERY]` | Tags in the current buffer
|
`:BTags [QUERY]` | Tags in the current buffer
|
||||||
`:Changes` | Changelist across all open buffers
|
`:Changes` | Changelist across all open buffers
|
||||||
`:Marks` | Marks
|
`:Marks` | Marks
|
||||||
|
`:BMarks` | Marks in the current buffer
|
||||||
`:Jumps` | Jumps
|
`:Jumps` | Jumps
|
||||||
`:Windows` | Windows
|
`:Windows` | Windows
|
||||||
`:Locate PATTERN` | `locate` command output
|
`:Locate PATTERN` | `locate` command output
|
||||||
|
|||||||
+2
-1
@@ -67,7 +67,8 @@ call s:defs([
|
|||||||
\'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(fzf#vim#with_preview({ "placeholder": "{2..4}"}), <bang>0)',
|
\'command! -bar -bang Jumps call fzf#vim#jumps(fzf#vim#with_preview({ "placeholder": "{2..4}"}), <bang>0)',
|
||||||
\'command! -bar -bang Marks call fzf#vim#marks(<bang>0)',
|
\'command! -bar -bang -nargs=* Marks call fzf#vim#marks(<q-args>, <bang>0)',
|
||||||
|
\'command! -bar -bang -nargs=* BMarks call fzf#vim#marks("abcdefghijklmnopqrstuvwxyz", <bang>0)',
|
||||||
\'command! -bar -bang Changes call fzf#vim#changes(<bang>0)',
|
\'command! -bar -bang Changes call fzf#vim#changes(<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(fzf#vim#with_preview({ "placeholder": "{2}" }), <bang>0)',
|
\'command! -bar -bang Windows call fzf#vim#windows(fzf#vim#with_preview({ "placeholder": "{2}" }), <bang>0)',
|
||||||
|
|||||||
Reference in New Issue
Block a user