Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.
  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 at 6:44

1 Answer 1

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 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 at 6:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.