kek / sublime-expand-selection-to-quotes

Sublime Text plugin to expand selection to surrounding quotes
107 stars 13 forks source link

Sublime Text 3 support(?) in Package Control #8

Closed AllanLRH closed 8 years ago

AllanLRH commented 10 years ago

The git commit message hints of ST3 support – if this is so, it would be really nice with Package Control support for ST3 as well as ST2 :)

MattDMo commented 10 years ago

This works fine in ST3 without modification - you just need to install it manually instead of through Package Control. Just go to your Packages folder and run

git clone https://github.com/kek/sublime-expand-selection-to-quotes.git "Expand Selection to Quotes"

and you're all set. It would be nice if Package Control was updated, though (hint hint)

ahmadawais commented 8 years ago

@MattDMo Tried this, but doesn't seem to work! Any tips?

AllanLRH commented 8 years ago

Are you sure you cloned it to the right folder…? Anyways, you should be able to install this plugin using Package Control, if you add the repository: In the Command Palette, search for Package Control: Add Repository, and add the repo URL (https://github.com/kek/sublime-expand-selection-to-quotes). Once it's done, install it as you would any other package.

ahmadawais commented 8 years ago

Never knew this way of installing a repo. Just did that. It is there in the Pacakges folder, I am using Mac. But it is not working nor showing up anywhere. Though it is present in the list of pacakges. Any help?

ahmadawais commented 8 years ago

OK, it is working now, great! But it is also selecting the quotes, how can I make it not select the quotes, but only the content inside em. @AllanLRH Also it turns double quotes into single quotes :(

AllanLRH commented 8 years ago

It works this way for me (a | is a cursor, characters in [ ] are the selection):

"abcd|ef"

Activate the plugin

"[abcdef]"

Activate the plugin

["abcdef"]
ahmadawais commented 8 years ago

@AllanLRH Here is the situation with me, this is me pressing CTRL + ' several times and what it does is that it selectes the quotes and changes them. There are no settings anywhere to be configured. I really like this pacakge and could use your help.

img

MattDMo commented 8 years ago

@ahmadawais You must have some other plugin installed as well. If you know Python, look through the source of this repo - you'll see that there's no functionality to replace double quotes with single, or vice versa. To find out what you're triggering with Ctrl', open the Console (Ctrl`) and enter

sublime.log_commands(True)

Then, put your cursor between some quotes and hit Ctrl'. The Console should show

command: expand_selection_to_quotes

If it doesn't, another plugin has hijacked the key binding. To determine which one, install FindKeyConflicts and run the FindKeyConflicts: All Key Maps to Buffer command in the Command Palette. Look through it for Ctrl+' and you should be able to find the offending plugin. You can then edit its .sublime-keymap file to change or delete the key binding.

MattDMo commented 8 years ago

So I just looked through Package Control, and it looks like ToggleQuotes may be the offending plugin. If you don't need it, you can just remove it with Package Control: Remove Package.

ahmadawais commented 8 years ago

Great! Thanks! Removed the package and it is working fine now :)

kek commented 8 years ago

I've submitted a PR to update Package Control to indicate that this works with ST3 too. Sorry about the delay :)

MattDMo commented 8 years ago

@kek Thanks for that! I actually had too a couple days ago, as I kind of figured the package had been abandoned. My PR has been closed in favor of yours, though.

kek commented 8 years ago

Oh, I didn't notice. Yeah, it was pretty abandoned. I actually don't use Sublime Text daily. Thanks for helping out.