mpwang / emacs-minimap

A minimap sidebar for emacs

Home Page:http://ldlework.com/blog/2011/11/14/emacs-minimap

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

minimap.el --- Minimap sidebar for Emacs

Copyright (C) 2011 Dustin Lacewell

Authors: Dustin Lacewell <dlacewell@gmail.com>
         David Engster <dengste@eml.cc>
Keywords: minimap
Version: 0.1

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

==Commentary:==

Heavily based off minimap.el by David Engster however I
have refactored it a bit to support only a single global
minimap window. Usually this should be opened on startup
when there is a single window. Some defaults have also 
been changed.

This file is an implementation of a minimap sidebar, i.e., a
smaller display of the current buffer on the left side. It
highlights the currently shown region and updates its position
automatically. You can navigate in the minibar by dragging the
active region with the mouse, which will scroll the corresponding
edit buffer.

Usage:
 * Put minimap.el in your load path.
 * (require 'minimap)
 * Use 'M-x minimap-toggle' to toggle the minimap.
 * Use 'M-x minimap-create' to create the minimap.
 * Use 'M-x minimap-kill' to kill the minimap.
 * Use 'M-x customize-group RET minimap RET' to adapt minimap to your needs.

Additionally when using with switch-window, place this after
switch-window in init.el to exclude minimap from switching to.

(defadvice switch-window-list (after swtich-window-list-exclude-minimap nil activate)
  "Exclude minimap window from window list available to swtich."
  (when (boundp 'minimap-mode)
    (setq ad-return-value
          (delq nil
                (mapcar (lambda (win)
                          (let ((name (buffer-name (window-buffer win))))
                            (if (string-match minimap-buffer-name-prefix name) nil win)))
                        ad-return-value)))))

About

A minimap sidebar for emacs

http://ldlework.com/blog/2011/11/14/emacs-minimap


Languages

Language:Emacs Lisp 100.0%