Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>After seeing this question I decided to try and write a vim plugin to handle it. It's my first vim plugin, so it's probably very bad. However, it does work for the example you gave.</p> <p>You can download the plugin from vim.org: <a href="http://www.vim.org/scripts/script.php?script_id=2543" rel="nofollow noreferrer">SearchCols.vim</a></p> <p>Note that it also requires the multvals plugin from the same site: <a href="http://www.vim.org/scripts/script.php?script_id=171" rel="nofollow noreferrer">multvals.vim</a></p> <p>It creates a command <code>:SearchCols &lt;string&gt;</code>, which can be used to search for the <code>&lt;string&gt;</code> 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 <code>@:</code> and then <code>@@</code> since it's a colon-command. </p> <p>Assumptions:</p> <ul> <li>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.</li> <li>Assumes that the first line of your file is formatted so that the column widths can be deduced from it.</li> </ul> <p>Obvious improvements that I can think of would be to make searching for the next item easier than using <code>@:</code> and <code>@@</code>, including search highlighting (the code is there but it's commented out because it uses <code>:match</code> and you would have to use <code>:match none</code> to turn it off), and eliminating the dependency on multvals.vim.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload