Is there a fast command to change
Cnotrol
to
Control
Visual-mode swapping To use this mapping: first, delete some text (using a command such as daw or dt in normal mode, or x in visual mode). Then, use visual mode to select some other text, and press Ctrl-X. The two pieces of text should then be swapped.
You can also make changes to single characters in normal mode. For example, to replace a single character, move your cursor over it and press r , and then the character you want to replace it with.
You can type f<character> to put the cursor on the next character and F<character> for the previous one. You can also use ; to repeat the operation and use , to repeat it in opposite direction.
While in normal mode, with your cursor on top of the first character to swap, you can type xp to delete one character and put it after the cursor, effectively swapping the two characters.
One possibly useful command (taken straight from the Vim page on swapping) would be
:nnoremap <silent> gc xph
to map gc (or another command of your choice) to swapping two characters. Note that the h
simply moves the cursor back to its original position, on top of the first of the two characters to be swapped.
xp
This swaps the current character with the next.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With