2009-06-30

Squeeze out more display space from your small monitor :(

I don't have a big monitor at work. To squeeze more display spaces out to show more lines of code, we may do tricks like,
  1. Use an extremely small font to hurt your eyes.
  2. Disable menu bar, scroll bar and tool bar.
    (menu-bar-mode -1)
    (tool-bar-mode -1)
    (scroll-bar-mode -1)
    
  3. Use small fringes (2 in my settings)
    (setq default-frame-alist
          '(
            (left-fringe . 2)
            (right-fringe . 2)
            ;; ...
           ))
    
  4. Use smaller modeline.
    (set-face-attribute 'mode-line nil :background "Wheat" :foreground "DarkSlateGrey" :height 0.5))
    
  5. I often open a shell buffer inside Emacs. It is opened to do compiling, file operations and other stuff you may want to do in normal shell. You probably don't spend a lot of time working in it. After all, your job is coding, not listing files by ls -al all the time. So, can we use a smaller font in all shell buffers?
    ;; make a face
    (make-face 'font-lock-small-face)
    (set-face-attribute 'font-lock-small-face nil :height 0.5) ; have smaller font.
    
    ;; add this setting to all shell-mode buffers
    (add-hook 'shell-mode-hook '(lambda ()
                                (font-lock-mode t)
                                (buffer-face-mode t) ; only in emacs 23
                                (buffer-face-set 'font-lock-small-face)
                                ;; other stuff
                               ))
    
Finally, I want to say buying a big monitor saves you more time! :)