Sublime Text 3 Build System: Save Console

I installed the build system in Sublime Text 3 to run Matlab files. This works very well:

{"cmd": ["/ usr / local / MATLAB / R2013b / bin / matlab", "-nosplash", "-nodesktop", "-nojvm", "-r \" run ('$ file'); \ ""]}

The problem is that I want Matlab to work in the Sublime console after executing $ file. Is it possible?

Thanks in advance.

+4
source share
2 answers

Well, I finally found a solution that runs the build system in the xterm external terminal. If you use this Sublime, you open the xterm window and start the build system there. This window remains open, i.e. Matlab graph windows will not be closed after code execution. I combined the build system with and without an external terminal into one build system:

{ "cmd": ["/usr/local/MATLAB/R2013b/bin/matlab", "-nosplash", "-nodesktop", "-r \"run('$file');quit;\""], "selector": "source.m", "variants": [ { "name": "xterm", "cmd": ["xterm", "-e", "/usr/local/MATLAB/R2013b/bin/matlab", "-nosplash", "-nodesktop", "-r \"run('$file');\""] } ] } 

and then assigned a user key binding to access the xterm variant easily:

 [ { "keys": ["ctrl+shift+b"], "command": "build", "args": {"variant": "xterm"} } ] 

This xterm solution should also work with any other interpreter that you want to prevent closing after completion of the code.

+6
source

An alternative method is to open both Sublime and Matlab, and then configure the script using AutoHotKey (Windows) or Autokey (Linux), which copies the file name or code for evaluation, and then pastes it into the Matlab command window.

The advantages of this method are as follows:

  • You save all the useful MatLab features as an IDE
  • You can evaluate code fragments (function F9), as well as the entire file

More on Linux or Windows

0
source

Source: https://habr.com/ru/post/958545/


All Articles