sublimetext

Sublime Text 2 plugin to sort your functions alphabetically

柔情痞子 提交于 2020-01-03 14:13:54
问题 I am building many functions in my application and now I want to alphabetise them. Is there any function in Sublime Text 2 that will do this automatiaclly. It should change these public function login_1() { ........ } public function about() { ........ } public function close() { ........ } Into these public function about() { ........ } public function close() { ........ } public function login_1() { ........ } 回答1: I wonder if you are using PHP, from the syntax you provided it seems you do.

Sublime Text snippet to insert PSR-0 namespace

笑着哭i 提交于 2020-01-02 09:57:57
问题 I'm trying to make a Sublime Text-snippet that inserts a PHP boilerplate class, in the lines of: <?php namespace Namespace\Subnamespace; class TestClass { public function __construct() { //code... } } When using PHP-FIG standards(or similar), both the namespace and classname can be obtained from the path of the file. The file in the example above would be placed in /Users/Projects/Whatever/src/Namespace/Subnamespace/TestClass.php . This is what I have so far: <snippet> <content><![CDATA[ <

sublime text 3 use python 3.3 as compiler

余生颓废 提交于 2020-01-02 09:52:45
问题 Just purchased sublime 3. I'm wondering how I can compile in python 3 and not in python 2. When I execute import sys print(sys.version) I receive "2.7.3 |EPD_free 7.3-2 (32-bit)| (default, Apr 12 2012, 14:30:37) [MSC v.1500 32 bit (Intel)]" I've been stuck for the last 2 or 3 hours. I know it has something to do with builds but it just doesn't seem to be clicking. Any help would be greatly appreciated. Thanks! 回答1: The Sublime Text Python builder uses the Python executable found in your PATH.

Get file path + file name in a keybindings file in Sublime Text 2

最后都变了- 提交于 2020-01-02 07:27:14
问题 I'm trying to get the path of the current file + the file's name (without extension) in a Key Binding file in Sublime Text 2. $file_path or ${file_path} are both not working. The reason is that I want to execute an *.exe file, which was built before (but don't want to both build and execute in one step). Any ideas? Greetz 回答1: you may try the sublime-snippet, this is my code: #filename: filename.sublime-snippet <snippet> <content><![CDATA[$TM_FILENAME]]></content> <!-- Optional: Tab trigger

Display Python Output in Sublime text [duplicate]

北城余情 提交于 2020-01-02 02:32:25
问题 This question already has answers here : How do I run Python code from Sublime Text 2? (15 answers) Closed 4 years ago . New to Python & Sublime Problem: I type 'print ("Hello world") How do I get it to show me the output (Hello world), is it in a separate window? or... I understand I can use the Python Console built in, but that's a command line, what about when I get to use a ton of code, how do I get the output? 回答1: Click on tools > build systems > select Python, then Build with using ctr

How can I set the ruler in sublime from the command palette/hotkey?

China☆狼群 提交于 2020-01-01 22:00:07
问题 I can do this by clicking View -> Ruler -> 80 but it'd be a lot more convient to do it from the command palette or a hotkey (apart from alt, right, right, right, right, down, down, down, down, down, down, down, down, down, down, down, down, down, down, down, down, down, down, right, down, down, down, enter ). Edit: Though I found a way to make a file to add command palette options, I do not know how to make it work for arbitrary numbers, ideally typing set ruler 33 would set the ruler to 33

Key Binds - Middle Mouse Button with Sublime Text 2

纵然是瞬间 提交于 2020-01-01 05:26:08
问题 Does anybody know if it's possible to bind the middle mouse button to an action in Sublime Text 2? I know that some mouse interaction is possible, because you can use the back and forward buttons. Basically, I was going to use this button to upload a file with the sFTP plugin so it would decrease the amount of buttons I would need to press from 3 to 1. Currently, I have: { "keys": ["ctrl+shift+u"], "command": "sftp_upload_file" } Ideally it would be something like this: { "keys": ["mouse4"],

Sublime Text: text list of open files

喜夏-厌秋 提交于 2020-01-01 04:54:07
问题 I have some files opened in sublime text. I can see that list on the side panel. I want to know if there is a plugin that can give me this list as text. i.e., I hit a button and new file pops up that has lists all the open file names. 4 open files: open_file_1.cc open_file_1.h open_file_2.cc open_file_2.h 回答1: I wrote a small plugin for this as I could not find anything. Pasting it here so that someone can use it if needed in future. https://github.com/rrg/ListOpenFiles 回答2: Press: Ctrl `

How to refresh Sublime Text 3 workspace color schemes?

蓝咒 提交于 2020-01-01 04:50:13
问题 When you save a project, Sublime Text will create a .sublime-workspace file. In this file, there is an array of buffers, and for each buffer there is a color_scheme property. This is set to whatever color scheme was chosen when the buffers and workspace were created. I recently changed my theme and color scheme in my user settings file. How can I refresh all of my project's workspaces so that way it uses my new color_scheme provided in my user preference file without needed to edit each

Sublime Text 2 and MinGW

家住魔仙堡 提交于 2020-01-01 03:29:07
问题 Good day! Can anyone share their experience how to attach MinGW-compiler to Sublime? I found a config in the internet, but when I run compiled program popping bugs with missing files from "../MinGW/bin/". Config: { "cmd": ["mingw32-g++.exe", "-o", "$file_base_name", "$file_name"], "path": "c:\\Program Files\\MinGW\\bin\\" } Thanks! UPD I found answer for my question! I had to add one parameter in cmd . It's "-static" . So, it's my MinGW.sublime-build , which works fine: { "path": "c:\\Program