Replies: 1 comment 3 replies
-
+1 also interested in this. With ie: local wk = require("which-key")
local buf = vim.api.nvim_get_current_buf()
wk.add({
mode = { "n" },
{"l", "...", desc = "...", buffer = buf},
cond = function ()
return vim.bo.filetype == "javascript"
end
})
I'm able to use the same keybinding in different filetypes where each FT have it's own binding. ie: If I switch to a "py" or "cpp" buffer each will have it's own binding. But ... If I open two buffers of the same FT only the first buffer gets this binding .. for some reason this doesn't work if we have multiple buffers of the same FT. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I'm wondering if it could be possible to have a filetype specific configuration. Use case: when working on files with different filetypes in several buffers, it would be a nice feature if you can have the same key to trigger a filetype specific binding. So, for example, "l" (for "language") will open a submenu/group with golang specific commands in go buffers, and the same "l" will open a lua submenu in lua buffers. I tried to use "cond" option and also a ftplugin configuration that includes wk.add() but it seems that the configuration is read only once and then kept for all the buffers. Before digging further I'd like to know if it is like so by design or if it is possible to get this behavior in some ways.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions