Giter Site home page Giter Site logo

vscode-quick-select's Introduction

vscode-quick-select

Yes I know about the ⌃⇧⌘← and ⌃⇧⌘→ expand/shrink selection. Having come from VIM I think these are still missing.

It now supports multilines automatic selection, matching correctly.

NEW: you can also now toggle single/double quotes

See the examples below.

Installation

Press F1 and narrow down the list commands by typing extension. Pick Extensions: Install Extension. Select the Quick and Simple Text Selection extension from the list

Manual Install

Mac & Linux

cd $HOME/.vscode/extensions

Windows

cd %USERPROFILE%\.vscode\extensions

All Platforms

git clone https://github.com/dbankier/vscode-quick-select.git
cd vscode-quick-select
npm install

Usage

Here some examples - and it supports multiple selections.

In the examples below use CTRL instead of for Windows.

k "

doublequotes

k '

singlequotes

NEW: You can also use this following shortcut to select either single, double quotes or backticks

k ;

NEW: You can also use this following shortcut to toggle quotes, e.g. "word" to 'word'

k :

NOTE: the extensions can be configured to exclude backticks from selection or switching

k `

singlequotes

k ( and k [ and k {

Using the following performs and outer selection:

k ) and k ] and k }

Or if you have already made in inner selection, use the same key combination again to expand to an outer selection.

brackets

k <

This also selects the matching tag.

k >

This matches the tag value.

brackets

Customisation

extension.selectSingleQuote
extension.selectDoubleQuote
extension.selectEitherQuote
extension.switchQuotes
extension.selectParenthesis
extension.selectBackTick
extension.selectSquareBrackets
extension.selectCurlyBrackets
extension.selectParenthesisOuter
extension.selectSquareBracketsOuter
extension.selectCurlyBracketsOuter
extension.selectAngleBrackets
extension.selectInTag

License

MIT © David Bankier @dbankier

vscode-quick-select's People

Contributors

chancesmith avatar dbankier avatar huafu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-quick-select's Issues

Expand selection, a level to not include quotes

If we expand the selection when there are quotes around it, the selection gets expanded to include the quotes. Can we please get a level before the quotes. So if I my cursor is in the middle of a string surrounded by quotes, if I expand once it will just get what is within the quotes, expanding a second time then includes the quotes. This is how it worked on my other editors before I moved to VSCode.

can't get this to work :(

Hi, I installed your extension, both manually and then through the GUI, but no luck :( I'm running VSCode 1.12.2. Any ideas?

Thank you!

extension.selectBackTick support for markdown code chunks ```

R Markdown and Python Markdown documents often contain runnable code chunks with the following format:

```{r chunk-name, opt1 = "something", opt2 = "something-else"}
# some code
```

Currently, the extension.selectBackTick includes the code chunk specifications, i.e. everything inside the curly braces {}. It would be great if there were an option to also exclude the code chunk specification, or provide a extension.selectTripleBackTick method to handle this.

Keyboard shortcuts need context

They should only activate when the editor has focus. Right now, for instance, they prevent the cmd-K keyboard shortcut that clears the terminal from working.

Selecting inside back tick adds unwanted backtick

I use this extension for my daily job and I love it.

One issue I often encounter is when I want to select inside backtick with default shortcut (cmd+K ` ), the content is selected but an unwanted new backtick is added.

See the animation below:

backtick

Support multiline strings

Currently this extension is not capable of recognizing multiline quote-delimited strings. For example:

foo='asdf
asdf
asdf'
echo "$foo"

This is a valid bash script. If you place your cursor inside the string and triggering "Select inside either quote", nothing happens.

Multiline strings like this are common in many languages, it would be nice for this extension to support them.

Doesn't select for usage with Vim

The extension works perfectly bar when trying to use vim commands whilst selected looks like it doesn't select in visual mode. love the work done! if you need any information from me to help debugging ect i'll provide when i'm back at work tomorrow :)

Not working on MacOS

I have installed and reinstalled the extension multiple times and have restarted both vscode and my machine but for some reason I can not get the extension to work no matter what key combination I try. (Command, option, control, function)+K+ " (or ').

When I look into vscode's extension folder I see the extension being installed as well. Losing my mind here and I don't know what to do. Please help out.

I'm using MacOS catalina (10.15.7)
VsCdoe: 1.50.1
vscode-quick-select: 0.2.9

Please let me know if they are more information you'd like me to post.

Thank you

Automate selection with one keyboard shortcut

Hello
Nice add-on, but there are too many keyboard shortcuts.

Can you make one shortcut for all options?
I mean some automation, e.g .:

  • If I'm between " ", it will select everything between " "
  • if { } is next to it, then it will also select everything between { }

[Ctrl] + [K], ["] and [Ctrl] + [K], ['] not working on Windows.

Windows 10, VSCode 1.41.

Just wanted to bring to your attention that these shortcuts don't work on Windows. Last time I checked, they work on Mac (replacing [Ctrl] with [Cmd] of course). This is not a huge inconvenience right now because there is [Ctrl] + [K], [;], but I thought you might want to fix it anyway.

After checking the keyboard shortcuts settings by recording [Ctrl] + [K], ['], it shows up as "ctrl+k oem_3" in VSCode, and apparently it's bound to the command extension.selectBackTick, which seems incorrect anyway, because ['] is single-quote, not back tick. Upon recording [Ctrl] + [K], [`] and {Ctrl] + [K], ["], no corresponding commands were found.

Multiple cursors

It would be AWESOME if this would work with multiple cursors. That would speed up refactors 100x !

Suggestion: show commands in palette

I often have to refer back to this repository to remember what the commands and shortcuts are. It would be very useful if all of the commands this extension provides were added to the command palette, so they are more easily discovered.

IDEA: SelectEitherQuoteOuter

Since I only use selectEitherQuote and more often than not I repeat the command twice to get the outer selection. Similar to how brackets come in pairs (left key is used for inner, right key is used for outer), I sometimes hit the corresponding key for "outer" quote only to see no result. (In fact it just executes selectDoubleQuote, but I am using single quotes in my project, so it does not do anything in my case.)

The other commands for outer quotes might be supported, but unassigned a key combination, in case other users might want it.

In my case, I would remap selectEitherQuoteOuter to current selectDoubleQuote and keep the rest.
I am perfectly happy with current selectEitherQuote and switchQuotes as I use them very very often.

Does nothing if an escaped quote character is in the string

Using [ctrl]+[k], ['] with 'this is a test' works but it does nothing with 'this is a test of the \' character'

Similarly, using [ctrl]+[k], ["] with "this is a test" works but it does nothing with "this is a test of the \" character"

Not working recently

Using Win10.

I got the error running the command from command palette:
"Command 'Quick Select: Select inside either quote' resulted in an error (command 'extension.selectEitherQuote' not found)"

And from using keybinding it resulted in:
"command 'extension.selectEitherQuote' not found"

This is my keybinding JSON:
{ "key": "alt+q", "command": "extension.selectEitherQuote", "when": "editorTextFocus" }

Everything was working perfectly fine before. I haven't touch any VSCode configurations since forever ago.

Switch between single and double quote

It would be great if we could switch between single and double quotes. for example 'some string' to "some string" and vise versa.
I understand it's may not looks like relevant to the purpose of this extension but most of the times the reason of selecting strings is just changing ' or " quotes.

suggestion: context menu

Would be nice to have all the commands in a subgroup in the context menu. Or even better, contextually guess, i.e. if the cursor is inside a { } block - show the corresponding commands and if the cursor inside a string - add commands for them as well.

Thank you.

Include backtick as regular quotes

Hey hi !

Just discover your extension and it's amazing !

It will be great if the backtick was affected by the selectEitherQuote and the switchQuotes options.
allowing a loop " => ' => ` => " => ' => `

Shortcut issue on french keyboard layout

Hello,

I have a french keyboard layout and have some issues using the shortcuts for selecting insidee { or insinde [.
As the keyboard doesn't have a single key for these but rather a shortcut (Alt+( and Alt+Shift+(), the shortcut Cmd + K + ... won't work. On the bottom status bar, a message appears saying it's not a recognized shortcut.

capture d ecran 2017-09-25 a 07 51 12

Feature request: expand selection

I really like this extension. It's great for quickly selecting and changing the contents of the string, object literal, array, etc.

I'd also like to be able to efficiently use it to also cut or copy a string, object literal or array. That means also selecting the opening and closing quote, curly bracket or square bracket. Your extension selects the inner not the outer.

Rather than having a whole set of commands to select the outer as well as the inner, it would be useful to have a command that extends the current inner selection to include the outer, i.e. extending the selection one to the left and one to the right.

What do you think? I could also make a PR if you would like ...

Parenthesis in string literals should be ignored

This issue actually has two parts to it.

First, a stray single parenthesis in a string literal will break extension.selectParenthesis command.

Observe the following code

method("test blah ("+foo+" blah");

If I put my caret anywhere in the outer parenthesis, the command extension.selectParenthesis does nothing.

Secondly, it is my personal subjective preference that parenthesis inside of string literals be ignored by the selectParenthesis command.

So placing my caret anywhere in the following code, and executing selectParenthesis command, will select everything within the outer parenthesis...

method(" here is some (text)"+textVar);

Request: select current query

This would select the current sql query under your cursor.

Valid separators:

  • ;\n
    select 1 from dual;
    select 2 from dual;

  • \n\n
    select 1 from dual

    select 2 from dual

  • \n/b*\n
    Same as before, but blanks in the line should be consider empty

  • beginning of file

  • end of file

This is very useful when working with a database connection (like extension SQLTools), so you can quiclkly select the query you are editing for running it (instead of running the full file).

I haven't seen another extension that do this, and having it outside SQLTools would mean any other database extension would benefit from it.

Possible shortcut: Ctrl + K + q (from "q"uery)

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.