The build script in the LaTeXTools plugin for Sublime Text editor pops up the console, where the result of the compilation is written.
I would like the console to auto-hide once the compilation is finished and there are no errors (and to stay open otherwise).
I knew how to achieve this with Sublime Text 2. (I think I inserted two lines sublime.active_window().run_command("show_panel", {"panel": "console", "toggle": True}))
somewhere in the build script.)
How to achieve this behavior with Sublime Text 3?
How to (properly) achieve this behavior with Sublime Text 2?
This functionality has now been added natively to the LaTeXTools package, using the hide_build_panel
preference in the LaTeXTools settings file. Check the documentation.
There are four levels of hiding behavior available:
always
if there were no errors
if there were no errors or warnings
never
Extract from the documentation. Possible values:
always: never show the build panel at all
no_errors: only show the build panel if errors occur
no_warnings: only hide the panel if no warnings occur
no_badboxes: only hide the panel if no warnings or badbox messages occur; this only differs from no_warnings if display_bad_boxes is set to true.
never: never hide the build panel. Any other value will be interpreted as the default.
I have no idea what I'm doing, but the following works reasonably well (LaTeXtools revision 2014-3-12).
In the file makePDF.py insert a line
self.window.run_command("hide_panel", {"panel": "output.exec"})
between lines no. 370 and 371 (the definition of the do_finish function).
This probably won't survive LaTeXtools package update..
self.window.run_command("hide_panel", {"panel": "output.exec"})
I added this command in the run(self) method (makePDF.py) after in the "else" block, when asking for errors of the LaTeX run (line 177).
It works perfectly, but won't survive an LaTeXTools package update.
Related
I have configured Ctrl+B to open a file in my browser, but when I press Ctrl+B when the editor is focused on some HTML page, it doesn’t work. Why not?
more details:
what makes me confused is that this ctrl+b works if it is combined to other command such as close, but why not openInBrowser command, so does st2 support this command, how to know whether it support this command or not?
Edit 1:
you may find openInBrowser command in this link http://www.sublimetext.com/docs/commands
Edit 2
#MattDMo what is the corresponding name of command then, i cannot find them in its official document http://www.sublimetext.com/docs/2/
The command you are looking for is open_in_browser, not openInBrowser (which is an old Sublime Text 1 command). So, your keymapping should work with that. However, if you weren't already aware, CtrlB is already mapped to the Build command, used for running build systems. It's not a very good idea to overwrite built-in commands, especially one as important as this one, so I'd suggest changing your keybinding to:
{ "keys": ["ctrl+alt+b"], "command": "open_in_browser" }
This isn't in use by any of the default Sublime commands, although some plugins may use it.
I have a program that uses a file called user.cfg to get its user defined configuration settings. The odd thing is that they chose the syntax for this file to be Tcl (it's not odd that it is Tcl, it's odd they chose the .cfg extension instead of .tcl). So, when I open this file in Sublime Text, it doesn't know what syntax highlighting scheme to choose.
What I would like to do is set the syntax highlighting for user.cfg to Tcl, but not all .cfg files to Tcl.
I have seen this question which is very similar to mine, except in that case the special file name had no extension so Sublime Text knew to assign Ruby highlighting to only that one file. Unfortunately, I have an extension so the solution given there will not work for me.
Is there any known way to get Sublime Text base a highlighting scheme on the full filename?
Take a look at the ApplySyntax plugin.
The previous answer is completely true; however, I thought it would be better to have it here all in one place rather than going on another webpage to find the list of procedure to apply it
Sublime text 3
This is found here
Ensure Package Control is installed. Instructions are found here.
In Sublime Text, press Ctrl+Shift+P (Win, Linux) or Cmd+Shift+P (macOS) to bring up the quick panel and start typing Package Control: Install Package.
Select the command and it will show a list of installable plugins.
Start typing ApplySyntax; when you see it, select it.
Restart to be sure everything is loaded proper.
Enjoy!
I don't know much about eclipse, but one of my juniors asked this. We use checkstyles to scan our code. When we get an error, the file that errored shows in the console display. How do we setup checkstyle and eclipse so that you can click on the class name in the display and go to the file. An example of what we are seeing
[checkstyle] C:\Users\me\Code\RP40\cmcBL\src\main\java\com\foo\bar\client\ProductsDocumentResource.java:98:50: Must have at least one statement.
is there a way to make that clickable?
Use Eclipse-CS, the Checkstyle Eclipse plugin. This will make Checkstyle warnings appear in Eclipse in the 'Problems' view. There, you can click on the entry and it will take you directly to the corresponding line of code.
I was trying some plugins on my Sublime Text yesterday and today I noticed that some commands were missing form my command palette window, namely:
New file into view (Not "new view into file", that one is still there)
Open in Browser as Testing Server(maybe the word "server" here is wrong)
Open in Browser as Development Server(maybe the word "server" here is wrong)
These three were really helpful to me, How can i get them back?
sublime text menu is a json PATH_TO_SUBLIME\Data\Packages\Default\Main.sublime-menu you can edit it or replace
These commands are added by a package called SideBarEnhancements. Install this package and you will get these commands back.
SideBarEnhancements on GitHub
I am trying to get SublimeLinter to enforce pep8 errors as a plugin to sublime text 2. When I install it, it seems to immediately show a small list of errors, but not nearly the full list that I get by running
pep8 file.py
If I look in my sublime text 2 console, then i see the full list of pep8 errors. However, I want these to be shown in the sublime text 2 gui, when you go to "Show Error List."
If I go to "Show Error List," it says I have no lint errors, but I see hundreds of lint errors in the console.
In the package configuration file it has pep8 set to true by default, but doesnt seem to be enforcing all of the errors.
For someone who has used this plugin, how can I get it to list all of the pep8 errors from the main "Show Error List" window instead of the console?
===
Update: After a while of poking around, I have narrowed down. In the SublimeLinter plugin (file python.py) there is a line:
pep8.Checker(filename, good_lines).check_all()
This is what actually runs pep8 on the file. When it encounters an error it is supposed to call the pep8.Checker.report_error function, and there is a custom callback defined in the plugin. However, I have traced it, and I see that it is not being called. The checker is running correctly and producing out. I have examined the pep8 code here https://github.com/jcrocholl/pep8/blob/master/pep8.py, but no luck.
I imagine there is a very simple fix... probably a configuration somewhere. If anyone has insights, that would be appreciated.