Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Key Bindings for Upper-Case and Lower-Case Text Transformations #14019

Closed
1 task done
benbenbang opened this issue Jul 9, 2024 · 3 comments
Closed
1 task done
Labels
editor Feedback for code editing, formatting, editor iterations, etc enhancement [core label] keymap / key binding Feedback for keyboard shortcuts, key mapping, etc

Comments

@benbenbang
Copy link

Check for existing issues

  • Completed

Describe the feature

Hello team,

I checked this doc for the built-in key binding. I'd like to share an idea (feature request, if possible) that I also use quite often,

The cmd k is a modified key as it's already implemented.

  • with a hint in the status bar below
    CleanShot 2024-07-06 at 22 53 17@2x
  • bind with cmd u => change the selected text to be upper-case
  • bind with cmd l => change the selected text to be lower-case

Similar to the selection => operation concept mentioned here #6447

WDYT?

If applicable, add mockups / screenshots to help present your vision of the feature

demo.mp4
@benbenbang benbenbang added admin read Pending admin review enhancement [core label] triage Maintainer needs to classify the issue labels Jul 9, 2024
@notpeter
Copy link
Contributor

Looks like we don't include it in the main vscode-esque default-macos.json or default-linux.json

But it's already there for Sublime (Mac), Atom (Mac and Linux) and Vim default keybinds:

"cmd-k cmd-u": "editor::ConvertToUpperCase",
"cmd-k cmd-l": "editor::ConvertToLowerCase",

"cmd-k cmd-u": "editor::ConvertToUpperCase",
"cmd-k cmd-l": "editor::ConvertToLowerCase",

zed/assets/keymaps/vim.json

Lines 380 to 381 in 9e2950a

"u": "vim::ConvertToLowerCase",
"U": "vim::ConvertToUpperCase",

It's missing from Sublime Linux (ctrl-k ctrl-u / ctrl-k ctrl-l) sublime source

In the meantime, you can add it to your user keymap.json:

[
{
    "context": "Editor",
    "bindings": {
      "cmd-k cmd-u": "editor::ConvertToUpperCase",
      "cmd-k cmd-l": "editor::ConvertToLowerCase"
    }
}
]

@notpeter notpeter added editor Feedback for code editing, formatting, editor iterations, etc keymap / key binding Feedback for keyboard shortcuts, key mapping, etc and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Jul 11, 2024
@benbenbang
Copy link
Author

benbenbang commented Jul 11, 2024

@notpeter thank you!

but actually it doesn't seem to work. I checked the json file, and it's released I am already on the latest version. Any clue how to fix this 🤔 ?

@notpeter
Copy link
Contributor

but actually it doesn't seem to work. I checked the json file, and it's released I am already on the latest version. Any clue how to fix this 🤔 ?

You can manually add them to your ~/.config/zed/keymap.json using the code I pasted above. Alternatively, if you switch (welcome: toggle base keymap selector) your default keybind to Sublime or Atom you'll get them today. At this time we're not going to add it to the vscode-esque default-macos keybindings (vscode does not bind these by default).

Separately, I also added them to the Sublime Text (Linux) keymap because they were missing there. This has not yet been released and will go out as part of next weeks Zed Preview (v0.145.x 2024-07-17) and trickle down to Zed Stable the following week (2024-07-24).

Thanks for reporting.

@notpeter notpeter closed this as not planned Won't fix, can't repro, duplicate, stale Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor Feedback for code editing, formatting, editor iterations, etc enhancement [core label] keymap / key binding Feedback for keyboard shortcuts, key mapping, etc
Projects
None yet
Development

No branches or pull requests

2 participants