vscode-emacs-mcx
vscode-emacs-mcx copied to clipboard
Please support M-l, M-u
Please support M-l, M-u:
https://www.gnu.org/software/emacs/manual/html_node/emacs/Case.html
- M-l
- Convert following word to lower case (downcase-word).
- M-u
- Convert following word to upper case (upcase-word).
I will simply assign M-l
and M-u
to editor.action.transformToLowercase
and editor.action.transformToUppercase
respectively, to which C-x C-l
and C-x C-u
are now assigned.
Strictly speaking, this is different from the original behavior of Emacs, on which M-l
and M-u
work on a different manner from C-x C-l
and C-x C-u
.
However, on VSCode, editor.action.transformToLowercase
and editor.action.transformToUppercase
work very similarly to both commands according to selection state:
- If some regions are selected,
editor.action.transformTo(Lower|Upper)case
converts the region. - If no regions are selected,
editor.action.transformTo(Lower|Upper)case
converts the word next to the cursor.
I think this is more convenient than to set keybindings to emulate the original Emacs' behavior strictly.
Assigning M-l and M-l to editor.action.transformToLowercase and editor.action.transformToUppercase is good work.
But I think, what is important for M-u and M-l is that they move cursor in additon to upcase (or downcase) word. For example, I can upcase all words of "awesome emacs keymap" only by typing M-u M-u M-u.
If M-u and M-l executed the following command sequences, they would be more resemble to the original Emacs, I think.
- emacs-mcx.cursorWordRight
- editor.action.transformTo(Lower|Upper)case
Thank you for good suggestion! I will fix it.
Hi, v0.2.0 has been released which includes this functionality.
As explained in #53, the current implementation has a drawback which I think though can be ignored in almost all practical cases. Then I remain this issue opened and will fix it, but the priority is not so high since I think the drawback is not a big problem.
This feature works very good in most cases. Thank you.
Close this issue giving up implementing the "hard" emulation of Emacs. This extension is going to be intended to mildly map Emacs keybindings to VSCode features.