Skip to content

HadyMash/greekvars.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

greekvars.nvim

A Neovim plugin that replaces Greek letter names with the corresponding Greek character using Vim's conceal feature.

Features

  • Automatically conceals Greek letter names (e.g., alpha, beta, gamma) with their corresponding Unicode symbols (α, β, γ)
  • Works with multiple programming languages (Lua, Python, JavaScript, TypeScript, C, C++)
  • Temporarily disables conceal during search to show search highlights properly
  • Configurable file types and conceal settings
  • Easy toggle command to enable/disable Greek variable conceal

Installation

Using lazy.nvim

{
  "HadyMash/greekvars.nvim",
  ft = { "lua", "python", "javascript", "typescript", "c", "cpp" },
  config = function()
    require("greekvars").setup()
  end,
}
use {
  "HadyMash/greekvars.nvim",
  ft = { "lua", "python", "javascript", "typescript", "c", "cpp" },
  config = function()
    require("greekvars").setup()
  end,
}

Using vim-plug

Plug 'HadyMash/greekvars.nvim'

Then add to your init.lua:

require("greekvars").setup()

Configuration

Default configuration:

require("greekvars").setup({
  conceallevel = 2,         -- Vim's conceallevel setting (0-3)
  concealcursor = "nc",     -- Vim's concealcursor setting
  filetypes = {             -- File types where Greek vars are concealed
    "lua",
    "python",
    "javascript",
    "typescript",
    "c",
    "cpp",
  },
})

Usage

Once installed and set up, the plugin will automatically conceal Greek letter names in supported file types.

Commands

  • :GreekVarsToggle - Toggle Greek variable conceal on/off

Supported Greek Letters

The following Greek letter names are supported:

Name Symbol
alpha α
beta β
gamma γ
delta δ
epsilon ε
zeta ζ
eta η
theta θ
iota ι
kappa κ
lambda λ
mu μ
nu ν
xi ξ
omicron ο
pi π
rho ρ
sigma σ
tau τ
upsilon υ
phi φ
chi χ
psi ψ
omega ω

How It Works

The plugin uses Vim's built-in conceal feature to replace text in the buffer display without modifying the actual file content. When you search for text, conceal is temporarily disabled so that search highlights work properly.

The concealed Greek characters preserve the syntax highlighting of the original text, whether it comes from Vim's traditional syntax highlighting, TreeSitter, or LSP semantic tokens. This means that function parameters, variables, keywords, and other highlighted text will maintain their colors even when concealed.

License

MIT

About

A Neovim plugin that replaces greek letter names with the corresponding greek character.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages