Closed shmerl closed 1 day ago
README was written before this was possible with neovim 0.5, can be simplified even more:
vim.keymap.set("n", "<c-P>", require('fzf-lua').files, { silent = true })
A bit unrelated, but what's the point of silent=true
? Supposedly it's for not echoing the mapping in the command line, but I don't get anything even without setting silent=true
. Am I missing something or the default in neovim for vim.keymap.set
is silent=true
?
A bit unrelated, but what's the point of
silent=true
? Supposedly it's for not echoing the mapping in the command line, but I don't get anything even without settingsilent=true
. Am I missing something or the default in neovim forvim.keymap.set
issilent=true
?
I’m not 100% sure but I think lua callback or <cmd>
commands are already silent, it would probably make a difference if you mapped rhs to :lua …
.
Ah, yes. You are right - just tested a mapping with :
instead of <Cmd>
or callback and it's indeed echoing it unless silent is added. So it's not really needed in your example and it can be even further simplified :)
vim.keymap.set("n", "<c-P>", require('fzf-lua').files)
Have you RTFM'd?
Feature Request
I think this kind of example can be rewritten in more pure lua:
as
Since
vim.keymap.set
supports Lua functions inrhs
parameter.