In vim you can sort all lines by reverse numerics using the command:
:sort! n
Tagged: vim Toggle Comment Threads | Keyboard Shortcuts
-
harlekwinblog
-
harlekwinblog
In Vim you can find valid e-mail addresses with the command:
/^[a-z0-9][a-z0-9_\.-]*@[a-z0-9][a-z0-9-]*\(\.[a-z0-9][a-z0-9-]*\)*$
Requires that the e-mail address is on a line on it’s own.
Alternatively:
/[a-z0-9][a-z0-9_\.-]*@[a-z0-9][a-z0-9-]*\(\.[a-z0-9][a-z0-9-]*\)*
Will find such addresses anywhere on a line. -
harlekwinblog
In Vim you can delete empty lines with the command:
:g/^$/d
-
harlekwinblog
In Vim you can remove duplicate lines with the command:
:%s/^\(.*\)\n\1$/\1/
-
harlekwinblog
Vim can lowercase all lines with the command:
ggguG
Similarly to uppercase them use:gggUG
Reply