Sunday, February 7, 2016

tabstop motion

(Vim 7.4 Included patches: 1-488, 576; Linux Debian Jessie)

I have been exploring Vim in greater depth of recent times, working to get a set of tools under my belt. Here is a use case:

Set up the outline of a table something like this:

-----------------------------
| | | | |
| aaa | 123 | 456 | word |
-----------------------------
| | | | |
| ... | ... | ... | .... |
-----------------------------
| | | | |
| | | | |
-----------------------------
| | | | |
| | | | |
-----------------------------

The column positions of interest would all be at tabstops, say tabstop=2. I want, in normal mode, to "tab over" to the column of interest, go into replace mode (R), or virtual replace mode (gR), and type data.

In other words I want a tabstop motion.

The problem is that I find no text motion in Vim to move to the next tabstop position, or for that matter shiftwidth. (shiftwidth seems inappropriate to this use case, although for the record my shiftwidth, softtab, and tabstop all are the same value.) I use expandtabs *always* to keep the characters that I see on the screen wysiwyg. (This dramatically reduces the confusion that using hidden tab characters creates, in my opinion).

Here is the thing that gets me:

In normal mode, the tab key appears to be unassigned although the Vim Help seems to indicate it should be equivalent to CTRL-I (goto newer position in jump list).

Why isn't the tab key a motion?

The help text makes the claim that Virtual Replace mode is ideal for doing what I want to do. But this just doesn't make sense to me. Why would I want to replace the nice table structure I built? I just want to fill it in.

Am I missing something obvious? I hope so, because at this point a see no rapid Vim-style approach to building a table like this. All I see is drudgery, and that, in my view, just ain't Vim-like :)

Any help/suggestions would be greatly appreciated!

BTW, if there is not such motion I hereby officially request one as a feature request. (I might even fork Vim, if I can find the time, and add it in a pull request)

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment