The replace all option messes up the lower-case formation in Sublime Text 2. For example:
When I want to replace all the classes named "example1" to "hidethis"
I get "hideThis".
This is getting annoying, especially when I am going to do this procedure to URLs.
Is there any way to disable that option?
Related
In Sublime Text, I have installed Emmet so that I can do zen coding. Now, the problem is that when I'm typing, and get an autocomplete suggestion, as soon as I accept that autocomplete suggestion (either by entering tab, enter, or even pressing space bar), the suggested tag is expanded; this causes me not to be able to continue the zen coding.
To give you an example, say I want to insert a <select> with 6 <option> child elements. If I enter select>opt, then autocomplete suggests option, but as soon as I accept option, that expands to select<option></option>.
What I want is to accept option, but that it won't expand to <option></option>.
Is there anyway to accomplish this?
Actually, the answer is very simple. In your example, when you get the autocomplete suggestions for option, you will get 2 of them. One is the tag, the other is text. Use Ctrl+Space to go through all the suggestions, and select the text version of option and not the tag version.
In Sublime Text completions consists of a 2-tuple containing the showed string and the inserted characters/snippet. I don't think know whether it is possible to just insert the showed string. However if you search for any way, there is a way to establish: modify the source code of the html tag completion file.
Install PackageResourceViewer, then press ctrl+shift+p write PackageResourceViewer: Open Resource. Select HTML >>> html_completions.py.
If you save the file it will shadow (not overwrite) the original completions file. Hence just remove it to get the original behavior.
In this file:
in line 15 replace return (tag + '\tTag', tag + '>$0</' + tag) by return (tag + '\tTag', tag).
in line 245 replace completion_list = [(pair[0], '<' + pair[1]) for pair in completion_list] by completion_list = [(pair[0], pair[1]) for pair in completion_list]
Now it should insert the tag names instead of the whole tags.
I need to combine multiple bookmarks files and reduce the size, but I don't know how to use regular expression.
I want to:
Delete every line that starts with <DD>
Delete the following HTML tags and the (unknown) text between the
qoutes: ICON_URI="...", ICON="...", and LAST_CHARSET="..."
Replace the text between > and </A>
Delete duplicate lines
Sort lines alphabetically
Tested in Notepad++, for other tools it may not work. Also for some strange cases it could not work in Notepad++ as well
1. ^<DD>.*?$ - replace with empty string
2.ICON_URI="[^"]*" - replace with empty string
3.(<a[^>]+>).+?</a> - replace with \1 </a>
4. This is hard to do with regex, you can use grouping and repetition, but I'm not advanced in that
5. Use excel or other similar tool and order there, much easier
How to write a key binding to replace specific character to another one?
For example I want to replace "[" and "]" to empty string "".
Unfortunately, to make a custom key binding you would need to write a plugin in Python to do the finding and replacing, as there are no built-in commands for doing so. However, what you want to do is easily accomplished using the Find -> Replace... dialog. Make sure the regular expressions button is selected, then put \[|\] in the Find What: box, and nothing in the Replace With: box (it's best to put your cursor in there and delete everything, just in case there are invisible characters such as spaces or tabs there). Hit Replace to replace characters one at a time, or Replace All to replace all of them in one go.
I have a simple question.. I want to know what a style of searching is referred to as, like how may I refer to this style of searching when I am researching it.
In Sublime Text 3 when you hit Ctrl+ Shift + P the command pallette pops up, and you are able to type in a search query... Now, the special thing about this Sublime Text find box is that it will find search results based on the number of matched characters in sequence, rather than the strict name of the file. So, something like "packcon" will bring up "Package Control" and then something like "synrub" will bring up "Syntax: Ruby".
What is this style of string matching called?
Fuzzy Matching is the common name but more correctly referred to as Approximate String Matching.
More to read here : http://en.wikipedia.org/wiki/Approximate_string_matching
I'm trying to add auto increate indentation feature in a Sublime Text package.
As for TextMate, there's increaseIndentPattern = '\{'; that can make easy indentation.
http://manual.macromates.com/en/appendix#indentation_rules
How can I do that in SUblime Text?
Sublime Text 2 already has easy indentation built in.
Hit Ctrl+] to indent right, and Ctrl+[ to indent back or remove indentation.
Similarly, you can select the text you want to indent, and hit the Tab key. This indents the selected block of text. Shift+Tab will remove indentation of selected text.
If you are working with predefined syntaxes you can define a keybinding for your "ReIndent" command, which will execute Edit>Line>Reindent command on the entire document.
However, if you reeeeally want to get your hands dirty with setting up how the program indents specific language syntaxes, you go to the Preferences Menu and hit Browse Packages.
Look for the language you want to modify indentation rules for, I'll use PHP as an example. There are 2 files that have indentation rules for my copy of PHP right now. Their names are as follows:
Indentation Rules Annex.tmPreferences
Indentation Rules.tmPreferences
There should be another copy of these same filenames with *.cache at the end. Feel free to add .old after .cache and modify the plain *.tmPreferences ones.