Sublime Forum

Keymap command: $TM_FILENAME or self.view.file_name()

#1

Looking to create a keymap command string latexmk -c $TM_FILENAME or self.view.file_name() that will run (under the hood) and automatically recognize the name of the open file that has keyboard focus.

I have not yet figured out a method of creating a keymap that specifically uses $TM_FILENAME or self.view.file_name(). I have, however, been able to create a plugin that does:

viewtopic.php?f=2&t=11492

0 Likes

#2

as far as I know, there is a plugin named Terminal for ST2 that will open the terminal you specified which set the working directory as the directory which the current focused file resides in.
the default shortcut is Shift + Ctrl + T

0 Likes

#3

Great – thank you (myunlessor) – I’ve installed that terminal plugin, and it does indeed open to the working directory.

0 Likes

#4

I found a package for running arbitrary shell commands from within Sublime (i.e., Shell-Turtlestein).

I modified the file Shell Turtlestein.sublime-settings to add the paths needed, and I can now run a shell command within Sublime.

{ // Override these in your own // `Packages/User/Shell Turtlestein.sublime-settings` file. "surround_cmd": "", ""], "exec_args": {"path": "/usr/texbin:/usr/local/bin:$PATH"}, "cmd_settings": ], "input_widget": { // overridden for silly non-unixy OSes "syntax": "Packages/ShellScript/Shell-Unix-Generic.tmLanguage" } }

0 Likes