Need help with idris-vimscript?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

owickstrom
128 Stars 4 Forks Other 91 Commits 16 Opened issues

Description

Compile Idris to Vimscript, like you always wanted.

Services available

!
?

Need anything else?

Contributors list

No Data

Idris Vimscript!

The good stuff.

Please note that this is very experimental. For example, the Idris

Integer
type, usually represented as an arbitrary-precision integer, is represented using the Vim number type.

It's a hack, deal with it. 😎

Or, better still:

Contribute!

This is a fun project, and the authors aren't expert compiler writers: we need your help! There are three languages (Idris, Haskell, and documentation!) you can contribute in, and knowledge of Vimscript is useful too. Specifically:

  • if you know a little Idris, you can add bindings for more of the Vim API
  • if you know some Haskell, you can add new or improve existing optimisations, make the generated code better, or improve performance
  • if you can do Vimscript, we'd like you to help us generate better, faster, smaller code that Vimscript users can understand somewhat well
  • The Idris REPL itself lets people browse documentation, so even a few comments on key functions can make users' day-to-day lives much easier when they're discovering the API.

Good first issues for new contributors are tagged on our issue tracker.

If you have an idea in mind, open a PR!

Finally, if you write a Vim plugin using Idris Vimscript, let us know!

Examples

Many examples of what is possible are present in the examples/ directory, but this will give you an idea of the state of the art:

module Main

import Vimscript.FFI import Vimscript.List import Vimscript.Builtin

main : VIM_IO () main = do l

Build and Install

Install the code generator:

shell
stack install # or cabal install

Install the Vimscript library for Idris:

idris --install vimscript.ipkg

Build and Run Examples

The project comes accompanied by a convenience

make
script that will compile all the Idris files in
examples
folder.
make
vim examples/loop.vim
# :source %             (in Vim)

In order to build a single example, you can compile it as below (this is what

make
is doing).
idris examples/myfile.idr -i lib/ --codegen vim -o examples/myfile.vim

License

BSD 3 License. Based on original work by Edwin Brady.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.