How to define vim commands


#1

I’v seen how to set keybindings but what I would like is to define some commands.

For example, I’d like for :vs to run “duplicate view”.

Or something like :tabedit and file name, etc.


#2

I believe it is defined in the .vimrc file
A quick google shows http://vim.wikia.com/wiki/Open_vimrc_file
and what looks to be a cool project : https://github.com/amix/vimrc


#3

I understood c9 ignored vimrc


#4

Sorry I have no idea on that one. I answered on my basic Linux knowledge. I suggest trying it and see if it works or not. I’m interested to know.


#5

@dwaynemac vim commands are defined in https://github.com/c9/c9.ide.ace.keymaps/blob/master/cli.js#L282 and https://github.com/c9/core/blob/master/node_modules/ace/lib/ace/keyboard/vim.js#L1
It should be possible to add cli commands using init script and api provided from these two plugins, but :vs and :tabedit are default commands in vim so adding them to the plugin would be better.