Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
  COMP_ID=`      echo $SRC | sed -e 's/.*COMP_ID=//'  -e 's/:.*$//'`
  SRC_TYP=`      echo $SRC | sed -e 's/.*SRC_TYP=//'  -e 's/:.*$//'`
  DOC_TYP=`      echo $SRC | sed -e 's/.*DOC_TYP=//'  -e 's/:.*$//'`
  SRC_ID=`       echo $SRC | sed -e 's/.*SRC_ID=//'      -e 's/:.*$//'`
  ACC=`          echo $SRC | sed -e 's/.*ACC=//'      -e 's/:.*$//'`
  PASS=`         echo $SRC | sed -e 's/.*PASS=//'  -e 's/:.*$//'`
  POP=`          echo $SRC | sed -e 's/.*POP=//'      -e 's/:.*$//'`
  REMOTE_HOST=`  echo $SRC | sed -e 's/.*REMOTE_HOST=//'  -e 's/:.*$//'`
  REMOTE_PATH=`  echo $SRC | sed -e 's/.*REMOTE_PATH=//'  -e 's/:.*$//'`
  ARCHIVE_PATH=` echo $SRC | sed -e 's/.*ARCHIVE_PATH=//' -e 's/:.*$//'`

Using vim (or vi) I want to align the sections with -e 's/:.*$//' to the same column number. What's the easiest and fastest way to do this? (ignore the ugly echo ..| sed .. bits for now)

share|improve this question
Did you consider using a plugin like Align or Tabular? – romainl Jun 20 '14 at 6:44
up vote 3 down vote accepted

For alignment, there are three well-known plugins:

With the first, your problem can be solved via

:%Align -e
share|improve this answer
Well done. thanks for the those tips. For history's sake, the first two failed to install or operate correctly for me. vim-easy-plugin was the ticket. Did exactly what I want. vip<enter>-<CTRL-/> -e <enter> did it for me. My version VIM - Vi IMproved 7.0 (2006 May 7, compiled Jun 12 2009 07:08:36) – Felipe Alvarez Jun 27 '14 at 6:05
Why are you using such an outdated Vim version?! By updating, you'll get many fixes and new features! – Ingo Karkat Jun 27 '14 at 6:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .