-
Not sure if I'm doing something wrong but, return {
'ibhagwan/fzf-lua',
cmd = "FzfLua",
keys = {
{ "<leader>pf", vim.cmd.FzfLua("files"), desc = "Search for file" },
...
} but this does (no error and lazy loaded) ...
{ "<leader>pf", vim.cmd.FzfLua, desc = "Search for file" },
... Wrapping the first one inside a function does work too EDIT: I guess the first one is evaluated and the second one is just the function's address but is there a way to avoid wrapping everything inside a function? keys = {
{ "<leader>p<esc>", "<nop>" },
{ "<leader>pD", function() vim.cmd.FzfLua("lsp_workspace_diagnostics") end, desc = "Search for workspace diagnostics" },
{ "<leader>pd", function() vim.cmd.FzfLua("lsp_document_diagnostics") end, desc = "Search file diagnostics" },
{ "<leader>pf", function() vim.cmd.FzfLua("files") end, desc = "Search for file" },
{ "<leader>pg", function() vim.cmd.FzfLua("live_grep_glob") end, desc = "Search for string" },
{ "<leader>ph", function() vim.cmd.FzfLua("help_tags") end, desc = "Search for help documentation" },
{ "<leader>pH", function() vim.cmd.FzfLua("highlights") end, desc = "Search for highlight groups" },
{ "<leader>pk", function() vim.cmd.FzfLua("keymaps") end, desc = "Search for keymaps" },
{ "<leader>pp", function() vim.cmd.FzfLua("resume") end, desc = "Resume last FzfLua search" },
{ "<leader>pr", function() vim.cmd.FzfLua("lsp_references") end, desc = "Search for symbol references" },
{ "<leader>ps", function() vim.cmd.FzfLua("lsp_document_symbols") end, desc = "Search for file symbols" },
{ "<leader>pS", function() vim.cmd.FzfLua("lsp_workspace_symbols") end, desc = "Search for workspace symbols" },
{ "<leader>pb", function() vim.cmd.FzfLua("buffers") end, desc = "Search for buffers" },
{ "<leader>pq", function() vim.cmd.FzfLua("oldfiles") end, desc = "Search recently opened files" },
},
|
Beta Was this translation helpful? Give feedback.
Answered by
0xayko
Oct 29, 2024
Replies: 1 comment
-
Nevermind didn't realize this was just how setting keymaps in general works... |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
0xayko
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nevermind didn't realize this was just how setting keymaps in general works...