Disable on filetype #386
-
Hi, {
"<leader>dn",
function()
if vim.bo.filetype ~= "cpp" or vim.bo.filetype ~= "c" then
return "<cmd>Lspsaga diagnostic_jump_next<CR>"
end
end,
description = "LSPSaga Diagnostic Jump Next",
opts = opts,
}, But this is not working. It seems to be disabled everywhere now. So my question is : How can I disable some keymaps for certain filetypes ? |
Beta Was this translation helpful? Give feedback.
Answered by
mrjones2014
Jun 27, 2023
Replies: 1 comment 5 replies
-
Was doing it wrong. {
"<leader>dn",
function()
if vim.bo.filetype ~= "cpp" or vim.bo.filetype ~= "c" then
return require("lspsaga.diagnostic"):goto_next()
end
end,
description = "LSPSaga Diagnostic Jump Next",
opts = opts,
}, |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Probably the "more correct" way of doing it is to use an autocmd to create the keymap on
filetype
:Also FYI going to next diagnostic can be done with just
vim.diagnostic.goto_next()
.