A Neovim plugin that replaces Greek letter names with the corresponding Greek character using Vim's conceal feature.
- 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
Using lazy.nvim
{
"HadyMash/greekvars.nvim",
ft = { "lua", "python", "javascript", "typescript", "c", "cpp" },
config = function()
require("greekvars").setup()
end,
}Using packer.nvim
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()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",
},
})Once installed and set up, the plugin will automatically conceal Greek letter names in supported file types.
:GreekVarsToggle- Toggle Greek variable conceal on/off
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 | ω |
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.
MIT