Vscode: Make addSelectionToNextFindMatch (ctrl+d) case-sensitive

Created on 16 Mar 2016  路  19Comments  路  Source: microsoft/vscode

  • VSCode Version: 0.10.11-insider
  • OS Version: Windows 10 Pro Insider Preview

Steps to Reproduce:

  1. Press ctrl+d on a word, it will select all words that match regardless of case

Expected:

Pressing ctrl+d on a word should select words that match with case-sensitivity

Reason:

It's annoying af sometimes.

verified

Most helpful comment

For those trying on OS X it is option+command+c to toggle case sensitivity.

All 19 comments

@kowsheek Try Alt+C. This toggles case sensitivity of the find widget and for the ctrl+d:

There is also Alt+W for whole words

Thanks! Alt+C works but would be nice if this was more discover-able.

@alexandrudima is there a setting I can change in my settings.json to disable case-insensitivity? It's really annoying and I'd like if I could have it always be case sensitive.

@aybabtme We could add a setting for the toggle's default value. Please file a new issue for it.

@alexandrudima thanks, created https://github.com/Microsoft/vscode/issues/10344#issue-170149451

For those trying on OS X it is option+command+c to toggle case sensitivity.

option+command+c doesn't work on OS X. I just checked and I have the latest version of VSC.
Why is this issue closed? it isn't resolved at all.

cmd+alt+c is the keybinding we ship with by default for toggleFindCaseSensitive on OSX. @theideaofnorth2 Can you please open a find widget (such that you can observe the state of the case sensitive toggle) and press cmd+alt+c:

case-sensitive

If this does not work for you, can you please try this key combination in the define keybinding widget (Preferences > Keyboard Shortcuts):

image

If the keybinding cmd+alt+c is not detected correctly please create a separate issue.

Thank you @alexandrudima for the reply. I had another software that was taking over cmd+alt+c so after disabling it I am now able to switch the case sensitivity setting.

However, I see that my choice is not persisted after I close and reopen VSC... Would it be possible to enable a setting for this? Also, in my opinion, case sensitivity should be enabled by default :)

@theideaofnorth2 Let's track that in #11574

I show how cant get this to work 馃槩

I would decouple Find Next/Previous (dialog on Ctrl+F) from the Find Next Occurrence (Ctrl+D). These two are completely different functions for different use cases. I'd decouple by simply adding more variants of the command (or specifying command options), everybody can map what they want.

  • editor.action.addSelectionNextWordCaseSensitive
  • editor.action.addSelectionNextWordCaseInsensitive
  • editor.action.addSelectionCaseSensitive
  • editor.action.addSelectionCaseInsensitive

Also I might add that Sublime has additional behavior:

  • If you have no selection, hit Ctrl+D, you are selecting by word boundaries. (possibly also matching case)
  • If you have selection, hit Ctrl+D, you are selecting without word boundaries. (possibly also not matching case)

This plus case in/sensitive versions of the command could provide very natural behavior. (case sensitivity is skewed in Sublime as well, it's about time to fix this forever)

This is a pretty significant pain point for me in trying to switch over from Atom. Making case sensitivity options persistent doesn't solve this issue because, as @martincohen states, the use cases for Find and Find Next Occurrence are completely separate.

Case insensitivity in the Find dialog is a convenience so someone doesn't have to type something they're looking for the exact same way as it appears in the file. Find Next Occurrence exists to select the _exact_ same thing you have already selected, usually to then type something to change both. Why would I ever want this function to select two things that aren't the same?

I would be on board with making it an option, but forcing users to manually switch case sensitivity back and forth based on which Find function they're using at the time isn't a good experience.

This probably isn't the nicest way to solve this problem, but I decided to just go ahead and write an extension for those of us who wish this command was case sensitive. :) Now I can happily go about using Code.

I think the default should be case sensitive.

A little confused, what was the final decision on this? Why is the multiple cursors feature (cmd + d) being coupled with the other find functions? They may be similar in implementation, but they are two distinct features.

When using multiple cursors w/ cmd+d, you're almost always looking for a symbol. In the search functionalities, you often want to just find the general location of a topic. Using the same setting for case sensitivity on these two features means you're constantly changing the setting.

I am using version 1.12.1 still no settings for case-sensitivity.

@cprogrammer1994 I'm on 1.12.2. To the best of my knowledge, what I am about to describe is not introduced by an extension and I am not sure if this is a recent addition, but:

  • Select your text
  • Press CTRL+D / CMD+D
  • Tiny little widget appears in the top right corner of your file editor where you can toggle case sensitivity or whole-word matching

It's only there for few seconds before it hides itself again.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mrkiley picture mrkiley  路  3Comments

borekb picture borekb  路  3Comments

philipgiuliani picture philipgiuliani  路  3Comments

chrisdias picture chrisdias  路  3Comments

lukehoban picture lukehoban  路  3Comments