sublimetext3

Build system for Qt in Sublime Text 3 not working

[亡魂溺海] 提交于 2019-12-06 09:53:28
问题 I have the following build system file which not working. { "cmd" : ["qmake", "-project"], "cmd" : ["qmake"], "cmd" : ["make"], "working_dir": "${project_path:${folder}}", } No files are generated. Usually following files should be created: qmake -project generates a .pro file. qmake generates the makefile make generates the executable file How can I run multiple commands in the build file? 回答1: You could make a bash file with all the commands in it, and set the command to that. { "cmd" : [

sublime plugin: find and select text

若如初见. 提交于 2019-12-06 08:31:42
问题 I got plugin for sublime text 3 that let me move cursor to line by its number: import sublime, sublime_plugin class prompt_goto_lineCommand(sublime_plugin.WindowCommand): def run(self): self.window.show_input_panel("Goto Line:", "", self.on_done, None, None) pass def on_done(self, text): try: line = int(text) if self.window.active_view(): self.window.active_view().run_command("goto_line", {"line": line} ) except ValueError: pass class go_to_lineCommand(sublime_plugin.TextCommand): def run

Sublime Text 3为新的扩展文件类型实现语法高亮

只愿长相守 提交于 2019-12-06 08:20:33
Sublime Text对于一些常见的扩展名的文件都能够识别并选择Sublime Text内置对应的高亮语法,但是对于一些使用频率比较少的扩展名文件就无法识别,Sublime Text打开此类文件后默认显示成普通文本,没有语法高亮。 虽然我们可以在打开文件后点击右下角的Plain Text,在出现的文件格式中选择自己要显示的语法类型。 但是这样每次打开都需要手动进行一番设置,我们需要一种一劳永逸的方法对此类文件类型进行自动选择语法高亮。 Sublime Text 2版本添加扩展名文件语法是在Data\Packages目录下的文件类型目录里的文件类型语言文件,如XML\XML.tmlanguage。然后打开该文件,在<key>fileTypes</key>下面按照原来的例子添加新的文件类型保存即可。 而Sublime Text 3的目录结构和2的不太一样,使用2的方法就不行了。那么有2中方法可以实现,下面的其一方法在2中也可以使用,不同是的下面的其二方法。 其一:打开文件后点击右下角的Plain Text,在出现的文件格式中选择open all with current extension as… ->"需要显示的语法类型"。这样以后打开这个类型的文件就会自动进行语法高亮了。 其二:在Data\Packages\User目录下手动生成一个名字叫XXX.sublime

How do I change the transparent image background grid in sublime text to different colors

Deadly 提交于 2019-12-06 07:16:39
When I get a preview of transparent PNGs in Sublime text - I find it hard to see the content if it is white because of the grey chequer board pattern. Is there a way for me to configure that? I need to change it to darker colours. Thanks in advance. 来源: https://stackoverflow.com/questions/43983985/how-do-i-change-the-transparent-image-background-grid-in-sublime-text-to-differe

Regex to find strings separated by comma, and then add quotes?

跟風遠走 提交于 2019-12-06 06:15:55
I'm using Sublime Text 3 and have a CSV file with 1200 tax rates in this format: Code,Country,State,Zip/Post Code,Rate,default US-NY-10001-Rate 1,US,NY,10001,0.08875, .... I need a regex to find each value separated by a comma so I can then wrap quotes around it. Is this possible? Find the following regular expression (using capturing group and backreference ): ([^,\n]+) and replace it with: "\1" 来源: https://stackoverflow.com/questions/24741214/regex-to-find-strings-separated-by-comma-and-then-add-quotes

get current file name from sublime_plugin.WindowCommand

痴心易碎 提交于 2019-12-06 06:09:31
I develop plugin for sublime text 3 . And want to get currently opened file path ... absolute1 = self.window.view.file_name() ... where self is sublime_plugin.WindowCommand But fail: AttributeError: 'Window' object has no attribute 'view' Full code of plugin: import sublime, sublime_plugin import re, os, os.path class OpenrelCommand(sublime_plugin.WindowCommand): def run(self): relative = sublime.get_clipboard() absolute1 = self.window.view.file_name() absolute2 = os.path.normpath(os.path.join(os.path.dirname(absolute1), relative)) self.window.open_file(absolute2) def is_enabled(self): return

How to edit built in command behavior

99封情书 提交于 2019-12-06 05:39:14
I want to edit find_under_expand ( ctrl+d ) to consider hyphenated words, as single words. So when I try to replace all instance of var a , it shouldn't match substrings of "a" in words like a-b , which it currently does. I'm assuming find_under_expand wraps your current selection in regex boundaries like this: \ba\b I need it to wrap in something like this: \b(?<!-)a(?!-)\b Is the find_under_expand command's source available to edit? Or do I have to rewrite the whole thing? I'm not sure where to begin. MattDMo Sublime's commands are implemented in one of several ways: as macros , as plugins ,

How to enable sublime text to take first line as file name while saving?

纵饮孤独 提交于 2019-12-06 05:30:46
Earlier the Sublime used to take first line as file name by default but now it's "untitled". Is there a way to enable it or is there a plugin for that? Thanks The first line is only used as the file name for unsaved files when the syntax is set to Plain Text. As soon as you change the syntax highlighting and type something, it will change the tab name to "untitled". The implementation for this is in the Default package, set_unsaved_view_name.py file. To get it to work for all syntaxes: Install PackageResourceViewer through Package Control if it is not already installed Open Command Palette

Boundary sensitive Ctrl+D in Sublime Text 3(windows)

柔情痞子 提交于 2019-12-06 04:33:46
I have same requirement with maček I borrow maček's example here: my code pic1 : I select the first instance of es and see this (using cursor select) pic2 : Perfect! However, when I tap ctrl + D a couple times, it will end up selecting this pic3 : The answer from Taylan says If you put your cursor (caret) on the word but not select it and then press Cmd + d it is going to select like in 2nd image. Quite confusing. In windows, there is always a input cursor (a flashing vertical line, maybe call as caret) in sublime, Without selecting any thing type ctrl + D would select the char nearby the

Sass compiler not working in sublime text 3

放肆的年华 提交于 2019-12-06 03:45:53
问题 I have Sass installed on my Windows 7 machine and I'm trying to compile some scss. Each time, I get the following output: 'sass' is not recognized as an internal or external command, operable program or batch file. [Finished in 0.2s with exit code 1] [cmd: ['sass', '--update', 'W:\\exocet\\web\\build\\mirror\\css\\style.scss:W:\\exocet\\web\\build\\mirror\\css/style.css', '--stop-on-error', '--no-cache']] [dir: W:\exocet\web\build\mirror\css] [path: C:\Windows\system32;C:\Windows;C:\Windows