Change vi-mode tilde to toggle character case#6908
Conversation
This updates the behavior of tilde to match the behavior found in vim. In vim, tilde toggles the case of the character under the cursor and advances one character. In visual mode, the case of each selected character is toggled, the cursor position moves to the beginning of the selection, and the mode is changed to normal. In fish, tilde capitalizes the current letter and advances one word. There is no current tilde command for visual mode in fish. This patch adds the readline commands `togglecase-letter` and `togglecase-selection` to match the behavior of vim more closely. The only difference is that in visual mode, the cursor is not modified. Modifying the cursor in visual mode would require either moving it in `togglecase-selection`, which seems outside its scope or adding something like a `move-to-selection-start` readline command.
|
Nice contribution, thank you! |
|
Awesome! That's been slightly bugging me for like 8 years and I finally took the time to fix it. There are other vi-mode enhancements like adding matching brace movement and inner and outer brace text objects I'd like to work on if that would be welcome. |
Sure, bindings for Of course, heavy duty editing can always be done with We might also want to change the default binding of I find the kakoune editing model more intuitive, it's like vi but movements like |
This updates the behavior of tilde to match the behavior found in vim.
In vim, tilde toggles the case of the character under the cursor and
advances one character. In visual mode, the case of each selected
character is toggled, the cursor position moves to the beginning of
the selection, and the mode is changed to normal. In fish, tilde
capitalizes the current letter and advances one word. There is no
current tilde command for visual mode in fish.
Description
This patch adds the readline commands
togglecase-letterandtogglecase-selectionto match the behavior of vim more closely. Theonly difference is that in visual mode, the cursor is not modified.
Modifying the cursor in visual mode would require either moving it in
togglecase-selection, which seems outside its scope or addingsomething like a
move-to-selection-startreadline command.