5

I edit markdown text in Emacs fullscreen. Naturally in fullscreen the text flows wider, from left edge of the display to the right, thereby necessitating more eye movements. I want to narrow down the entire text display to, say, 80 characters and position it in centre of the fullscreen Emacs. The emacs buffer should look as if there is unused empty space to the left and right of this centered narrow column of text that is being edited.

What is the simplest way to achieve this? (I could split into 3 buffers, but that's not simpler).

5

I use writeroom-mode for that. It's available in MELPA.

  • Thanks; BTW, any reliable alternative to MELPA? It is down at the moment. – Sridhar Ratnakumar Jan 7 '15 at 3:24
  • I'm probably mistaken, but I couldn't find whiteroom-mode in MELPA… – lunaryorn Jan 8 '15 at 10:09
  • 2
    @lunaryorn, not white room, but write room :) melpa.org/#/writeroom-mode – legoscia Jan 8 '15 at 11:51
  • Oh dear! Head -> table – lunaryorn Jan 8 '15 at 12:20
4

Bastein (one of the org-mode developers/maintainers) had written a nice blog on how to give minimalistic look to emacs (no mode line, big fringes on the sides) a while ago.

Here is the full code from his gist. You can pick and choose from that based on what you want to implement.

Here is a snippet from his gist that will give you 'narrow column text' or simply a buffer with big fringes.

;; A small minor mode to use a big fringe
(defvar bzg-big-fringe-mode nil)
(define-minor-mode bzg-big-fringe-mode
  "Minor mode to hide the mode-line in the current buffer."
  :init-value nil
  :global t
  :variable bzg-big-fringe-mode
  :group 'editing-basics
  (if (not bzg-big-fringe-mode)
      (set-fringe-style nil)
    (set-fringe-mode
     (/ (- (frame-pixel-width)
           (* 100 (frame-char-width)))
        2))))

;; Now activate this global minor mode
(bzg-big-fringe-mode 1)

Setting the fringe color to suit your default theme:

(custom-set-faces
 '(fringe ((t (:background "white")))))

or

 
(custom-set-faces
  '(default ((t (:background "black" :foreground "grey"))))
  '(fringe ((t (:background "black")))))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.