Last active
January 15, 2017 06:53
-
-
Save trohit/16383b0b8154dab8055c51a876ce3b29 to your computer and use it in GitHub Desktop.
vimkhichdi.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#To replace empty lines | |
# replace empty trailing lines | |
%s/\S\zs\s\+$//g | |
# replace empty lines with spaces | |
%s/\s\+$//g | |
# to add some content 'grep -v..' at the end of each line matching a a pattern (eg. that starts with zgrep...) | |
:g/^zgrep.*/s/$/ | grep -v ':0' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://vim.wikia.com/wiki/Power_of_g#Examples