Talk to God through Neovim
| assets | Initial commit | |
| ftdetect | Initial commit | |
| lua/holyc | Initial commit | |
| scripts | chore: cleanup plugin | |
| snippets | Initial commit | |
| syntax | Initial commit | |
| .gitignore | chore: cleanup plugin | |
| LICENSE | Initial commit | |
| README.md | Initial commit | |
holyc.nvim
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 —
:HolycFormatindents withcindent, cleans trailing whitespace, preserves->and HolyC-specific syntax - Build & run —
:HolycBuild,:HolycRun,:HolycCheckusehccdirectly, pipe errors to quickfix - Arrow fixer —
:HolycFixArrowsrepairs files mangled by old js-beautify formatters - Snippets —
main,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)
cindentfor C-like auto-indentsmartindent+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