sublimetext

Sublime does not see env variables

依然范特西╮ 提交于 2019-12-25 05:32:10
问题 When running sublime from desctop it does not see my PERL5LIB environment variable. When running it from terminal - everithing is OK. I set my variables in .bashrc and .bash_profile. import os >>> os.environ['SHELL'] '/bin/bash' >>> os.environ['PERL5LIB'] Traceback (most recent call last): File "<string>", line 1, in <module> File "./os.py", line 676, in __getitem__ KeyError: 'PERL5LIB' this makes trouble with linting and build system - I can not link and build becase of perl does not see

Sublime Text Open New Window API

六眼飞鱼酱① 提交于 2019-12-25 05:16:24
问题 I'm writing a sublime text plugin. I'm trying open few files in new window. In sublime text API reference I found a way to open files with window.open_file(filepath) but I didn't find anything for opening a new window. Can someone please point me to it. I know it's a dumb question but blame it on inadequate documentation :) 回答1: You can use new_window command. sublime.run_command("new_window") sublime.active_window().open_file(filepath) By the way, you can find lots of useful information via

Duplicate line and comment out old one

我与影子孤独终老i 提交于 2019-12-25 03:17:12
问题 I often need to edit a line but comment out the old one. Is it possible to create a key binding for these commands in Sublime Text 2? duplicate current line comment out the top line move the cursor to the bottom line 回答1: Assuming the comment syntax is defined for the file type, you can use a simple macro (though even if it's not you could do it, the macro would just be a little more involved). Anyways, save the following in Packages/User as whatever you like. Be sure the extension is

How to jump into next Tag using sublime 3 short cut?

只愿长相守 提交于 2019-12-25 03:15:08
问题 Good day, I have a bunch of <li></li> on my html file. Is there any keyboard shortcut so I can go to next LI without clicking or pressing key many time. for example i have 3 li element, if I am done typing on my first (li) <li>done</li >, then how can i go to next pair of <li></li> " without pressing the -> key or down key many times to be able to type on next <li> pair? Thank you for your tips :) Its just kind of tiring if done often. specially on tables and list items. 回答1: In Emmet

Where does sublime store the last cursor position of a previosuly opened file?

。_饼干妹妹 提交于 2019-12-24 21:28:49
问题 I would like to export a list of last opened files (tabs) and the last cursor position for each file, in Sublime editor. I can easily parse the session file called Session.sublime_session located in the installation sub-path: <install path>/Data/Local/ (in Windows), to get the file names. But looking in that file, there are no obvious line numbers to be found. Or did I miss something? Where is the last cursor position stored? UPDATE I now see that it is stored in the JSON field called

Move line to next section with SublimeText

*爱你&永不变心* 提交于 2019-12-24 20:30:04
问题 I'm looking for a way to move a line to the "next section" with SublimeText. It could be in the "next paragraph" if it's text (see below), in the "next node" if it's XML, in the "next code block" if it's code, etc. Currently I'm using CTRL SHIFT DOWN ARROW many times to move it to the next section, but I think SublimeText might have this feature out-of-the-box. Example of main use case: &section1 abcdef ghijkl <--- if the cursor is in this line, pressing CTRL+DOWN would move this line...

Prevent Sublime Text from overwriting .sublime-project

隐身守侯 提交于 2019-12-24 16:14:24
问题 Running Sublime Text 3 with the Anaconda IDE package on Mac OS X, it appears that when I edit the .sublime-project file, for some reason some of the changes will be removed after some time. Any ideas how to prevent this? Before { "build_systems": [ { "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)", "name": "Anaconda Python Builder", "selector": "source.python", "shell_cmd": "~/anaconda/envs/test/bin/python -u \"$file\"", "env": { "PYTHONPATH": "/Users/nyx/test" } } ], After env setting

Can Sublime text 2 Follow path in a file?

六眼飞鱼酱① 提交于 2019-12-24 15:32:13
问题 Is it possible to open a linked file in sublime text 2 ? What I mean is, imagine I have the following code : <?php require_once( 'include/const-inc.php' ); require_once( 'include/db-inc.php' ); require_once( 'classes/dummy-class.php' ); ?> I would love to be able to click on the files to open the corresponding file. Sublime text knows the local file path so should be able to resolve the corresponding files paths no? 回答1: Check out the Open-Include plugin, available via Package Control. It

Reorder Regex Match Groups

若如初见. 提交于 2019-12-24 14:42:30
问题 I am writing a Sublime Text 2 build configuration for grails, which includes a regular expression (perl style) to parse error messages in to file, line, column, and message parts. The errors come from the grails CLI in the following format: {Project_Directory}/SourceFile.groovy: 19: errror_message @ line 19, column 5. My current regex matches all four parts, but Sublime seems to require that the matches occur in order, that is match group 1 = file name, 2 = line number, 3 = column number, 4 =

Python equivalent to Bash: `latexmk file.tex && latexmk -c file.tex`

我的未来我决定 提交于 2019-12-24 13:57:18
问题 The issue of converting && in Bash to Python has been resolved with the assistance of Xymostech, whose help is greatly appreciated -- thank you! The command line at issue (from the Bash terminal) is: latexmk file.tex && latexmk -c file.tex . Here is the plugin if anyone is interested: https://github.com/lawlist/ST2-plugin-latexmk-save-build-clean 回答1: The && is a feature that is supported by bash. You can do the same thing in python though, using subprocess 's check_call : import subprocess