mirror of
https://github.com/junegunn/fzf.vim.git
synced 2025-12-06 12:44:24 +08:00
Compare commits
5 Commits
c16b8e38ef
...
d67fb168dc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d67fb168dc | ||
|
|
6cda389bde | ||
|
|
b3a49d7993 | ||
|
|
80d1cc2e68 | ||
|
|
d83bef041e |
18
README.md
18
README.md
@@ -1,21 +1,3 @@
|
|||||||
<div align="center">
|
|
||||||
<sup>Special thanks to:</sup>
|
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
<a href="https://warp.dev/?utm_source=github&utm_medium=referral&utm_campaign=fzfvim_20240209">
|
|
||||||
<div>
|
|
||||||
<img src="https://raw.githubusercontent.com/junegunn/i/master/warp.png" width="300" alt="Warp">
|
|
||||||
</div>
|
|
||||||
<b>Warp is a modern, Rust-based terminal with AI built in so you and your team can build great software, faster.</b>
|
|
||||||
<div>
|
|
||||||
<sup>Visit warp.dev to learn more.</sup>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
<br>
|
|
||||||
<hr>
|
|
||||||
</div>
|
|
||||||
<br>
|
|
||||||
|
|
||||||
fzf :heart: vim
|
fzf :heart: vim
|
||||||
===============
|
===============
|
||||||
|
|
||||||
|
|||||||
@@ -421,8 +421,17 @@ endfunction
|
|||||||
function! fzf#vim#_uniq(list)
|
function! fzf#vim#_uniq(list)
|
||||||
let visited = {}
|
let visited = {}
|
||||||
let ret = []
|
let ret = []
|
||||||
|
if exists("g:fzf_history_files_ignored") == 0
|
||||||
|
let g:fzf_history_files_ignored = []
|
||||||
|
endif
|
||||||
for l in a:list
|
for l in a:list
|
||||||
if !empty(l) && !has_key(visited, l)
|
let skip = 0
|
||||||
|
for i in g:fzf_history_files_ignored
|
||||||
|
if len(matchstr(l,i)) > 0
|
||||||
|
let skip=1
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
if !empty(l) && !has_key(visited, l) && skip == 0
|
||||||
call add(ret, l)
|
call add(ret, l)
|
||||||
let visited[l] = 1
|
let visited[l] = 1
|
||||||
endif
|
endif
|
||||||
@@ -455,7 +464,7 @@ function! fzf#vim#files(dir, ...)
|
|||||||
let dir = s:shortpath()
|
let dir = s:shortpath()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let args.options = ['-m', '--prompt', strwidth(dir) < &columns / 2 - 20 ? dir : '> ']
|
let args.options = ['--scheme', 'path', '-m', '--prompt', strwidth(dir) < &columns / 2 - 20 ? dir : '> ']
|
||||||
call s:merge_opts(args, s:conf('files_options', []))
|
call s:merge_opts(args, s:conf('files_options', []))
|
||||||
return s:fzf('files', args, a:000)
|
return s:fzf('files', args, a:000)
|
||||||
endfunction
|
endfunction
|
||||||
@@ -748,7 +757,7 @@ function! fzf#vim#gitfiles(args, ...)
|
|||||||
return s:fzf('gfiles', {
|
return s:fzf('gfiles', {
|
||||||
\ 'source': source,
|
\ 'source': source,
|
||||||
\ 'dir': root,
|
\ 'dir': root,
|
||||||
\ 'options': '-m --read0 --prompt "GitFiles> "'
|
\ 'options': '--scheme path -m --read0 --prompt "GitFiles> "'
|
||||||
\}, a:000)
|
\}, a:000)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -766,7 +775,7 @@ function! fzf#vim#gitfiles(args, ...)
|
|||||||
let wrapped = fzf#wrap({
|
let wrapped = fzf#wrap({
|
||||||
\ 'source': prefix . '-c color.status=always status --short --untracked-files=all',
|
\ 'source': prefix . '-c color.status=always status --short --untracked-files=all',
|
||||||
\ 'dir': root,
|
\ 'dir': root,
|
||||||
\ 'options': ['--ansi', '--multi', '--nth', '2..,..', '--tiebreak=index', '--prompt', 'GitFiles?> ', '--preview', preview]
|
\ 'options': ['--scheme', 'path', '--ansi', '--multi', '--nth', '2..,..', '--tiebreak=index', '--prompt', 'GitFiles?> ', '--preview', preview]
|
||||||
\})
|
\})
|
||||||
call s:remove_layout(wrapped)
|
call s:remove_layout(wrapped)
|
||||||
let wrapped.common_sink = remove(wrapped, 'sink*')
|
let wrapped.common_sink = remove(wrapped, 'sink*')
|
||||||
@@ -856,7 +865,7 @@ function! fzf#vim#buffers(...)
|
|||||||
return s:fzf('buffers', {
|
return s:fzf('buffers', {
|
||||||
\ 'source': map(sorted, 'fzf#vim#_format_buffer(v:val)'),
|
\ 'source': map(sorted, 'fzf#vim#_format_buffer(v:val)'),
|
||||||
\ 'sink*': s:function('s:bufopen'),
|
\ 'sink*': s:function('s:bufopen'),
|
||||||
\ 'options': ['+m', '-x', '--tiebreak=index', header_lines, '--ansi', '-d', '\t', '--with-nth', '3..', '-n', '2,1..2', '--prompt', 'Buf> ', '--query', query, '--preview-window', '+{2}-/2', '--tabstop', tabstop]
|
\ 'options': ['+m', '-x', '--tiebreak=index', header_lines, '--ansi', '-d', '\t', '--with-nth', '3..', '-n', '2,1..2', '--prompt', 'Buf> ', '--query', query, '--preview-window', '+{2}/2', '--tabstop', tabstop]
|
||||||
\}, args)
|
\}, args)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -965,7 +974,7 @@ function! fzf#vim#grep(grep_command, ...)
|
|||||||
let opts = {
|
let opts = {
|
||||||
\ 'options': ['--ansi', '--prompt', capname.'> ',
|
\ 'options': ['--ansi', '--prompt', capname.'> ',
|
||||||
\ '--multi', '--bind', 'alt-a:select-all,alt-d:deselect-all',
|
\ '--multi', '--bind', 'alt-a:select-all,alt-d:deselect-all',
|
||||||
\ '--delimiter', ':', '--preview-window', '+{2}-/2']
|
\ '--delimiter', ':', '--preview-window', '+{2}/2']
|
||||||
\}
|
\}
|
||||||
if len(args) && type(args[0]) == s:TYPE.bool
|
if len(args) && type(args[0]) == s:TYPE.bool
|
||||||
call remove(args, 0)
|
call remove(args, 0)
|
||||||
@@ -1005,7 +1014,7 @@ function! fzf#vim#grep2(command_prefix, query, ...)
|
|||||||
\ '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',
|
||||||
\ '--delimiter', ':', '--preview-window', '+{2}-/2']
|
\ '--delimiter', ':', '--preview-window', '+{2}/2']
|
||||||
\}
|
\}
|
||||||
|
|
||||||
let [opts, suffix] = s:grep_multi_line(opts)
|
let [opts, suffix] = s:grep_multi_line(opts)
|
||||||
@@ -1082,7 +1091,7 @@ function! fzf#vim#buffer_tags(query, ...)
|
|||||||
return s:fzf('btags', {
|
return s:fzf('btags', {
|
||||||
\ 'source': s:btags_source(tag_cmds),
|
\ 'source': s:btags_source(tag_cmds),
|
||||||
\ 'sink*': s:function('s:btags_sink'),
|
\ 'sink*': s:function('s:btags_sink'),
|
||||||
\ 'options': s:reverse_list(['-m', '-d', '\t', '--with-nth', '1,4..', '-n', '1', '--prompt', 'BTags> ', '--query', a:query, '--preview-window', '+{3}-/2'])}, args)
|
\ 'options': s:reverse_list(['-m', '-d', '\t', '--with-nth', '1,4..', '-n', '1', '--prompt', 'BTags> ', '--query', a:query, '--preview-window', '+{3}/2'])}, args)
|
||||||
catch
|
catch
|
||||||
return s:warn(v:exception)
|
return s:warn(v:exception)
|
||||||
endtry
|
endtry
|
||||||
@@ -1415,7 +1424,7 @@ function! fzf#vim#jumps(...)
|
|||||||
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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user