sublimetext2

Auto-indent new line when hitting enter to expand one-line tag in HTML

元气小坏坏 提交于 2019-12-30 05:21:07
问题 I would like to have this work flow working with HTML in Sublime Text 2: Create HTML tag (e.g. ctrl + shift + W) TAB (putting the cursor in the content area) ENTER Resulting with this (the word "HERE" indicates where the cursor should be): <p> HERE </p> But instead this is what I get (the word "HERE" still indicating the cursor's position): <p> HERE</p> Which demands you to ENTER (again) ARROW-UP + TAB ARROW-UP + TAB (a second time) 回答1: Try adding the following in your user key bindings. {

How to unbind a key binding in Sublime Text 2?

懵懂的女人 提交于 2019-12-29 18:16:08
问题 I have a habit of hitting CTRL + T to open a new tab in ST2. However this invokes the transpose function. I could map the new_file command to CTRL + T , but is it possible to disable the command completely via user keymap file. My search suggested adding this to user keymap. [ { "keys": ["ctrl+t"], "command": "unbound" } ] Is the "unbound" an officially endorsed way of disabling a shortcut? 回答1: I have never see or read any official documentation about the unbound command, but it works.

Sublime text editor: how to select all instances of selected region?

纵饮孤独 提交于 2019-12-29 10:09:33
问题 Is there a shortcut key or single-step menu option to find and select all instances of a highlighted selection in Sublime Text? 回答1: On Mac OS you can use: CMD + CTRL + G 回答2: On Windows/Linux press Alt + F3 . 回答3: " On Windows/Linux press Alt+F3. " Worked for me on Ubuntu. I changed it in my 'Key-Bindings:User' to something that I liked better though. 回答4: Note You should not edit the default settings, because they get reset on updates/upgrades. For customization, you should override any

Limit File Search Scope in Sublime Text 2

你离开我真会死。 提交于 2019-12-29 10:08:43
问题 In Sublime Text, I often use Cmd + P / Ctrl + P to search and jump between files. Often, it would pick up temporary or cached files like .scssc or things in the /tmp folder. Is there a way that I can limit what is shown in the search result? 回答1: Add and edit this in your ~/Library/Application Support/Sublime Text 2/Packages/User/Preferences.sublime-settings file. // These files will still show up in the side bar, but won't be included in // Goto Anything or Find in Files "binary_file

How to make ruler always be shown in Sublime text 2?

孤街浪徒 提交于 2019-12-29 10:05:34
问题 I use Sublime Text 2 and want a Ruler to be shown in every file with specific line-height. But I have to show it manually in every file. 回答1: Edit the "rulers" value in the default settings to contain the column number you want the ruler to be displayed on, and it will persist. 回答2: Go to Sublime Text > Preferences > Settings - User Add a "rulers" setting with the lines you want for the ruler: // Adds a single vertical ruler at column 80 "rulers": [80], If you want multiple rulers, separate

RegEx in Sublime Text: Match any character, including newlines?

巧了我就是萌 提交于 2019-12-29 02:18:48
问题 Is there a way to match any character in Sublime Text, including newlines? I saw that Sublime uses Boost's syntax but that the . character won't match newlines without a specific flag set. 回答1: Try adding the (?s) inline flag start the start of the pattern. That will make . match any character. 来源: https://stackoverflow.com/questions/11992596/regex-in-sublime-text-match-any-character-including-newlines

RegEx in Sublime Text: Match any character, including newlines?

依然范特西╮ 提交于 2019-12-29 02:18:19
问题 Is there a way to match any character in Sublime Text, including newlines? I saw that Sublime uses Boost's syntax but that the . character won't match newlines without a specific flag set. 回答1: Try adding the (?s) inline flag start the start of the pattern. That will make . match any character. 来源: https://stackoverflow.com/questions/11992596/regex-in-sublime-text-match-any-character-including-newlines

Matching all three kinds of PHP comments with REGEX

青春壹個敷衍的年華 提交于 2019-12-29 01:45:33
问题 I'm new to REGEX and I need some help. I need to match all three types of comments that PHP might have: # Single line comment // Single line comment /* Multi-line comments */ /** * And all of it's possible variations */ Something I should mention, I am doing this in order to be able to recognize if a PHP closing tag ( ?> ) is inside a comment or not, if it is then ignore it, if not then make it count as one. This is gonna be used inside an XML document in order to improve Sublime Text's

Sublime Text 2 auto completion popup does not work properly

北战南征 提交于 2019-12-28 05:14:13
问题 I got problem with jQuery Snippet that i installed throughout package control. After installation I do not have popup with jQuery code hints and intalisance. Look at this video: http://code.tutsplus.com/courses/perfect-workflow-in-sublime-text-2/lessons/adding-snippets-through-package-control On 0:50 after typing . he got popup with code hints - I don't have this one. I have to type . on and then press Tab to display popup with snippet... And yes, I'm in JavaScript file and I got default

How to perform negative search (or replace) in common text editors

主宰稳场 提交于 2019-12-25 16:42:48
问题 Is there any way I can replace all the words/lines which don't match in my search query in text editors like notepad++ or sublime text. For example I have a document having few url links in it. Can I do something which leaves only url links in my document. If I have to remove url links, I can search them using regex and replace them with an empty string. But can I do the same thing but for the content which doesn't match regex. Example: this is line which I want to remove and can also have