Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/onivim/reason-libvim

Reason API for libvim
https://github.com/onivim/reason-libvim

libvim ocaml oni onivim reason reasonml vim

Last synced: 3 months ago
JSON representation

Reason API for libvim

Awesome Lists containing this project

README

        

> __NOTE:__ This is now deprecated - future development is happening in the core [Onivim 2](https://github.com/onivim/oni2) repo.

# reason-libvim
[![Build Status](https://dev.azure.com/onivim/oni2/_apis/build/status/onivim.reason-libvim?branchName=master)](https://dev.azure.com/onivim/oni2/_build/latest?definitionId=5&branchName=master)

Reason API for [libvim](https://github.com/onivim/libvim) - an abstraction of Vim as an API.

## Usage

- Call `vimInit()` before anything else

- Call `vimInput("i")` or `vimInput("")` to send keystrokes
- Call `vimCommand("%s/hello/world/g")` to execute Ex commands
- Introspect the state with the API, for example:

```
vimInit();

vimCommand("e ./aBigFile.txt");

/* Use 'G' to move to the end of the file */
vimInput("G");

/* Print line position */
print_endline ("Cursor is at line: " ++ string_of_int(Cursor.getLine()));

/* Type a at the beginning of the line */
vimInput("I");
vimInput("a");
```

For more example usage, see the [test cases](https://github.com/onivim/reason-libvim/tree/master/test)

## Documentation

Documentation is available [here](https://onivim.github.io/reason-libvim/libvim/Vim/index.html)

## License

[MIT License](./LICENSE)

Copyright 2019 Outrun Labs, LLC