5

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 stuff around autocmd and feedkeys: Assume we open Vim with three new files in split windows: vim -O a.txt b.txt c.txt Vim will open with three windows like ...


4

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 fzf#vim#ag function passing it exactly two arguments: <q-args>: This is all the arguments that were passed to the command, passed as a single argument. (...


2

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 f', \ 'sink': 'edit'}) and if you want, you can add a command like this command! FZFLib call fzf#run({'source': 'find ~/project/ ~/libs/include ...


2

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 --preview=head\ -10\ {} Making $LINES working is more tricky, for basic you could probably add export LINES to your .zshrc, but this won't handle situations, ...


2

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, :h shada). If you do not know where this file is, see :h shada-file-name and this tells you The default name of the ShaDa file is "$XDG_DATA_HOME/nvim/shada/...


1

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 BufRead,BufNewFile *.<ext>[,*.<ext>] set filetype=<filetype> (The example in the article uses video as a filetype, with a plethora of ...


1

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 you do imap <expr> xxxx fzf#vim#complete(), what returns from the expression is '', and the key \<Plug>(-fzf-complete-trigger) stored in a buffer and ...


1

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! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --follow --glob "!.git/*" --color "...


1

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 mapping just change that mapping: map <c-space> :FZF ~<cr> (Unrelated to the question but related to the autocomand you mentioned: 'autochdir')


1

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<CR> command! -bang -nargs=* MyFind0 call MyFind(0, <q-args>, <bang>0) command! -bang -nargs=* MyFind1 call MyFind(1, <q-args>, <bang&...


1

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 trying using the :b command, and if the E94 error is thrown, doing a :FZF instead: function! BWithFallback(buffer_name) abort " Check if the input is a number ...


1

I have the following lines in my ~.tmux.conf, and they allow me to continue to use Ctrl-H, Ctrl-J, Ctrl-K, and Ctrl-L for navigation within Vim (between windows and also between CtrlP results), and yet also use them for navigating between tmux panes: # smart pane switching with awareness of vim splits and of emacs (but not emacs splits) bind-key -n C-h run "...


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