Showing posts with label vim. Show all posts
Showing posts with label vim. Show all posts

Tuesday, July 19, 2011

Regex Combine lines

takes any end whitespace and combine with starting whitespace of next line
:%s/\s*$\n\s*/ /g

Monday, July 11, 2011

Vim comment/uncomment block of lines with commands

Vim comment/uncomment block of lines with commands

working on lines 24 to 314

comment:
:24,314s/^/#/g

uncomment:
:24,314s/^#//g

Monday, June 20, 2011

Vim delete from curser to line number

The command in Vim to delete from the current position of the curser to a greater line number, 57 for example, is

:,57d

This is derived from deleting lines in a range, lines 22 to 57 for example:
:22,57d