Skip to content

Neovim plugin that highlights individual characters with a toggleable ColorColumn.

License

Notifications You must be signed in to change notification settings

ecthelionvi/NeoColumn.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

🌈 NeoColumn.nvim

Lua Neovim

demo

📢 Introduction

NeoColumn is a Neovim plugin that shows a focused ColorColumn at a specific position to manage line length. It highlights individual characters, minimizing clutter and enhancing readability

✨ Features

  • Display focused ColorColumn/s at the desired position
  • Set custom ColorColumn value/s for certain filetypes
  • Exclude specific filetypes from the ColorColumn
  • Toggle NeoColumn on and off
  • Customizable colors

💾 Persistence

NeoColumn maintains the ColorColumn settings for each file, including visibility and position, across sessions.

🛠️ Usage

To toggle NeoColumn on/off, you can use the ToggleNeoColumn command:

:ToggleNeoColumn

You can also create a keybinding to toggle NeoColumn more conveniently:

vim.keymap.set("n", "<leader>h", "<cmd>ToggleNeoColumn<cr>", { noremap = true, silent = true })

To clear the list of enabled/disabled files in NeoColumn, you can use the ClearNeoColumn command:

:ClearNeoColumn

📦 Installation

  1. Install via your favorite package manager.
{
  "ecthelionvi/NeoColumn.nvim",
  opts = {}
},
use "ecthelionvi/NeoColumn.nvim"
  1. Setup the plugin in your init.lua. Skip this step if you're fine with the default settings or using lazy.nvim with opts set as above.
require("NeoColumn").setup()

🔧 Configuration

You can pass your config table into the setup() function or opts if you use lazy.nvim.

The available options:

  • fg_color(string) : foreground color of the ColorColumn as a hex code (e.g., "#FF0000")
    • "" (default, falls back to the foreground color of the IncSearch highlight group)
  • bg_color(string) : background color of the ColorColumn as a hex code (e.g., "#00FF00")
    • "" (default, falls back to the background color of the IncSearch highlight group)
  • NeoColumn (string / table) : character position at which the ColorColumn/s appears
    • "80" (default)
    • { "80", "100" }
  • always_on (boolean) : switch on/off the ColorColumn by default
    • false (default)
  • custom_NeoColumn (table) : custom ColorColumn values for specific filetypes
    • {} (default)
    • { ruby = "120", java = { "180", "200"} }
  • excluded_ft (table) : filetypes to exclude from the ColorColumn
    • { "text", "markdown" } (default)

Default Config

local config = {
  fg_color = "",
  bg_color = "",
  NeoColumn = "80",
  always_on = false,
  custom_NeoColumn = {},
  excluded_ft = { "text", "markdown" },
}

About

Neovim plugin that highlights individual characters with a toggleable ColorColumn.

Topics

Resources

License

Stars

Watchers

Forks

Languages