Skip to content

Is there any method to map keys to functions now? #515

Closed Answered by CharlesChiuGit
Tgist1024 asked this question in Q&A
Discussion options

You must be logged in to vote

---@param callback fun():nil
---@return map_rhs
function bind.map_callback(callback)
local ro = rhs_options:new()
return ro:map_callback(callback)
end
is how u set functions to keymaps.

Here's an example:

["n|<leader>fw"] = map_callback(function()
require("telescope").extensions.live_grep_args.live_grep_args()
end)
:with_noremap()
:with_silent()
:with_desc("find: Word in project"),

As u can see it's contains a function.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Tgist1024
Comment options

Answer selected by Tgist1024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants