Skip to content
koja-langPublic

About

A Vim and Neovim plugin for the Koja programming language.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

Repository files navigation

vim-koja

CI GitHub Release Last Updated

A Vim and Neovim plugin for the Koja programming language: syntax highlighting, indentation, and :make integration via the koja compiler.

Features

  • Filetype detection for .koja and .kojs.
  • Syntax highlighting (keywords, types, strings with interpolation, numbers, annotations, comments).
  • Auto-indentation that follows block openers (fn, test, if, match, for, …) and dedents on end / else / after / when.
  • matchit support — jump between block delimiters (fn…end, test…end, if…else…end, …) with %.
  • :make integration: runs koja check and populates the quickfix list with parsed errors and warnings.
  • :compiler kojatest switches :make to koja test, so each failed assertion, fail, and crash lands in the quickfix list at its line.

This plugin covers syntax and editing only. For language-server features, pair it with koja-lsp through your LSP client (see below).

Requirements

  • Vim or Neovim.
  • The koja compiler on your $PATH for :make. Installing Koja via asdf provides it. Otherwise, see the installation guide.

Installation

With vim-plug:

Plug 'koja-lang/vim-koja'

With lazy.nvim:

{ "koja-lang/vim-koja" }

Or without a plugin manager, as a native package:

# Vim
git clone https://github.com/koja-lang/vim-koja ~/.vim/pack/plugins/start/vim-koja
# Neovim
git clone https://github.com/koja-lang/vim-koja ~/.config/nvim/pack/plugins/start/vim-koja

Language server (optional)

This plugin handles syntax and indentation only. For diagnostics, completion, and go-to-definition, run the koja-lsp server (installed alongside the koja compiler) through any LSP client — Neovim's built-in LSP, coc.nvim, or vim-lsp. It communicates over stdio and treats the directory containing koja.toml as the project root.

Contributing

Standard Vim runtimepath layout — the repository root is the plugin:

  • ftdetect/koja.vim — maps *.koja / *.kojs to the koja filetype.
  • ftplugin/koja.vim — buffer-local options (indent width, comments, matchit pairs) and selects the koja compiler.
  • syntax/koja.vim — highlighting rules.
  • indent/koja.vim — indentexpr-based auto-indentation.
  • compiler/koja.vim — makeprg and errorformat for :make (runs koja check).
  • compiler/kojatest.vim — the same for koja test, selected with :compiler kojatest.

About

A Vim and Neovim plugin for the Koja programming language.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages