-
Notifications
You must be signed in to change notification settings - Fork 305
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 support for capitalizing, upcasing, and downcasing words #2912
Comments
It's generally easy to find the source for specific key bindings - the name of the function in the source matches exactly what you see when you run For the specific case of Alt+f the function is It might be worth a brief discussion on whether or not it makes sense to add the "shell word" variants for these case changing functions. I initially thought yes, but maybe they wouldn't be useful at all as I don't think it would do what people expect, e.g. it would do nothing if the cursor is inside a string literal. Vi mode does implement ~ - the function is named |
About the shellword variants: I also don't think it'd be useful. But I don't use And I wanted to try and see if I could add the support. Doesn't seem that difficult. Take the text from cursor position to where |
The easiest way to try out changes is in MockPSConsole which you can just build and run from this projects solution file. Other ways a bit cumbersome because PowerShell loads PSReadLine by default. |
@springcomp - that's more involved than my approach, which was to:
This approach requires being an admin or installing a user local version of the module. Alternatively, you could change the environment variable |
@lzybkr yes, your are right, it is a lot more involved. However, it also means that the original instance of PSReadLine is always available and both can be run side by side. Once the initial setup step hurdle is done, I find that I can quickly jump to working on a PSRL feature right away with a couple of keystrokes, without impacting other PowerShell sessions from the terminal or from Visual Studio code instances running. I’m gonna go ahead an close my pull request and will try and work on drafting a wiki page detailing all three approaches: – Using MockPSConsole. Would that be helpful? |
@lzybkr Sorry for being late. GH notifications must've been turned off back then. I whipped something up yesterday. Opened a pull request. I'll move the conversation over there. Check that out when you have time. And thanks for the responses. |
🎉 This issue was addressed in 3365, which has now been successfully released in |
Prerequisites
Description of the new feature/enhancement
In GNU Readline, I can use Emacs-like keys to capitalize, upcase, or lowercase the word after the cursor position. I can even change the keybindings. In my
.bashrc
, for example, I have:Clink for Windows CMD has this feature.
Proposed technical implementation details (optional)
I haven't looked into the PSReadline codebase yet. Strictly an user here. But I could look around out of curiosity if someone could point me to the code where stuff like
alt-del
oralt-f/b
was implemented.The text was updated successfully, but these errors were encountered: