josean-dev / dev-environment-files

2.64k stars 740 forks source link

LSP cursor and line diagnostics #11

Closed razwanizmi closed 1 year ago

razwanizmi commented 1 year ago

Hi @josean-dev, thank you so much for making your YouTube videos and putting these config files up. I've found them really helpful in learning about Neovim and Tmux.

I have a question about the way you set up LSP diagnostics key bindings - are these 2 meant to be the same?

  keymap.set("n", "<leader>d", "<cmd>Lspsaga show_line_diagnostics<CR>", opts) -- show  diagnostics for line
  keymap.set("n", "<leader>d", "<cmd>Lspsaga show_cursor_diagnostics<CR>", opts) -- show diagnostics for cursor

Only cursor diagnostics work for me (I assume because it was declared later). So I put one as D and the other as d.

josean-dev commented 1 year ago

Hey! Glad you found the videos helpful! Thanks a lot for pointing this out. I was confused with this for a while and I hadn't realized I made this mistake until now. I believe I had added this originally getting inspiration from another config. I'll try out your fix and add it to the repo. Thanks again!

josean-dev commented 1 year ago

Actually looks like I had done this originally by looking at the lspsaga example keymaps in their repo. For some reason they have the same keymap for both of these. Not sure if that's a mistake they made on their part which is definitely possible. Will be changing mine to different keymaps you have done. Here's a link to the example in case you're interested: https://github.com/glepnir/lspsaga.nvim#configuration