Tagged: vim Toggle Comment Threads | Keyboard Shortcuts

  • harlekwinblog 12:27 pm on June 13, 2011 Permalink | Reply
    Tags: vim   

    In vim you can sort all lines by reverse numerics using the command:
    :sort! n

     
  • harlekwinblog 3:03 pm on February 21, 2011 Permalink | Reply
    Tags: , vim   

    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.

    Advertisement
     
  • harlekwinblog 2:58 pm on February 21, 2011 Permalink | Reply
    Tags: , vim   

    In Vim you can delete empty lines with the command:
    :g/^$/d

     
  • harlekwinblog 2:56 pm on February 21, 2011 Permalink | Reply
    Tags: , vim   

    In Vim you can remove duplicate lines with the command:
    :%s/^\(.*\)\n\1$/\1/

     
  • harlekwinblog 2:53 pm on February 21, 2011 Permalink | Reply
    Tags: vim   

    Vim can lowercase all lines with the command: ggguG
    Similarly to uppercase them use: gggUG

     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel