junegunn / fzf.vim Goto Github PK
View Code? Open in Web Editor NEWfzf :heart: vim
License: MIT License
fzf :heart: vim
License: MIT License
Is it possible to supply additional arguments to :Ag
such as -Q
and -t
in order to search .gitignored files? I'm guessing that the source
dict key decides the source of :Ag
and that can't be modified.
https://github.com/junegunn/fzf.vim/blob/master/autoload/fzf/vim.vim#L404-L405
Do we have something automatically run "Files" on project root (if it has .git, .svn, etc), and yet act on current directory if it's not under a project.
Unite has a source called "UniteWithProjectDir", and I remember CtrlP has something similar too. Would be very convenient.
I'm using following vim's settings:
set tabstop=2
set softtabstop=2
set shiftwidth=2
set noexpandtab
set listchars=tab: ,trail:·,space:·,nbsp:·
But when I run :BLines
or :Lines
I can see that tab is expanded into 8 spaces which is pretty awful and it makes orientation among lines very hard for me.
Selecting a tag from Helptags
can fail if the tag is from a plugin that is not yet loaded.
I run ":Commands" and get something like
â~@~GBCommitsâ~@~G
for all the commands. It seems these are space characters. I am using "urxvt" terminal on Ubuntu. On my mac, it is ok and no such strange characters. I think maybe this is not an issue of fzf.vim, but some of my setting problem of urxvt. But I am not sure.
I use CTRL-D to exit prompts by habit.
This should be as easy asa simply changing the exec from tmux to screen. Could not find it in the documentation. I'd that supported?
Is it possible, while using :Files
, to create a new file ?
Rather than opening the file in the Window I call it from it opens them in my TagBar window.
Neovim release 0.1.0
Mac OS El Capitan
:BTags command gives this error
Vim(throw):E730: using List as a String
I've noticed a small annoyance with how FZF (and vim fuzzy file selectors in general) work. When I open a file, often I'll be reading the name of the file I want to open from a buffer. I'll split the window into two panes with Ctrl+w v
, then open FZF. FZF will create a new pane at the bottom of the screen, often pushing the text containing the name of the thing I want to open off the screen. It's not uncommon for me to forget what the last word or phrase of the filename I'm looking for is, close FZF, read the text again, then open FZF again. All the text moving around abruptly makes me go blank sometimes.
Is it possible to open FZF in the active pane, then put the selected buffer into the same pane?
Here's terrible ascii art kinda showing what I'm asking.
Initial editor pane state, the same buffer open in each pane, with the cursor in top pane.
+-----+
|1 |
+-----+
|1 |
| |
| |
+-----+
Now, I open FZF.
What happens now:
+-----+
|1 |
+-----+
|1 |
+-----|
|FZF |
+-----+
+-----+
|2 |
+-----+
|1 |
| |
| |
+-----+
Desired:
+-----+
|FZF |
+-----+
|1 |
| |
| |
+-----+
+-----+
|2 |
+-----+
|1 |
| |
| |
+-----+
When i run Tags
even if i have compiled the tags manualy or let the fzf create it, i have no results.
I am using vim in debian testing
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 17 2015 03:37:50)
Included patches: 1-826
When I run ":BTags" on a Java file, I got
check_webkit_exceptions_during_rendering f class:WebPageSnapshotter file: ..
check_resources_loaded_during_rendering f class:WebPageSnapshotter file: ..
checkWebkitExceptionsDuringRendering f class:WebPageSnapshotter file: ..
checkResourcesLoadedDuringRendering f class:WebPageSnapshotter file: ..
DEFAdateRenICE_SPEC f class:WebPageSnapshotter file: ..
check_webkit_exceptions_during_rendering f class:WebPageSnapshotter file: ..
checkWebkitExceptionsDuringRendering f class:WebPageSnapshotter file: ..
BNS_RESOLUTION_MILLIS f class:WebPageSnapshotter
> snapshotInternal m class:WebPageSnapshotter file: ..
1/33
BTags> inter
where I could only select the last one although there were 8 others display above it. There were also huge blank lines in the results. In this use case, what I wanted to select was the last one, so it is okay for now. But I think something is wrong.
How about command for fuzzy search in tabs?
Hello,
I want to use a custom Locate and I've managed with: command! -nargs=+ Locate call fzf#run({'source': 'locate -Ai -0 '.<q-args>.' | grep -z -vE "~$"', 'sink': 'e', 'options': '--read0 -0 -1 -m --prompt "Locate> "'})
.
That's fine but I'd also like to be able to use the special Ctrl-v/x/t
keys. I 've tried copying s:expect()
and others in after/plugin/fzf.vim
but without much success. Can you help. :)
Cheers
Only thing I miss from ctrlp.vim
plugin is the toggle selection feature using CTRL-Z
. Any chances to have that implemented?
Would it be possible to split your plugin in two -- async/sync core for nvim/vim/tmux with API to launch interactive commands and fzf built on top of that core?
Then core plugin would cover some neovim issues as introduce more relations with tmux.
At least it would allow to lauch zsh
instead of :shell
and ranger
for interactive file choosing (it's more slow than fzf for project dirs, but faster for systemwide jumping), as many other interactive commands similar to old good :!
, which neovim users currently lack of.
Currently I have extracted some of your code for zsh
and ranger
to fix my irritation from neovim, but it would be more appropriate to make such plugin by origin author.
Just dropping a suggestion to consider.
In CtrlP there is a useful option to navigate to already open buffer when selecting some file from CtrlPBuffer
(controlled by g:ctrlp_switch_buffer
and by cursory look executed here)
@junegunn Can you see a use case to have something similar implemented in fzf.vim's s:bufopen
?
This is about the only thing I miss from ag.vim, I used it often to search only sub-paths in my project. I looked at the fzf plugin source, doesn't look like it's there at the moment, would it be very difficult to add this?
One thing I like about this version is that I no longer have to include flags (like :Ag -Q "blah" web/server
) but as I see it that might make it difficult to pass it a path. Problem is that the search/reduce once the :Ag pane is open doesn't also search against the filename/path
EDIT: just an edit to say thanks so much for fzf and this plugin, which removed a lot of stuff from my vimrc :)
I am running the latest Neovim (NVIM 0.0.0-alpha+201509011923
), fzf, and fzf.vim. When I issue the commands History:
and History/
, the terminal pops up for less than a second and then vanishes. Almost all of the other commands work as expected (I've not tried Windows
or Marks
, since I don't typically use those features).
I've used the following minimal .nvimrc file to make sure that this wasn't an issue with a different setting:
call plug#begin('~/.cleanvim/plugged')
Plug 'junegunn/vim-peekaboo'
Plug 'junegunn/fzf.vim'
call plug#end()
set rtp+=~/.fzf
Select a bunch of files, open the first one and the second won't open because it's a relative path and the current working directory has changed. ag.vim handles this correctly somehow (remember the original directory in the quickfix window?).
This more or less asks for reverting this commit: ee79457
Or at least it would be nice to have a variant of Ag, that searches only the content of the files. Also, I'm not really interested.
Also, it would be nice to shorten the path of the file a little bit. My paths often span 80% of the entire screen. This makes it hard to see if the match is the one I looked for. For me, only showing the name of the file would probably enough.
Thanks for this plugin, it's great.
I'm here to make my usual request :) The plugin defines a bunch of commands like History
and Lines
. But for most users the "namespace pollution" is not worth it because fzf actions are generally bound to normal-mode commands.
For the case where a user wants to try something from the command line, "namespacing" helps the user discover the available commands. This can be done either by prefixing all fzf.vim commands (FzfLines
, FzfHistory
), or by having a single command that takes sub-commands (Fzf lines
, Fzf history
) similar to git
, hg
, etc.
I don't suggest wrapping the default commands in a if !exists('g:fzf_default_commands')
guard because that's lame. 😅
It would be nice to search the command line mode history.
Thanks!
Is it possible to hook up registers
as a source? I tried the following:
function! s:mycommand_sink(cmd)
let cmd = substitute(a:cmd, '\d..', '', 'g')
execute cmd
endfunction
function! s:commands(bang)
redir => registers
silent registers
redir END
let list = split(registers, '\n')
call fzf#run({
\ 'source': reverse(extend(list[0:0], map(list[2:], 's:format_cmd(v:val)'))),
\ 'sink': function('s:mycommand_sink'),
\ 'options': '--ansi -x --prompt "Registers> " ',
\ 'window': 'aboveleft 20new'}, a:bang)
endfunction
command! -bang Registers call s:commands(<bang>0)
I don't really know VimScript though, so this code, not shockingly, does not work.
Given the super powers of fzf
and your helper configurations here, it would be so great if one could easily combine several relevant sources, for example:
Is it possible to easily filter using fzf
the outputs from Buffers
, History
(this includes buffers already) and Files
?
In regular old terminal vim loads up just fine testing with :Files command, in macvim testing the :Files command it hangs for a second then goes back to the line I was on with zero output at all.
Currently we can move up and down in the fzf window linewise by using <C-j>
and <C-k>
. Is it possible to add mappings so that you can move in larger chunks upwards or downwards?
When you have 3 splits, layed out like this :
and you run :FZF to open an other file in the top-left split, the bottom split is moved up.
This happens only on "neovim", but I'm not sure whether it should be implemented correctly by neovim or by fzf.vim
In my case, the bottom split is actually a "quick-fix" split, but the bug also happens with normal buffers.
An excmd in a tags file may contain tab characters, which breaks -d "\t" --with-nth 1,4..
.
I would really like to be able to multi select after doing :Ag in vim. Is there an easy way to get this to work?
What's the best way to use different options for the different commands? for example, I want to use extended search in Lines
but fuzzy search in Commands
.
Thanks for this great tool! I love it!
I just switched to fzf. I like the :Lines and :BLines commands - but I notice that they do not do an exact match. Is there a way to toggle between exact match and fuzzy match? Thanks for fzf and fzf.vim.
The only output I get is Binary file (standard input) matches
.
I have hunted the issue to this line.
I get the same issue when I run it in my terminal though, so it might be a perl issue.
Steps to reproduce.
% /usr/bin/vim -u NONE -c 'source fzf.vim' -c 'Files'
Error detected while processing function <SNR>1_files..<SNR>1_fzf:
line 1:
E117: Unknown function: fzf#run
E15: Invalid expression: fzf#run(extend(a:opts, a:bang ? {} : get(g:, 'fzf_window', s:default_window)))
This function does not appear to be defined in this plugin unlike that in the fzf repo.
Is this expected to be user defined?
Not too sure what I am doing wrong but I installed fzf.vim and it works great.
Then I mapped
nnoremap <silent> <Leader><Leader> :Files<CR>
Which also works perfectly.
The problem is that when I choose a file I get this.
Error detected while processing function fzf#vim#files..73_fzf..fzf#run..38_execute..38_callback:
line 27:
Vim(call):E117: Unknown function: s:common_sink
Press ENTER or type command to continue
Is it possible to call fzf or fzf#tags with the word under the cursor or pass an argument to fzf.vim so that it expands fzf with the argument? If not, how difficult would this be to implement?
When trying to run :GitFiles
I am met with this error. I just updated fzf and fzf.vim and this started happening.
Error detected while processing function fzf#vim#gitfiles:
line 6:
E117: Unknown function: s:expect
E116: Invalid arguments for function <SNR>187_fzf
Any insights?
I'm having an issue with the :Files
command. I'm not 100% how to replicate it, but sometimes when I hit ,f
(which is mapped to :Files
) and hit enter on a file to open it... it doesn't open. This happens fairly frequently, but usually after I've used :Files
to open 1-2 files.
It says at the bottom the file name, as if it opened it but the buffer doesn't seem to appear. Then, once I hit another key the buffer appears to flash and disappear.
Now, I am using neovim so that could be the issue but would love some input on how to resolve the issue as I'm really liking fzf so far!
I just run :Tags
in my home directory. It took forever to complete. During that time neovim
was completely blocked. I had to kill the ctags process manually in order to give control back to neovim
.
I have have the following in my nvimrc. I want to be able to automatically start in insert mode whenever I select a term buffer from the Buffers
command. However, I always end up in normal mode :(
autocmd BufWinEnter,WinEnter term://* startinsert
tnoremap <c-p><c-b> <c-\><c-n>:Buffers!<cr>
The colors for commands like :Ag
end up unreadable on my dark terminal. Is there a way to customize these?
I want that fzf respects my .gitignore
files, therefore I have the following configured: https://github.com/junegunn/fzf#respecting-gitignore-hgignore-and-svnignore
However, this seems to consider only the .gitignore
file of the working directory where vim (in my case neovim) is started. When I do a :lcd
in order to change the working directory in vim and then run :Files
, the .gitignore
file of the newly configured working directory is not considered.
BTags works for my Python files, but on C++ files, I got "Failed to extract tags".
Tried all the commands but nothing happens. I don't get any error or output.
Vim 7.4 running on a Linux box under Tmux.
What information should I capture to find out what's wrong?
Here is my dotfiles setup - https://github.com/ronakg/dotfiles
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.