Fire VIM mode events

editor
sdk

#1

I want to use commands.exec() to fire an event related to vim mode. For example when a button is clicked
commands.exec(“vim_change_to_normal_mode”) are there any commands related to VIM mode is what I am asking I guess.


#2

So what I really want to know is if there is a way to extend VIM mode or should I start building a VIM mode package/plugin???


#3

There is no way to do this via commands atm.

But you could add a command that calls https://github.com/c9/core/blob/master/node_modules/ace/lib/ace/keyboard/vim.js#L6001

and then call it like commands.exec('vim_action', {key: "esc"})


#4

Thanks so much. This is exactly what I wanted.


#5

So what I really want to know is if there is a way to extend VIM mode or should I start building a VIM mode package/plugin???

depends on how you want to extend it, for some things it would be better to modify vim mode code in https://github.com/ajaxorg/ace


#6

I would like to implement the :edit VIM-command. I would have to be able to access the tabManager and some how link it to VIM


#7

For cli commands take a look at https://github.com/c9/c9.ide.ace.keymaps/blob/master/cli.js#L213.
there is also https://github.com/c9/core/blob/master/node_modules/ace/lib/ace/keyboard/vim.js#L1010, but it is not enabled for now