Awesome
<h1 align="center"> smartcolumn.nvim </h1> <p align="center"> <a href="https://github.com/m4xshen/smartcolumn.nvim/stargazers"> <img alt="Stargazers" src="https://img.shields.io/github/stars/m4xshen/smartcolumn.nvim?style=for-the-badge&logo=starship&color=fae3b0&logoColor=d9e0ee&labelColor=282a36" /> </a> <a href="https://github.com/m4xshen/smartcolumn.nvim/issues"> <img alt="Issues" src="https://img.shields.io/github/issues/m4xshen/smartcolumn.nvim?style=for-the-badge&logo=gitbook&color=ddb6f2&logoColor=d9e0ee&labelColor=282a36" /> </a> <a href="https://github.com/m4xshen/smartcolumn.nvim/contributors"> <img alt="Contributors" src="https://img.shields.io/github/contributors/m4xshen/smartcolumn.nvim?style=for-the-badge&logo=opensourceinitiative&color=abe9b3&logoColor=d9e0ee&labelColor=282a36" /> </a> </p>📃 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
- Install via your favorite package manager.
{
"m4xshen/smartcolumn.nvim",
opts = {}
},
use "m4xshen/smartcolumn.nvim"
Plug "m4xshen/smartcolumn.nvim"
- Setup the plugin in your
init.lua
. This step is not needed with lazy.nvim ifopts
is set as above.
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) : thecolorcolumn
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): customcolorcolumn
values for different filetypes{}
(default){ ruby = "120", java = { "180", "200"} }
- you can also pass a function to handle more complicated logic:
custom_colorcolumn = function () return "100" end
Default config
local config = {
colorcolumn = "80",
disabled_filetypes = { "help", "text", "markdown" },
custom_colorcolumn = {},
scope = "file",
}