This question already has an answer here:
Modify auto_match of quotes, adding an additional quoting character to Sublime Text 2
(1 answer)
Closed 8 years ago.
I've been working with SQL queries in Sublime Text recently and I find myself needing to wrap words with grave accents a lot.
For standard single and double quotes, sublime text allows you to select text and hit a quote key to wrap the selected text in the quote. For example, hello world becomes "hello world"
However, there is currently no way I can figure out how to perform the same action with grave accents (`). (hello world just gets overwritten with `)
Will I need to create a snippet to enable such an action, or is there an easy way to define what can wrap around selected text?
See Modify auto_match of quotes, adding an additional quoting character to Sublime Text 2. You can add a context entry for SQL if you would only like the behavior in SQL files.
Just to mark progress on this, I easily created a snippet to perform this action:
<snippet>
<content><![CDATA[
`$SELECTION$1`
]]></content>
<scope>source.sql</scope>
</snippet>
And added a key binding in my user preferences:
{
"keys": ["`"],
"command": "insert_snippet",
"args": {"name": "Packages/User/Grave Accent.sublime-snippet"}
}
In this case, my saved snippet was called "Grave Accent.sublime-snippet".
The issues in this case is that using a grave accent immediately after still creates two, when the other auto quoters simply add one.
Related
With CKEditor I need to give the user keyboard entry of bullets, left-double-quotes and right-double-quotes.
I already provide the user with numbered and bulletted lists, they want stand-alone bullets.
When I say left-double-quote, I mean “ “ equivalent.
When I say right-double-quote, I mean ” ” equivalent.
The user wants the ability to type these characters directly into a CKEditor textarea.
How should I configure CKEditor to do this?
I solved this problem during the export to IDML by converting the quotes (""") to their respective ” and “ (&#nnnnn; equivalent) by evaluating the characters next to the quote.
So the user may input ", and I output the desired quote character in it's place.
Very close to reverse of this question. I prefer coding with 2-whitespace indentation, but need to have files indented with tabs to align with project convention. What I would like to do is preferably automatically convert 2 spaces upon entry to tab symbol in Notepad++ and have the editor configured to tab length of 2.
A possible manual way for doing this could be Edit->Blank Operations->Space to TAB but this converts all of my spaces to tabs, even those of length 1 - which are, for example, spaces between function arguments, not just leading spaces.
In a perfect case scenario I'm trying to achieve formatting style as described in this question, but with typing just spaces and the editor taking care of the rest.
I'm on Notepad++ 6.0, but willing to upgrade if this helps
Let me complete the answer of Ari Okkonen to add a workaround to the problem commented by Sergii Zaskaleta of mixed tabs and spaces at the beginning of the line.
Settings->Preferences->Tab Settings->Tab size: 2 (if not already)
Edit->Blank Operations->Space to TAB (Leading)
Select a block of lines of text with the problem of mixed spaces and tabs. Press [Tab] and [Shift]+[Tab] to add and remove a tab from each line. In the process, the leading spaces had been converted to tabs.
A manual way that seems to work: After having edited the file before saving you may try (Works in Notepad++ v6.8.3):
Settings->Preferences->Tab Settings->Tab size: 2 (if not already)
Edit->Blank Operations->Space to TAB (Leading)
I am trying to use a double underscore "__" as word separator in Sublime Text 3. That means, I want the following to be selected by a double click (selection indicated by brackets):
(bar_foo)
(hello)__(world)
Is that possible? My first guess is "no", because nothing is specified in Preferences.sublime-settings, but maybe one of you guys knows a way to make this work?
Thanks in advance!
PS: I already had a look at some questions here at SO (e.g. Removed hyphen from word_separators, ctrl+d no longer makes sense and Sublime Text and Hypens vs Underscores), but they don't answer this specific question.
Edit: In case you're wondering, I want this because I want to select variables like bar_foo_counter but I also want to use double underscores for my CSS modifier classes, like bar__inner.
I am an avid TextExpander for Mac user. I use it to expand code across multiple text editors. I have had one issue that I wanted to run by fellow programmers who use TextExpander for possible solutions.
When I am expanding multiple lines of code on a line that has leading whitespace, TextExpander resets the leading whitespace on all lines beyond the first one.
Example:
If I am trying to expand a debug snippet I use all the time, from an indented line, it appears like so.
echo '<pre>';
print_r();
echo '</pre>';
The first line is indented because that is where I typed the expand abbreviation. Is it possible to maintain the leading whitespace status across all lines?
echo '<pre>';
print_r();
echo '</pre>';
I'm afraid TextExpander can't mimic the auto-indent behavior of your code editor.
If you always enter these at the same indent level, please note that you can use option-Tab to insert a tab when editing a snippet in TextExpander's snippet editor.
If your code editor respects the indent level of formatted text, you could instead change the snippet type from Plain Text to Formatted Text, Pictures using the popup above the snippet editor then choose Format -> Text -> Show Ruler to show the text view ruler, which works the same as in TextEdit and other apps.
If you'd like further assistance, write us at: support#smilesoftware.com
How can I make code completion case-sensitive?
How can I make Ctrl-k kill the content of the line and the new line character?
How can I make backspace always delete only one character, no matter what it is? Right now, it deletes spaces in chunks equal to my indent level.
How to change the indentation style in file templates? I like to have the opening brace on its own line.
How can I make the font aliased?
I'm using Xcode 3.2.2.
EDIT: Issues 2, 4, and 5 are solved. 1 and 3 are still open.
EDIT2: ad.3. Yes, I set Xcode to use spaces, not tabs.
3.
Look in Preferences : Key Bindings : Text Key Bindings : Indent Friendly Delete Backwards
If the delete key is mapped to this entry change it to plain Delete Backwards.
2.
In that same preference area, you can see that there is no delete line option to map ^k to.
How can I make code completion case-sensitive?
I don't think that's possible.
How can I make Ctrl-k kill the content of the line and the new line character?
I can't answer that one, you might need to write a script to do it.
How can I make backspace always delete only one character, no matter what it is? Right now, it deletes spaces in chunks equal to my indent level.
Backspace always deletes one character. It sounds like your file has tab characters in it, each one of which takes up the space of 4 spaces by default. You can tell Xcode to use spaces instead by de-selecting Tab key inserts tab, not spaces in the Indentation preference panel.
How to change the indentation style in file templates? I like to have the opening brace on its own line.
You need to create custom file templates. You can find the Xcode templates here:
/Developer/Library/Xcode/Templates/File Templates
You need to copy the appropriate templates to this location:
~/Library/Application Support/Developer/Shared/Xcode/File Templates
You can then edit the template files to use whatever indents you like.
How can I make the font aliased?
You need to use a font that has aliased characters. Try Monaco at 9 or 10 points.