Home

Awesome

Important information!!

WIP

This is a work in progress. It is very usable, in fact I use it in my personal configs and in one Neovim plugin with great success, but the API may change.

Not a plugin

This is not a Neovim plugin , it is a Haxe library to help you write neovim configurations and plugins using Haxe programming language

How to contribute

I am just a newcomer to Haxe, so there are lots of places where I will appreciate contributions. Here is a list of things that are very welcome

Haxe Nvim

Write your next Neovim plugin or your personal neovim configuration in Haxe and enjoy a high level language which is type safe.

This library was initially intended to be named "Nvim haxelerator" (and I may rename it at some point) because it will allow you to write Neovim plugins faster and safer. Take advantage of the powerful Haxe compiler and turn frustrating runtime errors your users (probably your future self) will face and that will take you hours to debug into nice compilation time errors that will take you seconds to fix!

Philosophy

We have strong opinions about what this library should be and what should not be. Read about that below.

Prefer enums over magic values

APIs must be for humans to instruct machines, not to talk between machines. Because of that the usage of magic values that have a special meaning is avoided as much as possible. Instead Enums are used in every place it is possible. Haxe has a great feature which is called Abstracts, which allows you to have proper compile-time-only abstractions without any runtime overhead. An example of this is the Buffer type. All the neovim functions that expect a BufferId will not just accept any number, you must provide a proper BufferId (obtained from functions that return a BufferId) or CurrentBuffer. Thanks to the nature of abstract types this disappears after compilation and all what is left are plain numbers.

Advantages over plain Lua

Limitations

Example usage

If you want an example or a bootstrap to start your own neovim plugin using haxe-nvim, take a look at the template plugin. If you want an example of a personal configuration using it, here is kickstart.hx

Acknowledgments

I want to thank Rudy from the Haxe discord channel for his huge help with macros to reduce the overhead of the Lua target.