Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On nearest tab border aligning #13

Open
whalebot-helmsman opened this issue Aug 16, 2012 · 3 comments
Open

On nearest tab border aligning #13

whalebot-helmsman opened this issue Aug 16, 2012 · 3 comments

Comments

@whalebot-helmsman
Copy link

It will be great if Tabular can align not only on fixed space count (after/before) but align on tab borders some kind of :Tab /=/ltrt

Before:

abc=cde
abcdf=asd

Now:

abc = cde
abcdf = asd

It will be great:
abc = cde
abcdf = asd

@ajzafar
Copy link

ajzafar commented Aug 16, 2012

Check out Markdown and use source blocks. Without them it's hard to tell quite what you mean to show with the alignment. I think this is what you meant your samples to look like. I'm not quite sure what feature you're requesting though. Did you want to be able to align along the sides of delimiters? That can be achieved currently with some crafty regexes, using \ze for example. I believe there are some examples in the Tabular documentation. If I understood your examples correctly, it looks like you don't want your delimiters aligned, which seems to go against the purpose of Tabular.

First:

abc=cde
abcdf=asd

Second:

abc    = cde
abcdf = asd

Third:

abc      =   cde
abcdf   =   asd

@whalebot-helmsman
Copy link
Author

Sorry for this, I align use non-mono type

Start from this:

abc = cde
abcd = cde

Now:

abc  = cde
abcd = cde

Delimiter(=) is placed 1-space after longest field

It would be great:

abc     =   cde
abcd    =   cde

Here delimiter is placed in next tab position(4x, if tab size equal 4 spaces) after longest field .

@mikehaertl
Copy link

+1. Before reading this issue I even came up with the same shortcut t instead of 0,1,2 ... for the padding specifier. In case, the idea wasn't understood right, let me visualize it differently.

Say, you have:

set tabstop = 4
set softtabstop = 4
set shiftwidth = 4
set expandtab

So the tabstops are (indicated by +):

+---+---+---+---+
abc = xyz
abcde = xyz
a = x

If you do :Tab /= you get

+---+---+---+---+
abc   = xyz
abcde = xyz
a     = x

In order to align the = to the next tabstop, we could have a new format specifier: :Tab /=/lt. t stands for tab.

+---+---+---+---+
abc     = xyz
abcde   = xyz
a       = x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants