Emacs tips

  • To get more color themes for emacs install the emacs-color-themes, available in most major distros. In ubuntu_
    sudo apt-get install emacs-color-themes
    My current favorite is clarity. One you find one you like, edit your .emacs file (in your home directory) and add the line_
    (replacing "clarity" with your theme of choice, natch)
  • Once you know the keyboard commands, the toolbars just get in the way and take up valuable screen real-estate. Add the following lines to your .emacs file to get rid of them_
    (tool-bar-mode 0)
    (menu-bar-mode 0)

  • The scroll bar is also annoying, as are emacs' default scrolling methods. We can hide the scrollbar by adding this line to our .emacs file_
    (scroll-bar-mode nil)
    The following lines will also add mousewheel support_
    ;; Mousewheel
    (defun sd-mousewheel-scroll-up (event)
    "Scroll window under mouse up by five lines."
    (interactive "e")
    (let ((current-window (selected-window)))
    (select-window (posn-window (event-start event)))
    (scroll-up 5))
    (select-window current-window))))
    (defun sd-mousewheel-scroll-down (event)
    "Scroll window under mouse down by five lines."
    (interactive "e")
    (let ((current-window (selected-window)))
    (select-window (posn-window (event-start event)))
    (scroll-down 5))

    (select-window current-window))))
    (global-set-key (kbd "") 'sd-mousewheel-scroll-up)
    (global-set-key (kbd "")

Happy Hacking!


Written by Mike Goodspeed -

To use the newer, better version, type gvim. Sorry, someone had to, right?

Written by Chris -

Thanks, but I'll refrain from taking the bait. I get my fill of religious wars fighting creationism. :)

comments powered by Disqus