Skip to content

koja-lang/vim-koja

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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, if, match, for, …) and dedents on end / else / after / when.
  • matchit support — jump between block delimiters (fnend, ifelseend, …) with %.
  • :make integration: runs koja check and populates the quickfix list with parsed errors and warnings.

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.vimindentexpr-based auto-indentation.
  • compiler/koja.vimmakeprg and errorformat for :make (runs koja check).

About

A Vim and Neovim plugin for the Koja programming language.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Contributors