Compact.vim – Vim/Neovim Syntax Highlighting & Tree-sitter Support for Compact

compact.vim – Vim/Neovim Support for Compact

compact.vim provides syntax highlighting and editor support for the Compact smart contract language (Midnight network) in Vim and Neovim.

Features

  • Syntax highlighting for .compact files (regex-based for Vim, tree-sitter for Neovim)
  • Filetype detection – automatic recognition of .compact files
  • Smart indentation – context-aware indentation for blocks and functions
  • Comment support – single-line (//) and block comments (/* */)

Installation

Works with all popular plugin managers:

lazy.nvim

{ "1NickPappas/compact.vim", ft = "compact" }

vim-plug

  Plug '1NickPappas/compact.vim'

Native (Vim 8+ / Neovim)

  git clone https://github.com/1NickPappas/compact.vim \
      ~/.local/share/nvim/site/pack/plugins/start/compact.vim

Links

:link: GitHub: https://github.com/1NickPappas/compact.vim


:test_tube: Note: This is an experimental project developed in my personal free time for educational purposes. Any feedback, suggestions, or contributions are greatly appreciated!


4 Likes

I’ve been waiting for a vim integration :raising_hands:

2 Likes

Hey! Glad to hear that was helpful for someone else, too. I’ve actually set up a full Neovim integration and built the missing LSP myself so I could work with Compact in my favorite editor.

You can find it here: Compact-lsp – Language Server Protocol Implementation for Compact

*The implementation details are in the repo README and should help you get everything set up.

Let me know if it works for you. Have fun!

1 Like