I like Vim's visual mode. v for highlight/select chars or lines, Ctrlv for rectangle highlighting, as far as I know (I am a beginner). Is there any way to use visual mode to highlight last two chars, for example, on each line for some selected lines? The selected lines are in different length. Basically, I would like to find a quick way to remove the last two chars for some selected lines. Not sure I can use visual mode to highlight irregular area.
How do I get Vim to treat underscores in a string as a word break?
what does ^A stand for in vim
How to “apply” backspace characters within a text file (ideally in vim)
That's a substitution, using the regex
..$which will match the last two characters at the end of the line.
Vim 7.2 hangs on startup, “killall vim” fixes it
Then substitute 'nothing' i.e.
What are the typical use cases for vi?
Vim: Combining autocmd?
In vim, once you hit the
:with a line selection active, the command prompt will actually show:.
Vim: padding out lines with a character
Which is the start and end of selection addresses for the next command (s in this case).
ido mode filenames for vim?
This would go to each line between line number 10 and 20, use $ to go to the end of the line, and then use x twice to delete two characters.
:10,20 normal $xx
Normal just tells vim to use the following symbols as if they were keyboard shortcuts entered in normal mode (i.e after hitting esc).. Does that help?.