# Tag Info

### Behaviour of BufEnter

I don't use fzf and use Vim instead of neovim. So I couldn't reproduce your scenario. Also I was not able to reproduce what @dedowsdi described in his comment.(See end of answer.) But some general ...
• 8,675
Accepted

### How to call the fzf Ag command with multiple arguments?

TL;DR: You can't pass ag options into that command. (But jump to the bottom for a different one.) Note the distinction between the :Ag command and the fzf#vim#ag function. The :Ag command calls the ...
• 28.3k
Accepted

### How to remove entries from v:oldfiles list in neovim

Fix entries in ShaDa File (neovim-specific) Neovim does not use anymore the plaintext file viminfo (used by vim) to store this but uses a msgpack formatted file called ShaDa (short for shared data, :...
• 4,050
Accepted

### Open FZF in current directory of file I am viewing

You can use :Files [PATH] for this. See the command reference. To pass in the directory: :Files %:p:h Alternatively, you can also use lcd to change the directory for the current window, then use FZF ...
• 156
Accepted

### Use feedkeys then do command

You might be able to make this work with feedkeys, but it's usually hard/brittle to do so. I would recommend using something input(':cd ', getcwd(), 'dir') to get the directory as input (with ...
• 21.5k

### How can I change the cursor moving on fzf?

this is the default mapping of up and down in fzf: down : ctrl-j ctrl-n down up : ctrl-k ctrl-p up Most people don't have problem with this. If you really really want to add your own setting, ...
• 5,908

### How can I pass extra flags to FZF/ripgrep commands with the leader key?

Please note that I changed your mapping to suit my keyboard. However this is what I got in terms of functionality: nnoremap <C-P> :MyFind0<CR> nnoremap <Leader><C-P> :MyFind1&...
• 143

### How to exclude filenames from Ag search (via fzf.vim)?

To find files which contains some string, the :grep command is "for that". And I know it's quite slow. For that purpose, I have added the :Find command to my .vimrc: (From this post) command! -...
• 442
Accepted

### VIM FZF, searching multiple directories

You can specify the command to obtain the input of fzf by using the fzf#run() function. In your case, this can look something like this: call fzf#run({'source': 'find ~/project/ ~/libs/include -type ...
• 916
Accepted

### FZF --preview in Vim returns zsh shell error

I don't have \$LINES defined in my Vim environment, and I'm using Zsh, so it's probably not exported to child processes. However, to make this work you need to remove quotes and escape spaces: :FZF --...
• 4,238
Accepted

### How to use fzf :Buffers/:Files commands from vim terminal buffer

The error E948 only occurs if hidden is not set. In this case vim does not allow to move a modified buffer out of view (lingua Vim: "abandon"). A terminal buffer with a running process (e.g. the shell)...
• 8,675

### Insert filepath from FZF window in buffer

Add FZF setup: func! s:insert_file_name(lines) let @@ = fnamemodify(a:lines[0], ":p") normal! p endfunc let g:fzf_action = { 'ctrl-r': function('s:...
• 10.4k
Accepted

### Can I set the default search directory on fzf?

The following info can be found in the official docs of fzf: You can execute :FZF with an argument for the starting dir. So you can just run :FZF ~ instead of :FZF. If you open the fzf buffer from a ...
• 1,519
Accepted

### Can't search for strings within hidden files with fzf's Rg command in vim

A bit late but I had this issue as well. As you're using fzf.vim you can configure the Rg command as per their instructions by adding the following to your init.vim file and adding in the --hidden ...
• 136
Accepted

### fzf.vim how to configure the maximum amount of files stored in recent files history?

:History command operates on :oldfiles result which is stored in v:oldfiles variable that is loaded from viminfo. You can change it by changing viminfo, there might be better approach, but anyways: ...
• 10.4k
1 vote

### Open FZF in current directory of file I am viewing

As mentioned in accepted reply, to expand the solution I add nnoremap <Leader>pf :Files %:p:h<CR> to ~/.vimrc
• 11
1 vote
Accepted

### Vim getting stuck after selecting a file in fzf preview

Thanks to @d-ben-knoble, in my case I had vim-surround in my vimrc which was causing this behaviour I removed that and now is fixed.
• 163
1 vote

### Custom key binding for project-wide search and replace using FZF.vim Rg function?

No plugins: set the args list (e.g., :args git ls-files) search (:vimgrep /pat/ ##) replace (:cdo substitute/...) save (:argdo update or :wall or whatever) Alternately, search with :grep -R ... * or ...
• 21.5k
1 vote
Accepted

### Opening multiple files in Vim with fzf.vim's Rg command

Any idea why I can't open multiple files with an Rg command? That is how Rg is implemented. If there are multiple entries selected it opens all of them in vim quickfix. Check ag_handler it uses for ...
• 10.4k
1 vote
Accepted

### Is it normal that I can't erase an input to FZF?

No, it isn't the normal behavior for fzf.vim. I was able to backspace normally to delete typed text. Check your mappings by running :map <Backspace>.
• 244
1 vote

### How could I customize preview window coloring with results from Ripgrep and fzf?

If installed, fzf vim uses bat to add syntax highlighting to the preview. bat comes with several themes available. You can choose a theme by setting the BAT_THEME environment variable. For example, ...
• 67
1 vote
Accepted

### Tracking down odd behavior right after opening Vim and using fuzzy finder

Thanks to some very helpful comments by @dedowsdi I have discovered some more about the vast world that is Vim. You can test startup load time by running vim --startuptime vtime.log and inspecting ...
• 248
1 vote
Accepted

### How to use FZF to search directories and open new file in directory

I ended up using this command in my vimrc with fzf.vim, specifically filtering directories in my current git repo. function! s:append_dir_with_fzf(line) call fzf#run(fzf#wrap({ \ 'options': ['--...
1 vote

### Insert filepath from FZF window in buffer

You will need to run the underlying FZF functions to do so. Say you intend to adapt Files to do so. :Files probably calls fzf#run at some point. Find that call. The sink argument of fzf#run (and ...
• 1,154
1 vote
Accepted

### Context aware fzf command

Based on what I read at Vimways, I would do something like this: First, we need filetype-detection working, so for every filetype you need, in ~/.vim/ftdetect/<filetype>.vim, put autocommand ...
• 21.5k
1 vote

### Why does :call f(...) do nothing while mapping it to a binding works?

This touches the implementation details of fzf#complete. If you look into the source code of fzf#vim#complete, you will see call feedkeys("\<Plug>(-fzf-complete-trigger)") return '' So when ...
• 1,517
1 vote

### How to remove entries from v:oldfiles list in neovim

I have written an article on dev.to about accessing v:oldfiles entries, here is the function to access oldfiles outside of vim: function old(){ [[ -f /tmp/oldfiles.txt ]] && \rm /tmp/...
• 1,017
1 vote

### Can I set the default search directory on fzf?

You can provide a default path to fzf if you configure it to use fd (or rigrep or ag) in your .bashrc. Then calling fzf from vim will also use this path as a starting point. My .bashrc has the ...
• 917
1 vote

### How can I change the cursor moving on fzf?

You can use --bind to change mappings to everything you like: So something along the lines of this should work for you: map <silent> <F2> :call fzf#run({'source': 'rg --files --column --...
1 vote
Accepted

### How to add a fallback when :b buffer change fails

You can't change the way the :b command works, but you can create an alternative :B command, and then create an abbreviation to always use the :B command when you type :b. The below works by first ...
• 28.3k

Only top scored, non community-wiki answers of a minimum length are eligible