Questions tagged [alignment]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
47
votes
3answers
26k views

How can I set up a ruler at a specific column?

When coding in different languages, I tend to need to restrict my lines to a specific length (usually 79 or 80 characters). I've seen this done in other editors through the use of a ruler (solid line ...
40
votes
5answers
30k views

How to add indentation guides/lines

In Sublime Text 2, you get vertical guides where your indentation is, like this: but in vim I obviously don't: Is there a way to show lines like that in vim? By the way, my indentation is 2 spaces. ...
12
votes
7answers
1k views

How to left-align two columns of text? [duplicate]

If I have a text file like this: alpha: 1 beta: 2 gamma: 3 delta: 4 epsilon: 5 Is there a way to align the numbers like so?: alpha: 1 beta: 2 gamma: 3 delta: 4 epsilon: 5
5
votes
1answer
406 views

How to align statements around a particular word or token?

I want to align my statements around a particular word or token. Example: import React from 'react'; import { browserHistory, Router, Route } from 'react-router'; import Main from ...
4
votes
2answers
100 views

Align a block of code on the basis of a single character

The question's title might sound a little vague, so I'll explain the situation here more clearly. I have these lines of code in a file which I want to align with respect to the character =. const ...
26
votes
4answers
8k views

How can I easily create and maintain tables?

Here is (part of) a table I use in some documentation: +---------------+------------------------+---------------------------------------+ | TASK NAME | WHEN | DESCRIPTION ...
36
votes
6answers
11k views

Can I justify text in Vim?

The only reason why I'd ever edit a text file in Pico or Nano, and not in Vim was its "Justify" command ^J. It would reformat a paragraph of text, creating line breaks at word breaks so that the text ...
9
votes
4answers
2k views

Adding 80-column wide comment header block with centered text

For some reason or another I often divide the code into subsections separated by headers like these: ################################################################################ ##################...
5
votes
1answer
149 views

Is there a way to push existing text left while inserting (e.g., insert right-aligned text)?

In insert mode, typing normally moves the cursor right and pushes text to the right of the cursor farther to the right on the line. I am typing some right-aligned text and am wondering - is there a ...
1
vote
1answer
333 views

How can I right-align end-of-line comments with the Tabular plugin?

I often have code that looks something like this: a = 1 # description 1 longer_name = 2 # description 2 # no_longer_needed = 3 # ignore another_name = 4 # description 4 and would like to right-align ...