vim-force.com icon indicating copy to clipboard operation
vim-force.com copied to clipboard

A doubt regarding vim command line

Open sankaran1984 opened this issue 9 years ago • 3 comments

Hi Andrew,

Thanks a lot for the great plugin. I'm trying to run force.com vim commands from console directly. i,e, for ex, vim -c ApexInitProject (or) vim -c ApexCompare

It's working fine. But, After the command execution, it ends up in VI editor. Is there anyway, to redirect output of vim directly to Console. So that, VI doesn't get open at all ?

sankaran1984 avatar Aug 06 '16 10:08 sankaran1984

Hello @sankaran1984

not 100% sure that I understood your question correctly...

On the one hand it looks like you want to interact with SFDC from a command-line or script type scenario and do not need interactiveness. But on the other hand you mentioned :ApexInitProject and : ApexCompare which are very much interactive commands and do not make much sense without interactive user input.

Is there anyway, to redirect output of vim directly to Console. 
So that, VI doesn't get open at all 

You could use tooling-force.com.jar directly without going through vim/vim-force.com. To find out what command line parameters are needed for specific command you could either

  • run specific command from vim and note what tooling-force.com.jar command line parameters vim-force.com generates
  • or run java -jar tooling-force.com.jar to get the list of supported commands and then run java -jar tooling-force.com.jar --help=<action-name> to get details about specific command.

Note however that some vim-force.com commands (e.g. :ApexInitProject) make no sense outside of vim and are written in pure vimL, so can not be run outside of vim.

If this does not answer your question then you may need to mention your use case in more details.

neowit avatar Aug 07 '16 12:08 neowit

HI @neowit

Oh.. ok. . Acutally, i like all your VIM Commands ApexInitProject, ApexCompare, Apex*.... it covers most of the workflow a developer needs on day to day job..

As the same time, i felt it would be better if it possible to run directly from console without being in VI editor. Also, i feel invoking commands inside the editor has few benefits like it could guess what is the current working project, access to all buffers, etc.. So, invoking from console, you need to pass project, file details explicitly to Apex* Commands.

If you think, it's not designed in that way, no issues. i can develop something similiar.

On tooling jar file, i knew about that. I have pretty much gone through complete source code. Thanks for your reply & great work again.

sankaran1984 avatar Aug 07 '16 19:08 sankaran1984

If you think, it's not designed in that way, no issues. i can develop something similiar.

Yes, vim-force.com is a vim plugin and meant to be used inside vim. It was not designed to be run from console.

neowit avatar Aug 08 '16 14:08 neowit