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

Not clear how to show a right margin line. #4856

Closed
amichail opened this issue Jan 29, 2016 · 7 comments
Closed

Not clear how to show a right margin line. #4856

amichail opened this issue Jan 29, 2016 · 7 comments

Comments

@amichail
Copy link

I would like to limit most lines of code to 100 characters.

Is there a recommended package for making this easy to do by showing a right margin line? If so, maybe it should be mentioned in the documentation?

@JAremko
Copy link
Collaborator

JAremko commented Jan 29, 2016

Column enforce mode

img

@JAremko
Copy link
Collaborator

JAremko commented Jan 29, 2016

Also SPC t f display the fill column (by default the fill column is set to 80)

docs

Don't forget to close the issue

@StreakyCobra
Copy link
Contributor

Yes, SPC t f is what you want. You can activate it on all relevant buffers with this:

  ;; Activate column indicator in prog-mode and text-mode
  (add-hook 'prog-mode-hook 'turn-on-fci-mode)
  (add-hook 'text-mode-hook 'turn-on-fci-mode)

You can also press M-q to automatically fill paragraphs to the value of fill-column. Note it can be customized with:

(setq-default fill-column 100)

in your user-init. Does this answer your question?

@amichail
Copy link
Author

Is there a way to make the line color more subtle for fci-mode?

@nixmaniack
Copy link
Contributor

@amichail (setq fci-rule-color "#FF0000"). You can choose the color you want instead of "#FF0000"

@amichail
Copy link
Author

I got it working! Thanks!

@DanBurton
Copy link
Contributor

Googled this up, and @StreakyCobra's answer is exactly what I was looking for.

Weirdly, (setq-default fill-column 100) in my user-init wasn't working, so I did this instead:

(defun fill-column-100 ()
  (set-fill-column 100))

;; later, in user-init
  (add-hook 'prog-mode-hook 'fill-column-100)
  (add-hook 'text-mode-hook 'fill-column-100)

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

No branches or pull requests

5 participants