sublimetext2

Sublime snippet with params on tabTrigger

核能气质少年 提交于 2020-01-04 02:54:27
问题 For example somewhere inside .html file i type: temp:some-id And expect my snippet creation magic to return this with the specified "some-id" : <script type="text/template" id="some-id"></script> So i need a way to trigger some text and pass through some arguments to the snippet creation file so when the triggering happens I can assign that arguments to some tab-placeholder inside .sublime-snippet. Any ideas? P.S. im using sublime text 2, if it matters. 回答1: You should use the variable $TM

Disable Autocomplete for Specific Language Feature

南笙酒味 提交于 2020-01-03 15:55:04
问题 I import vector from std using #include <vector> using std::vector; I do this specifically so I don't have to namespace vectors for increased readability. So it is supremely annoying that the C++ package in Sublime autocompletes to std::vector<char> v; Instead of just vector How do I disable this without disabling all autocompletion or losing C++ language support? 回答1: Since you're using Sublime Text 2, it's quite easy. Click on Preferences -> Browse Packages... to open your Packages folder

Middle button paste deleted text in Sublime 3

点点圈 提交于 2020-01-03 15:50:09
问题 (Note: This question is different from Move cursor on middle button paste in Sublime Text 3 ) I am using Sublime Text 3 on Linux (but it also applies to Sublime Text 2). In both emacs and vim, it is possible to highlight some text (this copies it to the clipboard), delete the text, then paste it elsewhere with the middle mouse button. This is my usual workflow to move some text (select->delete->middleclick). On Sublime however, it doesn't paste anything, i.e., the middle button paste

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 2 : select tags with all content in it

╄→尐↘猪︶ㄣ 提交于 2020-01-03 08:44:11
问题 I'm looking for a keyboard shortcut to select tags and all text between tags, such as: <div> Hello World </div> Consider above html code when I place cursor between div tags and press ctrl + shift + a it select all content that is Hello World but not div tags. 回答1: If you hit Ctrl Shift A once while your cursor is in the text, it will select all the text. Hit Ctrl Shift A again, and it will select the tags. Keep hitting it, and the selection will keep expanding outwards. 来源: https:/

Browse autocomplete results without arrows in Sublime

假装没事ソ 提交于 2020-01-03 05:11:34
问题 I'm using Sublime Text 3, and I am trying to not use arrows for anything. However I can't seem to scroll through different results of autocomplete or Ctrl+P without the arrows. Any suggestions? Thanks! 回答1: You probably want something like this in your keymaps file: // navigation with tab in autocomplete popup { "keys": ["tab"], "command": "move", "args": {"by": "lines", "forward": true}, "context": [{ "key": "auto_complete_visible" }] }, { "keys": ["shift+tab"], "command": "move", "args": {

How to use Sublime's Text 2 build functionality with Google App Engine?

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-03 03:21:13
问题 Two actions I would like to do on Windows 7: update code on the server; validate the code. In order to do (1) I've created GAU update.sublime-build file with the following text: { "cmd": ["appcfg.py --oauth2 --insecure --skip_sdk_update_check update", "$project_path"], "path": "d:/Work/GAE/", "encoding": "cp1251", "shell": true } But I am getting the following error: ERROR appcfg.py:2161 An error occurred processing file '': HTTP Error 302: Found Unexpected redirect to https://appengine

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

Custom JavaScript snippets for emmet (in Sublime Text 2)

百般思念 提交于 2020-01-02 06:34:11
问题 I am trying to add some custom javascript snippets and abbreviations to the snippets.json file of Emmet, but I can't get it to work! (I am using Sublime Text 2.) If I put this into the end of the settings.json "javascript": { "abbreviations": { "while": "while(true)\n{\n\t\n}" }, "snippets": { "asdf": "qwerty" } } nothing happens. (I set the syntax of the file to javascript obviously) But if I replace 'javascript' with 'css': "css": { "abbreviations": { "while": "while(true)\n{\n\t\n}" },

Sublime Text 2 code snippet not working in proper scope

我们两清 提交于 2020-01-02 06:00:50
问题 I have just written the following snippet, and saved it in the folder Packages/User/HTML as "add-script-source.sublime-snippet." <snippet> <content><![CDATA[ <script type="text/javascript" src="${1:script.js}">${2}</script> ]]></content> <!-- Optional: Set a tabTrigger to define how to trigger the snippet --> <tabTrigger>scriptsrc</tabTrigger> <!-- Optional: Set a scope to limit where the snippet will trigger --> <scope>text.html</scope> </snippet> Now, I only want this snippet to work in