In Sublime Text, highlighting any text and pressing any of the following symbols:
'
"
(
{
[
will cause the entire highlighted section(s) to be surrounded by the key you pressed (or its matching symbol). Is there an option to add more characters to this list? I would fairly often use |
and ` in Ruby development.
Best Answer
As it so happens, I've already set up the keybindings for backticks (`), so modifying them for pipes
|
should be easy. To do this, openPreferences -> Key Bindings-User
. If the file is empty, add opening and closing square brackets[]
on separate lines, and paste the following in between them:For pipe characters, you'll need to modify some of the regexes slightly, as
|
has a special meaning. The following works for me:You'll notice that I added the selector
source.ruby
to the|
keybindings - you can remove or change this if you want to use it in other files besides Ruby code. I didn't add it to the backtick code because they can be used in other syntaxes - Python and Markdown being the ones that spring to my mind first.