2
1
Fork
You've already forked holyc.nvim
0
Talk to God through Neovim
  • Lua 49.5%
  • Vim Script 46.5%
  • JavaScript 4%
2026年06月13日 19:10:06 +05:00
assets Initial commit 2026年06月13日 15:20:34 +05:00
ftdetect Initial commit 2026年06月13日 15:20:34 +05:00
lua/holyc Initial commit 2026年06月13日 15:20:34 +05:00
scripts chore: cleanup plugin 2026年06月13日 19:10:06 +05:00
snippets Initial commit 2026年06月13日 15:20:34 +05:00
syntax Initial commit 2026年06月13日 15:20:34 +05:00
.gitignore chore: cleanup plugin 2026年06月13日 19:10:06 +05:00
LICENSE Initial commit 2026年06月13日 15:20:34 +05:00
README.md Initial commit 2026年06月13日 15:20:34 +05:00

holyc.nvim

License: MIT

Neovim plugin for the HolyC language — syntax highlighting, formatting, build/run commands, snippets.


Features

  • Syntax highlighting — types (U0, I64, F64), keywords, ->, postfix casts (ptr(Type)), asm {} blocks with registers and instructions, extern "c", print expressions
  • Code formatting:HolycFormat indents with cindent, cleans trailing whitespace, preserves -> and HolyC-specific syntax
  • Build & run:HolycBuild, :HolycRun, :HolycCheck use hcc directly, pipe errors to quickfix
  • Arrow fixer:HolycFixArrows repairs files mangled by old js-beautify formatters
  • Snippetsmain, for, if, while, class, func, printf, #include, switch

Preview

Screenshot of holyc.nvim syntax highlighting


Installation

In your ~/.config/nvim/init.lua:

vim.pack.add({
 { src = 'https://codeberg.org/OverLessArtem/holyc.nvim' },
})
require('holyc').setup()

Commands

Command Description
:HolycFormat Format buffer — indent code, remove trailing whitespace, collapse blank lines
:HolycBuild Compile with hcc. Pass libs: :HolycBuild -lX11
:HolycBuild -clibs="-lX11 -lcurl" Compile with multiple C libraries
:HolycRun Build + run in a split terminal
:HolycRun -lX11 Build with libs + run
:HolycCheck Syntax check (hcc -S), errors go to quickfix
:HolycFixArrows Restore -> and var(Type)

Keybindings (in .HC / .hc files)

Key Action
<leader>f Format
<leader>c Check syntax
<F6> Build
<F5> Build & run
<leader>b Build with custom clibs prompt
<leader>r Run with custom clibs prompt

Filetype settings

When you open a .HC / .hc file, holyc.nvim sets:

  • 4-space indentation (tabs expanded)
  • cindent for C-like auto-indent
  • smartindent + autoindent
  • // as comment string
  • = operator works for indentation

Snippets (requires LuaSnip)

Snippets are optional — install LuaSnip and add to your init.lua:

local snippet_path = vim.fn.glob(
 vim.fn.stdpath('data') .. '/site/pack/*/opt/holyc.nvim/snippets'
)
if snippet_path ~= '' then
 require('luasnip.loaders.from_lua').load({ paths = { snippet_path } })
end
Trigger Expands to
main I32 main() { ... return 0; }
func U0 FunctionName() { ... }
class class MyClass { ... };
for for (I64 i = 0; i < limit; i++) { ... }
while while (condition) { ... }
if if (condition) { ... }
switch switch (var) { case val: ... break; default: ... break; }
#include #include "filename.HC"
printf "format", args;

License

MIT