sponsor Vim development Vim logo Vim Book Ad

feralalign.vim : Simple script to save you from "ciw<tab><tab><tab>" to align text.

 script karma  Rating 0/0, Downloaded by 2071  Comments, bugs, improvements  Vim wiki

created by
Robert KellyIV
 
script type
utility
 
description
Simple script that allows you to easily tab a section of spaces to a desired
column; I.e. if you want all your comments to line up on virt col 41 try
":FeralAlign 41" when your cursor is in a position to "ciw"; I.e. saves you
from "ciw<tab><tab><tab>"etc. But that is about all this does (=

Works with single lines or ranges. Ranges must be specified by a single column,
block-wise visual selection; (i.e. "<ctrl-v>j"). So to align 5 lines, place
your cursor in a good spot (where a "ciw" won’t keel something important; i.e.
spaces before the comment chars) and "<ctrl-v>4j:FeralAlign 41"; easy as that.

Limitation: Aligns to the nearest tabstop.

This script is possibly of academic value as a way to get a range command to
preserve the cursor’s column.
 
install details
This is a normal vim60 plugin.  Just drop it in /plugin/
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
feralalign.vim 0.4 2004-08-11 6.0 Robert KellyIV As of 0.4 you can bang :FeralAlign to use the space (\s*) between ; and first non space (\S) chars, i.e. C++ style end of line comments.
Added :FeralAlign2 which is basically a shortcut for :FeralAlign! virtcol(".")
Remmed out :FeralAlignMarkedCol, etc.
feralalign.vim 0.3 2003-06-18 6.0 Robert KellyIV Initial upload
ip used for rating: 142.132.191.50

Questions about Vim should go to the maillist. Help Uganda.     Vim at Github