This is an automated archive made by the Lemmit Bot.

The original was posted on /r/neovim by /u/_skrrr on 2024-11-08 16:58:07+00:00.


Hey,

I’ve just released the second version of symbols.nvim. There are some nice incremental improvements and small fixes.

symbols.nvim sidebar with different filetypes

I would love to get some feedback.

Are there any languages that you would like to be supported? Of course, symbols.nvim works works for any language that has an LSP server available but the output is often noisy and can be improved for displaying in the sidebar. Some other languages may require custom logic, for example, using treesitter.

Are there any missing features that prevent you from using symbols.nvim? Any ideas for improvement? Any bugs that you’ve encountered?

I have some ideas that I’ll be expermienting with. Mostly trying to make navigation within a single file easier and faster.

Changes

Breaking

  • changed keymappings: “tc” -> “tch” (toggle-cursor-hiding) and “tf” -> “tcf” (toggle-cursor-follow)
  • moved “hide_cursor” setting from the top level to “sidebar.hide_cursor”

Features

  1. better messages on provider (LSP) fail
  2. new commands: “SymbolsToggle” and “SymbolsOpen”
  3. treesitter based JSON and JSON Lines provider
  4. keymaps for decreasing (“t[”) and increasing (“t]”) max width
  5. “close on goto” config setting and toggle (“tg”)
  6. “auto preview” config setting
  7. notifications when changing toggles
  8. symbols filter toggle (“tf”)

Notes:

  1. Added a separate message for when the provider times out. This is especially useful when opening a new filetype as the LSP servers suffer from cold starts and the first request might take longer. Previously there was only a very generic message: “lsp failed”, it’s still there but only used when the LSP server fails. Additionally, increased the default timeout for LSP servers from 1s to 2s which should make the time outs less likely.
  2. More options for setting up your keybinding to open/close the sidebar.
  3. I wanted to see what the benefits and drawbacks of implementing treesitter providers may be. The upside is that they do not require the user to have a specific LSP server installed and it’s much easier to customize what symbols are provided and their inline details messages. The downsides are that it’s more code to write and maintain. It’s also slower than a dedicated LSP and because of that by default the LSP server is used.
  4. Change the width and keep it on auto resize. Works with a count, so “5t]” will increase the width by 25.
  5. When “close on goto” is on the sidebar will close after going to a symbol.
  6. There already was a toggle for “auto preview”, now there is also a setting.
  7. A small bar pops up at the bottom of the sidebar after toggling any setting. It’s useful when a toggle doesn’t produce any immediate visual changes.
  8. Allows to see all the symbols provided by the provider. Mostly useful for debugging.