https://github.com/0xfraso/nvim-listchars
Configure and toggle listchars easily
https://github.com/0xfraso/nvim-listchars
Last synced: 8 days ago
JSON representation
Configure and toggle listchars easily
- Host: GitHub
- URL: https://github.com/0xfraso/nvim-listchars
- Owner: 0xfraso
- License: mit
- Created: 2023-03-15T08:01:12.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-03T09:38:36.000Z (16 days ago)
- Last Synced: 2025-04-03T18:02:55.232Z (15 days ago)
- Language: Lua
- Size: 31.3 KB
- Stars: 19
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- my-neovim-pluginlist - fraso-dev/nvim-listchars - dev/nvim-listchars)   (View / listchars)
README
# nvim-listchars
Easily configure and toggle listchars

## 📦 Installation
In order to display `listchars` by default,
you must enable them somewhere in your `init.lua` **before** loading the plugin.```lua
vim.opt.list = true
```If you simply want to display `listchars` when needed,
you can toggle them ON/OFF with the command `:ListcharsToggle`.### Lazy (recommended)
#### With defaults
```lua
{ "fraso-dev/nvim-listchars", opts = true }
```### Packer
#### With defaults
```lua
use {
"fraso-dev/nvim-listchars",
config = function()
require("nvim-listchars").setup()
end
}
```## ⚙️ Configuration
### Defaults
```lua
{
save_state = true, -- If enabled, save toggled state in a cache file. Will overwrite current `vim.opt.list` value.
listchars = { -- `listchars` to be displayed. See available options by running `:help listchars`
tab = "> ",
trail = "-",
nbsp = "+",
},
notifications = true, -- Enable or disable listchars notifications
exclude_filetypes = {}, -- List of filetypes where `listchars` is disabled
lighten_step = 5, -- Amount to add/remove from base color
}
```### Example with updated preferences
```lua
{
"fraso-dev/nvim-listchars",
event = "BufEnter",
config = function()
require("nvim-listchars").setup({
save_state = false,
listchars = {
trail = "-",
eol = "↲",
tab = "» ",
space = "·",
},
notifications = true,
exclude_filetypes = {
"markdown"
},
lighten_step = 10,
})
end,
}
```You can find the complete list of available chars by running `:help listchars`
## ⚡ Commands
```
:ListcharsStatus
:ListcharsToggle
:ListcharsDisable
:ListcharsEnable
:ListcharsClearCache
:ListcharsLightenColors
:ListcharsDarkenColors
```## Notes
If you want to enable `tab` chars you must disable `expandtab`:
```lua
vim.opt.expandtab = false
```