VIM delete all lines contains a pattern

, then is the pattern to match, global means match all occurrences, the d means delete. It's a very ... empty lines] The pattern to match empty line: ^$ :g/^$/d If you treat lines that contains only ... Sometimes you need to tidy up a piece of a text which contains many repetitive lines ... it as the pseudo code shows. occur_lines = search(pattern) foreach line in occur_lines delete

Record, save and reuse macro in VIM

is to give it a name, because in VIM the macro is stored in a register, a register name can be any ... in a function. This makes Emacs macro easy to name and save. An Emacs macro example (fset 'tt (lambda ... useful keyboard macro in VIM is add HTML tags to keywords phrase. I do this quite a lot, to bold ... Editing macro is a great help when you need to do some repetitive editing tasks

GVIM on Windows auto insert newline when editing txt file

This is a strange problem, on Windows and in GVIM, whenever I'm editing a txt file ... happens when the file has a txt extension. Other files don't have this problem. [formatoptions ... , and the line exceed 80 columns, GVIM will do a hard wrap: insert a new line and go to next line, which ... ] Execute :set formatoptions or shortcut :set fo, shows that in txt file the value is tcq

Vim distraction free mode

windows out there in distraction free mode. But in VIM, even a window is invisible, it still occupy ... In a distraction free mode, all the UI elements of the editor are gone, the menus, the status ... distraction free mode. In my opinion , every editor should support it right out of the box, because ... its such an useful and ingenious feature. The biggest reason I want a distraction free mode

Vim editor commands guide and tutorials

escape key >Basic commands >    :yy >VIM trick: yank the whole buffer without ... is OK for me. [Basic Commands] Simple explanation about commonly used Vim commands [:yy ... color scheme for VIM. You can press Tab to let VIM complete the color scheme name. [Light color ... ] Here is the directive about how to install a plugin for vim install details Extract in ~/.vim