How to create new command to execute a batch file with Sublime Text?

Aminadav Glickshtein

I need to create a new "shortcut" command in Sublime Text to run a BAT file.

I know how to use build_systems and even build_systems per project.

I want to add the command to the command palette list (in the image), and to bind a hot-key for that.

enter image description here

How do I do that?

(I'd prefer not using Python for this)

Aminadav Glickshtein

Here is my answer for this:

The steps to follow

  • Install edit-command-palette plugin for Sublime Text (it is easy, so I won't describe how);
  • Edit the command file: from menu "Preferences" select "Command - User";
  • Edit the key bindings file to add hotkeys: menu "Preferences" select "Key Bindings - User".

The command file (second step):

[
    {
        "caption": "moyshale",
        "command":"exec",
        "args": {"cmd": "c:\\drive\\1file\\cp.bat"}
    }
]

Adding a hot-key (third step):

"keys": ["ctrl+shift+y"],
        "command":"exec",
        "args": {"cmd": "c:\\drive\\1file\\cp.bat"}

(It's basically the same, just needs to change keys and caption)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to create macro in sublime text 3 with saveAs and close file command?

From Dev

How to execute the same vi command in sublime text 3?

From Dev

Sublime Text build batch file

From Dev

How to write, and use, a text batch command file

From Dev

How to create batch file for copy command?

From Dev

How to create batch file using command line?

From Dev

How to direct to file folder and execute specific file using batch command

From Dev

How to execute cmd command from text file?

From Dev

How do you execute a lua file in sublime text 3?

From Dev

edit-and-execute-command bash with sublime text

From Dev

How to interrupt a running Batch file, execute a command in its environment, then continue?

From Dev

How to set a go to a directory and execute a command in a batch file?

From Dev

How to create new JavaScript snippet for Sublime Text 3?

From Dev

Create a vbs/batch file to edit text file and create a new text file

From Dev

Command to copy a line from text and create a new text file

From Dev

How can I open the current file in a new pane in sublime text?

From Dev

Create new batch file from batch file

From Dev

Create new batch file from batch file

From Dev

How to get the content of a text file using command FOR on a batch file

From Dev

Creating new bash command for Sublime Text 2

From Dev

Is there a way to create new tab (aka: “untitled”) from the command line in Sublime Text?

From Dev

How to make shell to execute command file without making a new process?

From Dev

How to create a new text file using Python

From Dev

How to create a batch file that will delete lines in a text file

From Dev

Windows start command not able to execute batch file

From Dev

Execute Batch File without Command line visible

From Dev

Color Command Does Not Execute In Batch File

From Dev

How to write standard error in text file using batch command

From Dev

How to create default PHP file with windows batch command

Related Related

  1. 1

    How to create macro in sublime text 3 with saveAs and close file command?

  2. 2

    How to execute the same vi command in sublime text 3?

  3. 3

    Sublime Text build batch file

  4. 4

    How to write, and use, a text batch command file

  5. 5

    How to create batch file for copy command?

  6. 6

    How to create batch file using command line?

  7. 7

    How to direct to file folder and execute specific file using batch command

  8. 8

    How to execute cmd command from text file?

  9. 9

    How do you execute a lua file in sublime text 3?

  10. 10

    edit-and-execute-command bash with sublime text

  11. 11

    How to interrupt a running Batch file, execute a command in its environment, then continue?

  12. 12

    How to set a go to a directory and execute a command in a batch file?

  13. 13

    How to create new JavaScript snippet for Sublime Text 3?

  14. 14

    Create a vbs/batch file to edit text file and create a new text file

  15. 15

    Command to copy a line from text and create a new text file

  16. 16

    How can I open the current file in a new pane in sublime text?

  17. 17

    Create new batch file from batch file

  18. 18

    Create new batch file from batch file

  19. 19

    How to get the content of a text file using command FOR on a batch file

  20. 20

    Creating new bash command for Sublime Text 2

  21. 21

    Is there a way to create new tab (aka: “untitled”) from the command line in Sublime Text?

  22. 22

    How to make shell to execute command file without making a new process?

  23. 23

    How to create a new text file using Python

  24. 24

    How to create a batch file that will delete lines in a text file

  25. 25

    Windows start command not able to execute batch file

  26. 26

    Execute Batch File without Command line visible

  27. 27

    Color Command Does Not Execute In Batch File

  28. 28

    How to write standard error in text file using batch command

  29. 29

    How to create default PHP file with windows batch command

HotTag

Archive