Skip to content

Instantly share code, notes, and snippets.

@dayyan
Created November 8, 2012 00:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dayyan/4035715 to your computer and use it in GitHub Desktop.
Save dayyan/4035715 to your computer and use it in GitHub Desktop.
Regular Expression Vim: Capistrano role from server IP paste with comments for internal IPs from Chef
:'<,'> s/x\(.*ACTIVE | \)\(.\{-}\d\)\s*| \(.*\)/role :app, '\2', # \1 \3/
turns
x| 1111 | yyy-yyy-staging-app83 | ACTIVE | 192.168.0.1 | 10.10.10.10 |
to
role :app, '192.168.0.1' # | 1111 | xxx-xxx-staging-app83 | ACTIVE | 10.10.10.10 |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment