-
Let me just start by saying that I am beyond impressed by everything fzf-lua has to offer. As a recent Telescope convert, I keep finding new ways to customize fzf-lua... I am loving it. Ok, so I have these terminal mappings in nvim:
I have been using them for a while and I am pretty happy with them, but the problem is that they are terminal mappings and do clash with fzf-lua (for instance, when fzf-lua is open, if I press ctrl-j, it keeps fzf-lua open but moves the vim cursor the window 'behind' fzf-lua... it's a mess... I have to then press So my question is really: in my terminal bindings, is there a way to detect that fzf-lua is being shown so I can let fzf-lua use the 'unmapped' version of the specific key (say, would just be the regular in fzf-lua, but would be my special mapping in any other terminal window) ps: I know, I know, I should really convert my existing mappings to lua... I will, I promise... |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
You can do so in two ways, exclude these mappings for Use the Edit: 3rd option: have an autocmd for FileType fzf doing the same as the above. |
Beta Was this translation helpful? Give feedback.
-
Example: require('fzf-lua').setup({
winopts = {
on_create = function(e)
vim.keymap.set(
"t", "<C-j>", "<C-j>",
{ buffer = e.bufnr, remap=false }
)
end
}
}) If this doesn’t work and your keymaps override this somehow use the autocmd for FileType approach. |
Beta Was this translation helpful? Give feedback.
You can do so in two ways, exclude these mappings for
filetype=fzf
(as fzf-lua sets the main win file type to fzf).Use the
winopts.on_create
lua callback to map the key to itself withremap=false
thus “unmapping” the keys.Edit: 3rd option: have an autocmd for FileType fzf doing the same as the above.