NOTE: This is now deprecated - future development is happening in the core Onivim 2 repo.
Reason API for libvim - an abstraction of Vim as an API.
Call
vimInit()before anything elseCall
vimInput("i")orvimInput("<esc>")to send keystrokesCall
vimCommand("%s/hello/world/g")to execute Ex commandsIntrospect 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
Documentation is available here
Copyright 2019 Outrun Labs, LLC