Home Download Buy Blog Forum Support

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

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

Postby lawlist on Thu Mar 07, 2013 6:11 am

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
Last edited by lawlist on Sat Mar 23, 2013 8:19 pm, edited 7 times in total.
lawlist
 
Posts: 54
Joined: Thu Feb 21, 2013 6:47 pm

Re: Keyboard shortcut | terminal | command+file+enter

Postby myunlessor on Thu Mar 07, 2013 7:21 am

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`
myunlessor
 
Posts: 19
Joined: Thu Mar 07, 2013 3:07 am

Re: Keyboard shortcut | terminal | command+file+enter

Postby lawlist on Thu Mar 07, 2013 4:49 pm

Great -- thank you (myunlessor) -- I've installed that terminal plugin, and it does indeed open to the working directory.
Last edited by lawlist on Sun Mar 10, 2013 9:58 pm, edited 2 times in total.
lawlist
 
Posts: 54
Joined: Thu Feb 21, 2013 6:47 pm

Re: Keyboard shortcut | terminal | command+file+enter

Postby lawlist on Thu Mar 07, 2013 8:10 pm

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.

Code: Select all
{
   // 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"
   }
}
Last edited by lawlist on Sat Mar 23, 2013 8:09 pm, edited 2 times in total.
lawlist
 
Posts: 54
Joined: Thu Feb 21, 2013 6:47 pm


Return to General Discussion

Who is online

Users browsing this forum: elishnevsky, Majestic-12 [Bot] and 25 guests