sublimetext3

Save the edit when running a Sublime Text 3 plugin

只愿长相守 提交于 2019-12-04 19:17:30
问题 For understanding what I'm trying to achieve : printing delayed text in another view... I'm trying to make this sublime text 3 plugin run properly I want to call multiple method of my class using the edit passed in parameter of my run method as so : # sample code, nothing real class MyCommandClass(sublime_plugin.TextCommand): myEdit = None def run(self, edit): self.myEdit = edit # stuff self.myMethod() def myMethod(self): # use self.myEdit ... And I try to use it later on another method, but

Sublime Text 3 LaTeXTools plugin won't compile on Ubuntu

扶醉桌前 提交于 2019-12-04 18:58:24
I've been a fan of the LaTeXTools plugin for Sublime Text for a while. However, the author recently updated the plugin, and it will no longer build my LaTeX documents. I'm wondering if anyone else has had this problem and knows how to fix it? Here's the full console output that I'm getting: [Compiling /home/tingley/Dropbox/testtex.tex] TraditionalBuilder: Invoking latexmk... COULD NOT COMPILE! Attempted command:latexmk -cd -e $pdflatex = 'pdflatex -interaction=nonstopmode -synctex=1 %S %O' -f -pdf testtex.tex Build engine: Traditional Builder I'm using Sublime Text 3 on Ubuntu 13.10 with

Automatically select pasted text in Sublime Text 3

点点圈 提交于 2019-12-04 18:33:17
Is there any way, plugin, macro or something to make Sublime Text 3 automatically select the text that was just pasted? I need to copy and paste some JSON data, but the pasted text is never in line with the surrounding text. Paste and indent -feature does not work properly for this. What does work is the reindent feature, but it requires me to select a block of text and pressing a hotkey. So after pasting I would benefit for having the just pasted block of text being automatically selected, so I can just press the reindent hotkey to properly indent what I pasted. Furthermore, it would be even

How to change background color of Sublime Text 3?

大兔子大兔子 提交于 2019-12-04 18:21:46
I am using Sublime Text 3 Build 3154. I am currently using Material Theme UI Darker. The problem is I don't know to make the background color (the area where we code) a bit darker. Please help me how can I do this? I enabled contrast mode for sidebar, status bar and title bar. I want to make the background color of where we code the same as contrast mode. Please help. Settings of my Sublime Text 3: { "always_show_minimap_viewport": true, "background": "red", "bold_folder_labels": true, "color_scheme": "Packages/Material Theme/schemes/Material-Theme-Darker.tmTheme", "font_size": 16, "highlight

How do I set sublime text to auto detect a file type after setting it once?

梦想的初衷 提交于 2019-12-04 17:13:08
问题 for instance I have a .zsh file that I would like to always open in sublime as a "Shell Script (bash)" file type. Currently it defaults back to a text file format even when I change and reopen it. 回答1: Look in the bottom right of the window. Click the file type name. Let's assume it is 'Shell Script (Bash)'. Notice that the first option is 'Open all with current extension as...' Follow the obvious steps from there and you should be all set. 来源: https://stackoverflow.com/questions/27454555/how

Build system for Qt in Sublime Text 3 not working

天大地大妈咪最大 提交于 2019-12-04 16:37:19
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? You could make a bash file with all the commands in it, and set the command to that. { "cmd" : ["my_build.sh"], "working_dir": "${project_path:${folder}}", } # my_build.sh qmake -project qmake make lnthomas

Enable automatic commenting in Sublime Text for a custom syntax

空扰寡人 提交于 2019-12-04 16:30:26
问题 I have created a .tmLanuage file for a custom language in Sublime Text. Everything is working well, except that I can't seem to get automatic commenting to work. I can't seem to find anything in the Sublime Text docs or on Google about how to do this, but perhaps this is because I am not using the right keywords. Let me explain what I mean. Let's say I have the following C code: int i = 1; i += 2; If I highlight this in Sublime Text and press ctrl+/ , it gets changed to // int i = 1; // i +=

How do configure sublime to always convert to unix line endings on save?

送分小仙女□ 提交于 2019-12-04 16:21:19
I want all files that I ever save in Sublime Text to be in Unix line ending format, even when I open files that were originally saved in a different format that I later edited in Sublime? Simply setting "default_line_ending": "unix" is not enough, because that doesn't convert Windows files as I mentioned. How do I do that? Here's a quick plugin to do the job: import sublime_plugin class SetUnixLineEndingsCommand(sublime_plugin.TextCommand): def run(self, edit): self.view.set_line_endings("unix") class SetLineEndings(sublime_plugin.EventListener): def on_pre_save(self, view): view.run_command(

Sublime Text 3: how to bind a shortcut to a specific file extension?

隐身守侯 提交于 2019-12-04 16:11:47
I would like to customize shortcut, but apply them only to a specific extension. For example, "jump to matching bracket" -> works in JS files -> customly bound to ctrl + m , "go to matching tag pair" (emmet) -> works in HTML files -> I would like to ctrl + m also here, but doesn't work (ST3 understand "jump to matching bracket" which doesn't apply here). I was wondering if specializing a shortcut to a specific extension would do the trick? Apparently you can try something like this: [ { "keys": ["ctrl+x", "ctrl+i"], "command": "insert_snippet", "args": {"name": "Packages/User/mysnippet.sublime

How to create Sublime Text 3 build system which reads shebang

落爺英雄遲暮 提交于 2019-12-04 14:06:14
How can I create a build system in Sublime Text 3 where "cmd" is replaced with a shebang if it exists? More specifically, is there a way to alter the Python build system to use the version of Python specified in the shebang, and use a default if no shebang is present? Sublime build systems have an option named target which specifies a WindowCommand that is to be invoked to perform the build. By default this is the internal exec command. You can create your own command that would examine the file for a shebang and use that interpreter or some default otherwise. For example (caveat: I'm not