Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/m4xshen/smartcolumn.nvim
A Neovim plugin hiding your colorcolumn when unneeded.
https://github.com/m4xshen/smartcolumn.nvim
colorcolumn lua neovim neovim-plugin nvim nvim-plugin
Last synced: 28 days ago
JSON representation
A Neovim plugin hiding your colorcolumn when unneeded.
- Host: GitHub
- URL: https://github.com/m4xshen/smartcolumn.nvim
- Owner: m4xshen
- License: mit
- Created: 2023-02-17T12:52:29.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-27T04:37:27.000Z (4 months ago)
- Last Synced: 2024-09-29T01:43:02.672Z (about 1 month ago)
- Topics: colorcolumn, lua, neovim, neovim-plugin, nvim, nvim-plugin
- Language: Lua
- Homepage:
- Size: 29.3 KB
- Stars: 289
- Watchers: 3
- Forks: 13
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-neovim - m4xshen/smartcolumn.nvim - Hide your colorcolumn when unneeded. (Bars and Lines / Colorscheme Switchers)
README
smartcolumn.nvim![demo](https://user-images.githubusercontent.com/74842863/219844450-37d96fe1-d15d-4aaf-ae57-1c6ce66d8cbc.gif)
## 📃 Introduction
A Neovim plugin hiding your colorcolumn when unneeded.
## ⚙️ Features
The colorcolumn is hidden as default, but it appears after one of lines in the
scope exceeds the `colorcolumn` value you set.You can:
- hide colorcolumn for specific filetype
- set custom colorcolumn value for different filetype
- specify the scope where the plugin should work## 📦 Installation
1. Install via your favorite package manager.
- [lazy.nvim](https://github.com/folke/lazy.nvim)
```Lua
{
"m4xshen/smartcolumn.nvim",
opts = {}
},
```- [packer.nvim](https://github.com/wbthomason/packer.nvim)
```Lua
use "m4xshen/smartcolumn.nvim"
```- [vim-plug](https://github.com/junegunn/vim-plug)
```VimL
Plug "m4xshen/smartcolumn.nvim"
```2. Setup the plugin in your `init.lua`. This step is not needed with lazy.nvim
if `opts` is set as above.```Lua
require("smartcolumn").setup()
```## 🔧 Configuration
You can pass your config table into the `setup()` function or `opts` if you use
lazy.nvim.The available options:
- `colorcolumn` (strings or table) : screen columns that are highlighted
- `"80"` (default)
- `{ "80", "100" }`
- `disabled_filetypes` (table of strings) : the `colorcolumn` will be disabled
under the filetypes in this table
- `{ "help", "text", "markdown" }` (default)
- `{ "NvimTree", "lazy", "mason", "help", "checkhealth", "lspinfo", "noice", "Trouble", "fish", "zsh"}`
> [!NOTE]
> You can use `:set filetype?` to check the filetype of current buffer.
- `scope` (strings): the plugin only checks whether the lines within scope
exceed colorcolumn
- `"file"` (default): current file
- `"window"`: visible part of current window
- `"line"`: current line
- `custom_colorcolumn` (table or function returning string): custom
`colorcolumn` values for different filetypes
- `{}` (default)
- `{ ruby = "120", java = { "180", "200"} }`
- you can also pass a function to handle more complicated logic:
```lua
custom_colorcolumn = function ()
return "100"
end
```### Default config
```Lua
local config = {
colorcolumn = "80",
disabled_filetypes = { "help", "text", "markdown" },
custom_colorcolumn = {},
scope = "file",
}
```