Alex
  • Member for 6 years, 10 months
  • Last seen more than a month ago
What options are there to enter insert mode?
Accepted answer
32 votes

Entering insert mode at different locations The vim help documents have a great section on this: :help inserting A quick summary is: i: Insert before the cursor. I: Insert before the first non-...

View answer
How to quickly add content in a new line at end of file?
Accepted answer
14 votes

If file is already opened in normal mode Use: Go G goes to the end of the file o enters insert mode on a line below the current one If you are opening the file from the command line You can open ...

View answer
How to replace text inside () with previously yanked text?
14 votes

You can use visual selection to select the text to replace, and then paste over it as follows: vi(p vi( selects Baz (because it is enclosed in parenthesis), p pastes Fnord over it. However, this ...

View answer
Modify vimdiff highlighting
Accepted answer
7 votes

You have a few questions, some explicit and some implicit. I'll try to answer them in order: What Do These Commands Do? You're running two commands: highlight DiffChange cterm=none ctermfg=fg ...

View answer
What's the simplest way to strip trailing whitespace from all lines in a file?
5 votes

Exapnding on Christopher Bottoms's answer a bit: Jonathan Palardy wrote a good article on this. In it, he writes a functions, Preserve(command), that preserves the state of the editor (mainly cursor ...

View answer