diff --git a/init.example.el b/init.example.el index 370dd77d4..d35a725c7 100644 --- a/init.example.el +++ b/init.example.el @@ -47,6 +47,7 @@ ;;window-select ; visually switch windows workspaces ; tab emulation, persistence & separate workspaces ;;zen ; distraction-free coding or writing + ;;minimap ; show a map of the code on the side :editor (evil +everywhere); come to the dark side, we have cookies diff --git a/modules/config/default/+emacs-bindings.el b/modules/config/default/+emacs-bindings.el index f85c6850b..7472ab5bf 100644 --- a/modules/config/default/+emacs-bindings.el +++ b/modules/config/default/+emacs-bindings.el @@ -267,7 +267,9 @@ (:when (featurep! :lang org +pomodoro) :desc "Pomodoro timer" "t" #'org-pomodoro) (:when (featurep! :ui zen) - :desc "Zen mode" "z" #'writeroom-mode)) + :desc "Zen mode" "z" #'writeroom-mode) + (:when (featurep! :ui minimap) + :desc "Minimap mode" "m" #'minimap-mode)) ;;; v --- versioning (:prefix-map ("v" . "versioning") diff --git a/modules/config/default/+evil-bindings.el b/modules/config/default/+evil-bindings.el index b7d2f20c3..5bfbb339f 100644 --- a/modules/config/default/+evil-bindings.el +++ b/modules/config/default/+evil-bindings.el @@ -655,7 +655,8 @@ :desc "Soft line wrapping" "w" #'visual-line-mode (:when (featurep! :editor word-wrap) :desc "Soft line wrapping" "w" #'+word-wrap-mode) - :desc "Zen mode" "z" #'writeroom-mode)) + :desc "Zen mode" "z" #'writeroom-mode + :desc "Minimap" "m" #'minimap-mode)) (after! which-key (let ((prefix-re (regexp-opt (list doom-leader-key doom-leader-alt-key)))) diff --git a/modules/ui/minimap/README.org b/modules/ui/minimap/README.org new file mode 100644 index 000000000..c4c3770a6 --- /dev/null +++ b/modules/ui/minimap/README.org @@ -0,0 +1,48 @@ +#+TITLE: Minimap +#+DATE: May 8, 2020 +#+SINCE: v2.0 +#+STARTUP: inlineimages nofold + +* Table of Contents :TOC_3:noexport: +- [[#description][Description]] + - [[#maintainers][Maintainers]] + - [[#module-flags][Module Flags]] + - [[#plugins][Plugins]] + - [[#hacks][Hacks]] +- [[#features][Features]] +- [[#configuration][Configuration]] +- [[#troubleshooting][Troubleshooting]] + - [[#scrolling-is-slowlaggy][Scrolling is slow/laggy]] + - [[#minimap-doesnt-close-when-disabled][Minimap doesn't close when disabled]] + +* Description +This module adds a minimap to the right side of Emacs, similar to the feature +found in many other editors. + +** Maintainers ++ [[https://github.com/rushsteve1][@rushsteve1]] (Author) + +** Module Flags +This module provides no flags. + +** Plugins ++ [[https://elpa.gnu.org/packages/minimap.html][minimap.el]] + +** Hacks ++ The colors used by the minimap are terrible so are overridden with + =custom-set-faces!= using colors out of the current DOOM theme. + +* Features +A minimap which provides an overview of the current buffer to the side, +displaying the currently visible region and the current line. You can left-click +and drag to scroll along the buffer, or right-click anywhere to jump to there. + +* Configuration +There are a number of options provided by the =minimap.el= package this module +is based on. The easiest way to see all of them is =SPC h v minimap=. + +* Troubleshooting +** Scrolling is slow/laggy +Disable the minimap using =SPC t m= + +** TODO Minimap doesn't close when disabled diff --git a/modules/ui/minimap/config.el b/modules/ui/minimap/config.el new file mode 100644 index 000000000..e631e4282 --- /dev/null +++ b/modules/ui/minimap/config.el @@ -0,0 +1,14 @@ +;;; ~/Nextcloud/Dotfiles/doom/minimap/config.el -*- lexical-binding: t; -*- + +(use-package! minimap + :hook doom-load-theme-hook + :config + (setq minimap-window-location 'right + minimap-update-delay 0 + minimap-width-fraction 0.09 + minimap-minimum-width 15) + (custom-set-faces! + `(minimap-current-line-face + :background ,(doom-color 'selection)) + `(minimap-active-region-background + :background ,(doom-color 'vertical-bar)))) diff --git a/modules/ui/minimap/packages.el b/modules/ui/minimap/packages.el new file mode 100644 index 000000000..a3b91b021 --- /dev/null +++ b/modules/ui/minimap/packages.el @@ -0,0 +1,4 @@ +;; -*- no-byte-compile: t; -*- +;;; ~/Nextcloud/Dotfiles/doom/minimap/packages.el + +(package! minimap)