Changing case in Vim

Visual select the text, then U for uppercase or u for lowercase. To swap all casing in a visual selection, press ~ (tilde). Without using a visual selection, gU<motion> will make the characters in motion uppercase, or use gu<motion> for lowercase. For more of these, see Section 3 in Vim’s change.txt help file.

What is the difference between the remap, noremap, nnoremap and vnoremap mapping commands in Vim?

remap is an option that makes mappings work recursively. By default it is on and I’d recommend you leave it that way. The rest are mapping commands, described below: :map and :noremap are recursive and non-recursive versions of the various mapping commands. For example, if we run: Then: j will be mapped to gg. Q will also be mapped to gg, because j will be expanded for the recursive mapping. W will be mapped to j (and … Read more

How do I change tab size in Vim?

Expanding on zoul’s answer: If you want to setup Vim to use specific settings when editing a particular filetype, you’ll want to use autocommands: This will make it so that tabs are displayed as 4 spaces. Setting expandtab will cause Vim to actually insert spaces (the number of them being controlled by tabstop) when you press tab; you … Read more

vi/vim editor, copy a block (not usual action)

Another option which may be easier to remember would be to place marks on the two lines with ma and mb, then run :’a,’byank. Many different ways to accomplish this task, just offering another.

Categories vim

vim and notepad++

Vim has modal editing (answering the vice versa part). And it runs in a terminal. You are likely correct; if “vim” isn’t a real text editor, I’m not sure what is. I guess ed, the standard Unix text editor, would be the only real one.

Backspace key not working in Vim/vi

To allow backspacing over everything in insert mode (including automatically inserted indentation, line breaks and start of insert) you can set the backspace option: or By default this option is empty, not allowing you to backspace over the above-mentioned things. This is the standard Vi behavior. You can put this line to your vimrc file … Read more