snacks.nvim icon indicating copy to clipboard operation
snacks.nvim copied to clipboard

feature: Option to disable statuscolumn by filetype

Open pwnalone opened this issue 3 months ago • 1 comments

Did you check the docs?

  • [x] I have read all the snacks.nvim docs

Is your feature request related to a problem? Please describe.

I would like to be able to disable the status column for certain filetypes.

For example, line wrapping is broken in manpages when the status column is enabled, as can be seen in the following screenshot. The left pane shows the output of MANPAGER='nvim +Man!' man tmux when using LazyVim with the default configuration and the right pane shows the output when using LazyVim with vim.o.statuscolumn = "".

Image

Describe the solution you'd like

It would be nice to have a disabled_ft option (or similar), which will list the filetypes for which the status column should be disabled.

{
  "folke/snacks.nvim",
  ---@type snacks.Config
  opts = {
    statuscolumn = {
      disabled_ft = { "man" },
    }
  }
}

Describe alternatives you've considered

Ultimately, I just want line wrapping in manpages to not be broken when using LazyVim. To this end, the two alternative solutions I have considered are ...

Option A - User Configuration

The user can add the following autocommand to their lua/config/options.lua file to the same effect.

-- Fix line wrapping in manpages.
vim.api.nvim_create_autocmd({ "FileType" }, {
  group = vim.api.nvim_create_augroup("man_linewrap", { clear = true }),
  pattern = { "man" },
  callback = function()
    vim.o.statuscolumn = ""
  end,
})

This does not require any changes in Snacks or LazyVim, but manpages will not be displayed properly unless the user fixes it themselves. In my opinion, users should be able to expect that, when simply installing LazyVim and not modifying the default configuration, nothing that uses Neovim will break, and that is currently not the case with LazyVim.

Option B - LazyVim Configuration

This is the same as the above solution, but the necessary code is added to LazyVim, instead of the user's configuration. This has the benefit that line wrapping in manpages is not broken out of the box in LazyVim. Users, however, will not have an easy configuration option if they want to add more filetypes in which the status column should be disabled.

Additional context

Please see LazyVim/LazyVim#6797 for further details and to review the discussion that led to this feature request.

pwnalone avatar Nov 19 '25 11:11 pwnalone

If anyone else is annoyed by this (seems to have been introduced sometime between 2.26 and 2.30), there's a workaround for DAP UI windows:

for _, win in ipairs(vim.api.nvim_list_wins()) do
	local buf = vim.api.nvim_win_get_buf(win)
	if vim.bo[buf].filetype:match("^dapui_") then
		vim.wo[win].statuscolumn = ""
	end
end

I personally have a keybind to toggle dapui windows already, so this is ran after .toggle is called.

bramdelta avatar Nov 22 '25 21:11 bramdelta