sponsor Vim development Vim logo Vim Book Ad

SearchCols.vim : Search within fixed width data column-by-column, rather than row-by-row

 script karma  Rating 22/22, Downloaded by 572  Comments, bugs, improvements  Vim wiki

created by
Adam Bellaire
 
script type
utility
 
description
This script was inspired by a question on StackOverflow.com.  It's my first vim script, and is likely very bad, however I've made my best efforts to have it play nicely.

Creates a command :SearchCols <string>, which can be used to search for the string in fixed-width columns so that the search looks in the first column first, then the second column, etc. rather than the row-by-row search which is standard for vim.  Repeat the command via @: and then @@ since it's a colon-command.

Requirements:
- This script requires the multvals.vim plugin: http://www.vim.org/scripts/script.php?script_id=171

Assumptions:
- Assumes that your file is formatted with whitespace-delimited fixed width columns, i.e. there are no spaces inside the data items, only in between them.
- Assumes that the first line of your file is formatted so that the column widths can be deduced from it.
 
install details
Place the script in your .vim/plugin/ directory
 

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
SearchCols.vim 0.1 2009-02-16 7.0 Adam Bellaire Initial upload
ip used for rating: 3.145.77.114

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github