Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/0xfraso/nvim-listchars
Configure and toggle listchars easily
https://github.com/0xfraso/nvim-listchars
Last synced: about 2 months 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 (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-25T11:22:19.000Z (11 months ago)
- Last Synced: 2024-08-12T02:01:50.492Z (5 months ago)
- Language: Lua
- Size: 27.3 KB
- Stars: 14
- Watchers: 1
- Forks: 2
- 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) ![](https://img.shields.io/github/last-commit/fraso-dev/nvim-listchars) ![](https://img.shields.io/github/commit-activity/y/fraso-dev/nvim-listchars) (View / listchars)
README
# nvim-listchars
Easily configure and toggle listchars
![example](https://user-images.githubusercontent.com/116293603/225258794-e083246c-4262-474e-b68d-827da4d17fe0.gif)
## ๐ฆ 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", config = 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 = "+",
},
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",
config = function()
require("nvim-listchars").setup({
save_state = false,
listchars = {
trail = "-",
eol = "โฒ",
tab = "ยป ",
},
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
```