Sublime Forum

Calling commands from command line

#1

I’d like to know if it is possible to call commands that have arguments from the command line.
For example this simple command works:

subl --command indent

and it will indent the current line in the active view.
But when I try to call commands that need extra arguments like ‘scroll_lines’ which needs an ‘amount’ argument either nothing happens or I get an “Unable to parse command” error on the console output.
The real use case would be to use Sublimerge as an external diff and merge tool from an other IDE, but the command ‘sublimerge_compare_selected_files’ needs a file list argument and I can’t make it work.
Is it even possible to do this with Sublime Text, and if so what would be the correct syntax?

0 Likes

#2

This works for me:

subl --command "scroll_lines {\"amount\": 10}"
0 Likes

#3

Works perfectly, thank you very much!

0 Likes

#4

It seems that is not working on Linux.

0 Likes

#5

I’m trying to do the same thing. What was the command you used in the end, Daniel? for me so far it doesn’t work.

0 Likes