Skip to content

Disable on filetype #386

Answered by mrjones2014
ls-devs asked this question in Q&A
Jun 27, 2023 · 1 comments · 5 replies
Discussion options

You must be logged in to vote

Probably the "more correct" way of doing it is to use an autocmd to create the keymap on filetype:

require('legendary').setup({
  autocmds = {
    {
      'Filetype',
      function()
        require('legendary').keymap({
          '<leader>dn',
          require('lspsaga.diagnostic'):goto_next,
          description = 'LSPSaga Diagnostic Jump Next',
          opts = vim.tbl_deep_extend("force", opts, { buffer = 0 }),
        })
      end
      opts = { pattern = { 'c', 'cpp' } },
    },
  }
})

Also FYI going to next diagnostic can be done with just vim.diagnostic.goto_next().

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@mrjones2014
Comment options

Answer selected by mrjones2014
@mrjones2014
Comment options

@ls-devs
Comment options

@mrjones2014
Comment options

@mrjones2014
Comment options

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