Can I force the diagnostics gutter to stay open?

I use easymotion to move around, and since it modifies the contents of the buffer, I have to disable LSPs during the prompt. I use the following autocommands for that:

autocmd User EasyMotionPromptBegin silent! LspStop
autocmd User EasyMotionPromptEnd silent! LspStart

The only issue is that calling LspStop/LspStart hides then reopens the gutter, which is annoying especially on small buffers because it shifts text around. What I’m wondering is if there’s a way to force the gutter to take up the same amount of space regardless of whether LSPs are running. Or, if someone else has a better suggestion I’d love to hear it!

1 Like

I suggest to try Neovim alternative to EasyMotion, hop.nvim. It’s not modifying the buffer, so you shouldn’t have any of these LSP issues. I’m not sure about feature parity, but to me it seems really similar.

1 Like

That works great, feels much faster too, probably cause I’m not trying to restart a bunch of LSPs lol, thanks!

I also found the answer to the original question on the lspconfig GitHub, under this issue here, just add set signcolumn=yes to your config. You can also set a specific width if you need to, more instructions on that can be found at :h signcolumn. If you want it to only force it to stay open when you’re in a buffer with an LSP, you can add vim.opt.signcolumn = "yes" to the on_attach function for all your LSPs.

2 Likes