Skip to content

Need help with buttons and keymaps #262

Answered by garaiza-93
garaiza-93 asked this question in Q&A
Discussion options

You must be logged in to vote

Did some more tinkering and got it figured out. I wrapped rhs in <cmd>...<cr>
I also forgot the parentheses on the function calls to Telescope's pickers.
Now the config for the buttons looks like this:

		{
			["type"] = "group",
			["val"] = {
				{
					["on_press"] = vim.cmd("ene"),
					["opts"] = {
						["keymap"] = { "n", "e", "<cmd>lua vim.cmd('ene')<cr>", { noremap = true } },
						["shortcut"] = "e",
					},
					["type"] = "button",
					["val"] = "  > New file",
				},
				{
					["on_press"] = require("telescope.builtin").find_files,
					["opts"] = {
						["keymap"] = {
							"n",
							"f",
							"<cmd>lua require('telescope.builtin').find_files()<cr>",
							{ noremap =

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@goolord
Comment options

@garaiza-93
Comment options

@goolord
Comment options

Answer selected by garaiza-93
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