sublimetext2

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

Sublime Text 2 + SublimeREPL allowing user input

时光怂恿深爱的人放手 提交于 2019-12-24 13:19:12
问题 I'd like to set up Sublime Text 2 (or 3 if recommended) to allow user input (raw_input() or input() within the files.). To clarify, I've had this work before! I want to be able to write and execute all code within one window/tab. I have installed sublimeREPL correctly but yet whenever I use either raw_input() or input() I receive the following error: EOFERROR: EOF when reading a line I've had it setup correctly and it worked perfectly before, but it's been a long time and I cannot reproduce

Sublime starts without menu bar

瘦欲@ 提交于 2019-12-24 12:38:16
问题 Under Ubuntu in a VirtualBox I have installed Sublime in /opt and created a link (ln) in /usr/bin called sublime When I just call sublime from a terminal window or using the Ubunto key in the task bar Sublime starts without the menu bar in the top of the window. (So it is impossible to a menu to save e.g.) When I start sublime with sudo sublime then everything is ok, but then I need to give the password with every start of the program. How can I just start the program without sudo? 回答1: Try

Get bash output with python

Deadly 提交于 2019-12-24 11:14:20
问题 I'm trying to make a simple command that will let me run bash fully in Python, including output strings. This function worked great on systems I use at my job: import subprocess def run(command): output = subprocess.check_output(command, shell=True) return output However, now I'm using it at home and the PATH variable doesn't match the one in my Terminal. So when I execute run('ls') I get this: /bin/sh: ls: command not found Which makes sense because, nonsensically, the PATH I get from

Why doesn’t this hotkey configuration for Sublime Text work?

删除回忆录丶 提交于 2019-12-24 10:39:42
问题 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

How do I prevent Sublime Text 3 from auto-indenting a line as a one off

不打扰是莪最后的温柔 提交于 2019-12-24 03:44:14
问题 When I'm editing HTML or CSS in Sublime Text 3 the lines auto-indent when I hit the [ENTER] key, which generally is very useful. On occasion I find myself wanting to paste a line of markup which is already indented, and this results in double indentation. Is there some other key combination along with the [ENTER] key that prevents the next line from auto-indenting and instead returns the curson to the very beginning of the line? Please note I don't want to turn off auto-indent on a global

Regex lookahead/lookbehind match for SQL script

有些话、适合烂在心里 提交于 2019-12-24 00:38:49
问题 I'm trying to analyse some SQLCMD scripts for code quality tests. I have a regex not working as expected: ^(\s*)USE (\[?)(?<![master|\$])(.)+(\]?) I'm trying to match: Strings that start with USE (ignore whitespace) Followed by optional square bracket Followed by 1 or more non-whitespace characters. EXCEPT where that text is "master" (case insensitive) OR EXCEPT where that that text is a $ symbol Expected results: USE [master] - don't match USE [$(CompiledDatabaseName)] - don't match USE

Editing Docker container FS using Atom/Sublime-Text?

两盒软妹~` 提交于 2019-12-23 22:07:04
问题 I'm running OSX and Docker with the help of boot2docker. From my understanding boot2docker is a lightweight linux distro that is running the docker containers. I have some Ubuntu containers that I use to run and test projects that should specifically run well on Linux. However every small code change from my host text editor of choice, requires me to re-build image and re-run the container. Run the app and confirm that the change I made didn't break something. Is there a way for me to open a

Transpose of a row vector in Octave causing problems with string escape character

試著忘記壹切 提交于 2019-12-23 19:22:39
问题 In Sublime, I'm trying to take the transpose of a row vector in an Octave file as such: y = [4, 5, 6]; y_transpose = y'; But whenever I try to run this in Octave, it acts as if introduction of the transpose operator (the ') is the beginning of a string, and ignores the following lines of code. How can I remedy this? 回答1: I don't know why it isn't working. ' is actually listed as an operator in the docs. But as a workaround, you could use the transpose function. y = [4, 5, 6]; y_transpose =