Replies: 1 comment
-
Well... It is possible but not an elegant one. Solution is to use autocmds. Basically they are event listeners. You can listen for buffer events for http files and register your keymaps for only that buffer. return {
"mistweaverco/kulala.nvim",
ft = "http",
dependencies = {
{
"AstroNvim/astrocore",
---@type AstroCoreOpts
opts = {
autocmds = {
keymaps = {
{
event = { "BufRead", "BufNewFile" },
pattern = "*.http",
desc = "kulala.nvim http file keymaps",
callback = function()
local opts = { noremap = true, silent = true }
vim.api.nvim_buf_set_keymap(0, "n", "<leader>r", "<cmd>lua require('kulala').run()<cr>", opts)
vim.api.nvim_buf_set_keymap(0, "n", "[r", "<cmd>lua require('kulala').jump_prev()<cr>", opts)
vim.api.nvim_buf_set_keymap(0, "n", "]r", "<cmd>lua require('kulala').jump_next()<cr>", opts)
vim.api.nvim_buf_set_keymap(0, "n", "<leader>i", "<cmd>lua require('kulala').inspect()<cr>", opts)
end,
},
},
},
},
},
},
opts = {
debug = true,
},
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
Is there a way to have keybinds set for a specific file only?
Take the below configuration for example, I have mappings set, but I want them to only apply on
.http
files. Is that even possible?Beta Was this translation helpful? Give feedback.
All reactions