As a programmer, I want to see a ruler at a specific column (usually 80), both so I see when I cross that column, but also to see how close I am getting to it so I can reformat my code early.
The options I have found so far are all not achieving this goal:
whitespace-mode
,column-enforce-mode
, andcolumn-marker
only highlight individual rows after the text in the row has already passed thefill-column
. I'd like to see when I am getting close to the column, not just when I cross it.fill-column-indicator
would be a good solution, except it breaksauto-complete-mode
,company-mode
,avy
, and more. These are issues that seem hard to fix, each requiring an individual workaround -- e.g., see thecompany-mode
issue and theauto-complete-mode
issue, the latter over two years old).
Are there any better alternatives?
(set-window-margins nil 0 (max (- (window-width) 80) 0))
So if you have a 120 character wide window, it'll shrink the space you have to actually display code to 80 characters. This way it won't mess up your window configuration and you can toggle it on an off if you'd like. If you have fringes, there will actually be a line drawn at 80 columns.