2015-09-16 09:24:25 +00:00
|
|
|
;;; keybindings.el --- Spacemacs Base Layer key-bindings File
|
2015-01-14 04:12:56 +00:00
|
|
|
;;
|
2016-01-12 02:40:54 +00:00
|
|
|
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
|
2015-01-14 04:12:56 +00:00
|
|
|
;;
|
|
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
2016-04-03 04:12:28 +00:00
|
|
|
;; ---------------------------------------------------------------------------
|
|
|
|
;; Prefixes
|
|
|
|
;; ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
;; We define prefix commands only for the sake of which-key
|
|
|
|
(setq spacemacs/key-binding-prefixes '(("a" "applications")
|
|
|
|
("ai" "irc")
|
|
|
|
("as" "shells")
|
|
|
|
("b" "buffers")
|
|
|
|
("c" "compile/comments")
|
|
|
|
("C" "capture/colors")
|
|
|
|
("e" "errors")
|
|
|
|
("f" "files")
|
|
|
|
("fC" "files/convert")
|
|
|
|
("fe" "emacs(spacemacs)")
|
|
|
|
("fv" "variables")
|
|
|
|
("g" "git/versions-control")
|
|
|
|
("h" "help")
|
|
|
|
("hd" "help-describe")
|
|
|
|
("i" "insertion")
|
|
|
|
("j" "jump/join/split")
|
|
|
|
("k" "lisp")
|
|
|
|
("kd" "delete")
|
|
|
|
("kD" "delete-backward")
|
|
|
|
("k`" "hybrid")
|
|
|
|
("n" "narrow/numbers")
|
|
|
|
("p" "projects")
|
|
|
|
("p$" "projects/shell")
|
|
|
|
("q" "quit")
|
|
|
|
("r" "registers/rings/resume")
|
|
|
|
("Re" "elisp")
|
|
|
|
("Rp" "pcre")
|
|
|
|
("s" "search/symbol")
|
|
|
|
("sa" "ag")
|
|
|
|
("sg" "grep")
|
|
|
|
("sk" "ack")
|
2016-11-12 06:32:33 +00:00
|
|
|
("sr" "ripgrep")
|
2016-04-03 04:12:28 +00:00
|
|
|
("st" "pt")
|
|
|
|
("sw" "web")
|
|
|
|
("t" "toggles")
|
|
|
|
("tC" "colors")
|
|
|
|
("tE" "editing-styles")
|
|
|
|
("th" "highlight")
|
|
|
|
("tm" "modeline")
|
|
|
|
("T" "UI toggles/themes")
|
|
|
|
("C-t" "other toggles")
|
|
|
|
("w" "windows")
|
|
|
|
("wp" "popup")
|
|
|
|
("x" "text")
|
|
|
|
("xa" "align")
|
|
|
|
("xd" "delete")
|
|
|
|
("xg" "google-translate")
|
|
|
|
("xl" "lines")
|
|
|
|
("xm" "move")
|
|
|
|
("xt" "transpose")
|
|
|
|
("xw" "words")
|
|
|
|
("z" "zoom")))
|
|
|
|
(mapc (lambda (x) (apply #'spacemacs/declare-prefix x))
|
|
|
|
spacemacs/key-binding-prefixes)
|
|
|
|
|
2014-09-01 16:18:34 +00:00
|
|
|
;; instantly display current keystrokes in mini buffer
|
2014-08-05 13:49:09 +00:00
|
|
|
(setq echo-keystrokes 0.02)
|
2014-09-21 03:08:58 +00:00
|
|
|
;; auto-indent on RET
|
|
|
|
(define-key global-map (kbd "RET") 'newline-and-indent)
|
2015-05-28 04:05:29 +00:00
|
|
|
|
|
|
|
;; improve delete-other-windows
|
2015-08-23 01:47:30 +00:00
|
|
|
(define-key global-map (kbd "C-x 1") 'spacemacs/toggle-maximize-buffer)
|
2015-05-28 04:05:29 +00:00
|
|
|
|
2014-10-22 18:23:10 +00:00
|
|
|
;; alternate binding to search next occurrence with isearch without
|
|
|
|
;; exiting isearch
|
|
|
|
(define-key isearch-mode-map (kbd "S-<return>") 'isearch-repeat-forward)
|
|
|
|
(define-key isearch-mode-map (kbd "M-S-<return>") 'isearch-repeat-backward)
|
2015-03-31 11:51:08 +00:00
|
|
|
;; Escape from isearch-mode("/" and "?" in evil-mode) like vim
|
|
|
|
(define-key isearch-mode-map (kbd "<escape>") 'isearch-cancel)
|
2014-10-04 04:28:42 +00:00
|
|
|
|
2014-12-10 15:57:45 +00:00
|
|
|
;; Make <escape> quit as much as possible
|
|
|
|
(define-key minibuffer-local-map (kbd "<escape>") 'keyboard-escape-quit)
|
|
|
|
(define-key minibuffer-local-ns-map (kbd "<escape>") 'keyboard-escape-quit)
|
|
|
|
(define-key minibuffer-local-completion-map (kbd "<escape>") 'keyboard-escape-quit)
|
|
|
|
(define-key minibuffer-local-must-match-map (kbd "<escape>") 'keyboard-escape-quit)
|
|
|
|
(define-key minibuffer-local-isearch-map (kbd "<escape>") 'keyboard-escape-quit)
|
|
|
|
|
2015-03-26 05:48:16 +00:00
|
|
|
;; linum margin bindings-------------------------------------------------------
|
|
|
|
(global-set-key (kbd "<left-margin> <down-mouse-1>") 'spacemacs/md-select-linum)
|
|
|
|
(global-set-key (kbd "<left-margin> <mouse-1>") 'spacemacs/mu-select-linum)
|
|
|
|
(global-set-key (kbd "<left-margin> <double-mouse-1>") 'spacemacs/select-current-block)
|
|
|
|
(global-set-key (kbd "<left-margin> <drag-mouse-1>") 'spacemacs/mu-select-linum)
|
|
|
|
|
2014-09-01 16:18:34 +00:00
|
|
|
;; ---------------------------------------------------------------------------
|
2015-12-21 04:00:09 +00:00
|
|
|
;; spacemacs leader key bindings
|
2014-09-01 16:18:34 +00:00
|
|
|
;; ---------------------------------------------------------------------------
|
2013-01-17 19:17:38 +00:00
|
|
|
|
2014-10-29 02:16:30 +00:00
|
|
|
;; Universal argument ---------------------------------------------------------
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys "u" 'universal-argument)
|
2015-09-08 10:30:18 +00:00
|
|
|
(when (memq dotspacemacs-editing-style '(vim hybrid))
|
|
|
|
(define-key universal-argument-map
|
|
|
|
(kbd (concat dotspacemacs-leader-key " u"))
|
|
|
|
'universal-argument-more))
|
2014-09-04 03:46:07 +00:00
|
|
|
;; shell command -------------------------------------------------------------
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys "!" 'shell-command)
|
2013-01-17 19:17:38 +00:00
|
|
|
;; applications ---------------------------------------------------------------
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2014-07-15 03:28:39 +00:00
|
|
|
"ac" 'calc-dispatch
|
2015-11-21 05:48:48 +00:00
|
|
|
"ap" 'list-processes
|
|
|
|
"aP" 'proced
|
2014-09-04 03:46:07 +00:00
|
|
|
"au" 'undo-tree-visualize)
|
2013-01-17 19:17:38 +00:00
|
|
|
;; buffers --------------------------------------------------------------------
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2016-10-03 02:02:03 +00:00
|
|
|
"TAB" 'spacemacs/alternate-buffer
|
|
|
|
"bd" 'spacemacs/kill-this-buffer
|
|
|
|
"be" 'spacemacs/safe-erase-buffer
|
|
|
|
"bh" 'spacemacs/home
|
2016-11-20 18:21:58 +00:00
|
|
|
"b C-d" 'spacemacs/kill-other-buffers
|
2016-11-23 21:44:13 +00:00
|
|
|
"b C-S-d" 'spacemacs/kill-matching-buffers-rudely
|
2016-10-03 02:02:03 +00:00
|
|
|
"bn" 'next-buffer
|
2016-11-14 17:15:22 +00:00
|
|
|
"bm" 'view-echo-area-messages
|
2016-10-03 02:02:03 +00:00
|
|
|
"bN" 'spacemacs/new-empty-buffer
|
|
|
|
"bP" 'spacemacs/copy-clipboard-to-whole-buffer
|
|
|
|
"bp" 'previous-buffer
|
|
|
|
"bR" 'spacemacs/safe-revert-buffer
|
|
|
|
"bs" 'spacemacs/switch-to-scratch-buffer
|
|
|
|
"bY" 'spacemacs/copy-whole-buffer-to-clipboard
|
|
|
|
"bw" 'read-only-mode)
|
2016-10-21 04:23:33 +00:00
|
|
|
(dotimes (i 9)
|
|
|
|
(let ((n (+ i 1)))
|
|
|
|
(spacemacs/set-leader-keys (format "b%i" n)
|
|
|
|
(intern (format "buffer-to-window-%s" n)))))
|
2013-11-26 05:24:50 +00:00
|
|
|
;; Cycling settings -----------------------------------------------------------
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys "Tn" 'spacemacs/cycle-spacemacs-theme)
|
2013-02-07 16:36:01 +00:00
|
|
|
;; errors ---------------------------------------------------------------------
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2015-02-10 23:03:06 +00:00
|
|
|
"en" 'spacemacs/next-error
|
2016-01-24 23:17:31 +00:00
|
|
|
"eN" 'spacemacs/previous-error
|
2016-01-26 05:51:53 +00:00
|
|
|
"ep" 'spacemacs/previous-error)
|
2016-06-08 09:30:25 +00:00
|
|
|
(spacemacs|define-transient-state error
|
|
|
|
:title "Error transient state"
|
|
|
|
:hint-is-doc t
|
|
|
|
:dynamic-hint
|
2016-10-09 16:57:46 +00:00
|
|
|
(let ((sys (spacemacs/error-delegate)))
|
2016-06-08 09:30:25 +00:00
|
|
|
(cond
|
|
|
|
((eq 'flycheck sys)
|
|
|
|
"\nBrowsing flycheck errors from this buffer.")
|
|
|
|
((eq 'emacs sys)
|
|
|
|
(let ((buf (next-error-find-buffer)))
|
|
|
|
(if buf
|
|
|
|
(concat "\nBrowsing entries from \""
|
|
|
|
(buffer-name buf)
|
|
|
|
"\""
|
|
|
|
(with-current-buffer buf
|
|
|
|
(when spacemacs--gne-line-func
|
|
|
|
(format " (%d of %d)"
|
|
|
|
(max 1 (1+ (- spacemacs--gne-cur-line
|
|
|
|
spacemacs--gne-min-line)))
|
|
|
|
(1+ (- spacemacs--gne-max-line
|
|
|
|
spacemacs--gne-min-line))))))
|
|
|
|
"\nNo next-error capable buffer found.")))))
|
|
|
|
:bindings
|
|
|
|
("n" spacemacs/next-error "next")
|
|
|
|
("p" spacemacs/previous-error "prev")
|
|
|
|
("q" nil "quit" :exit t)
|
|
|
|
:evil-leader "e.")
|
2013-06-05 11:34:55 +00:00
|
|
|
;; file -----------------------------------------------------------------------
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2015-07-05 04:18:42 +00:00
|
|
|
"fc" 'spacemacs/copy-file
|
2015-08-23 01:47:30 +00:00
|
|
|
"fD" 'spacemacs/delete-current-buffer-file
|
|
|
|
"fei" 'spacemacs/find-user-init-file
|
|
|
|
"fed" 'spacemacs/find-dotfile
|
|
|
|
"feD" 'spacemacs/ediff-dotfile-and-template
|
2015-04-19 03:40:24 +00:00
|
|
|
"feR" 'dotspacemacs/sync-configuration-layers
|
2015-01-01 04:53:38 +00:00
|
|
|
"fev" 'spacemacs/display-and-copy-version
|
2015-08-28 06:13:40 +00:00
|
|
|
"fCd" 'spacemacs/unix2dos
|
|
|
|
"fCu" 'spacemacs/dos2unix
|
2015-02-23 05:14:12 +00:00
|
|
|
"fg" 'rgrep
|
2015-07-23 12:28:34 +00:00
|
|
|
"fl" 'find-file-literally
|
2015-10-24 07:11:03 +00:00
|
|
|
"fE" 'spacemacs/sudo-edit
|
2016-08-06 16:14:30 +00:00
|
|
|
"fo" 'spacemacs/open-file-or-directory-in-external-app
|
2015-08-23 01:47:30 +00:00
|
|
|
"fR" 'spacemacs/rename-current-buffer-file
|
2015-06-16 02:56:55 +00:00
|
|
|
"fS" 'evil-write-all
|
2016-01-03 11:20:14 +00:00
|
|
|
"fs" 'save-buffer
|
2015-10-15 12:02:50 +00:00
|
|
|
"fvd" 'add-dir-local-variable
|
|
|
|
"fvf" 'add-file-local-variable
|
|
|
|
"fvp" 'add-file-local-variable-prop-line
|
2015-08-23 01:47:30 +00:00
|
|
|
"fy" 'spacemacs/show-and-copy-buffer-filename)
|
2016-01-07 17:50:21 +00:00
|
|
|
;; help -----------------------------------------------------------------------
|
|
|
|
(spacemacs/set-leader-keys
|
|
|
|
"hdb" 'describe-bindings
|
|
|
|
"hdc" 'describe-char
|
|
|
|
"hdf" 'describe-function
|
|
|
|
"hdk" 'describe-key
|
2016-01-11 20:47:04 +00:00
|
|
|
"hdl" 'spacemacs/describe-last-keys
|
2016-01-07 17:50:21 +00:00
|
|
|
"hdp" 'describe-package
|
2016-05-31 11:46:45 +00:00
|
|
|
"hdP" 'configuration-layer/describe-package
|
2016-01-07 17:50:21 +00:00
|
|
|
"hds" 'spacemacs/describe-system-info
|
|
|
|
"hdt" 'describe-theme
|
2016-01-12 13:19:47 +00:00
|
|
|
"hdv" 'describe-variable
|
2016-01-26 05:51:53 +00:00
|
|
|
"hI" 'spacemacs/report-issue
|
2016-01-12 13:19:47 +00:00
|
|
|
"hn" 'view-emacs-news)
|
2013-05-07 00:59:13 +00:00
|
|
|
;; insert stuff ---------------------------------------------------------------
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2015-07-05 04:18:42 +00:00
|
|
|
"iJ" 'spacemacs/insert-line-below-no-indent
|
|
|
|
"iK" 'spacemacs/insert-line-above-no-indent
|
2015-08-23 01:47:30 +00:00
|
|
|
"ik" 'spacemacs/evil-insert-line-above
|
|
|
|
"ij" 'spacemacs/evil-insert-line-below)
|
2013-07-09 19:30:59 +00:00
|
|
|
;; format ---------------------------------------------------------------------
|
2016-04-05 10:52:54 +00:00
|
|
|
;; `SPC j k' key binding for a frequent action: go and indent line below the point
|
|
|
|
;; `SPC J' split the current line at point and indent it
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2015-04-26 17:26:21 +00:00
|
|
|
"jo" 'open-line
|
2015-03-25 07:32:57 +00:00
|
|
|
"j=" 'spacemacs/indent-region-or-buffer
|
2016-01-12 06:17:41 +00:00
|
|
|
"jS" 'spacemacs/split-and-new-line
|
2015-08-23 01:47:30 +00:00
|
|
|
"jk" 'spacemacs/evil-goto-next-line-and-indent)
|
2015-03-25 07:32:57 +00:00
|
|
|
|
2015-12-28 02:13:57 +00:00
|
|
|
;; navigation/jumping ---------------------------------------------------------
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2015-12-28 02:13:57 +00:00
|
|
|
"j0" 'spacemacs/push-mark-and-goto-beginning-of-line
|
|
|
|
"j$" 'spacemacs/push-mark-and-goto-end-of-line
|
2016-05-13 06:40:28 +00:00
|
|
|
"jf" 'find-function
|
2016-08-26 01:19:21 +00:00
|
|
|
"jv" 'find-variable)
|
2015-11-12 10:45:53 +00:00
|
|
|
|
2013-11-26 02:04:18 +00:00
|
|
|
;; Compilation ----------------------------------------------------------------
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2015-11-12 10:45:53 +00:00
|
|
|
"cC" 'compile
|
2015-12-07 21:30:38 +00:00
|
|
|
"ck" 'kill-compilation
|
2015-11-12 10:45:53 +00:00
|
|
|
"cr" 'recompile
|
2016-03-13 16:19:21 +00:00
|
|
|
"cd" 'spacemacs/close-compilation-window)
|
2016-03-12 16:48:32 +00:00
|
|
|
(with-eval-after-load 'compile
|
2016-11-13 12:34:23 +00:00
|
|
|
(evil-define-key 'motion compilation-mode-map (kbd "gf") 'find-file-at-point)
|
2016-03-12 16:48:32 +00:00
|
|
|
(define-key compilation-mode-map "r" 'recompile)
|
|
|
|
(define-key compilation-mode-map "g" nil))
|
2013-01-29 15:28:06 +00:00
|
|
|
;; narrow & widen -------------------------------------------------------------
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2015-04-03 02:43:21 +00:00
|
|
|
"nr" 'narrow-to-region
|
|
|
|
"np" 'narrow-to-page
|
|
|
|
"nf" 'narrow-to-defun
|
|
|
|
"nw" 'widen)
|
2013-01-31 15:05:57 +00:00
|
|
|
;; toggle ---------------------------------------------------------------------
|
2015-01-30 05:18:48 +00:00
|
|
|
(spacemacs|add-toggle highlight-current-line-globally
|
2016-05-31 13:11:00 +00:00
|
|
|
:mode global-hl-line-mode
|
2015-08-27 06:58:05 +00:00
|
|
|
:documentation "Globally highlight the current line."
|
2015-07-25 13:14:53 +00:00
|
|
|
:evil-leader "thh")
|
2015-01-29 05:08:48 +00:00
|
|
|
(spacemacs|add-toggle truncate-lines
|
2015-10-13 11:41:48 +00:00
|
|
|
:status truncate-lines
|
2015-07-25 13:14:53 +00:00
|
|
|
:on (toggle-truncate-lines)
|
2015-10-13 11:41:48 +00:00
|
|
|
:off (toggle-truncate-lines -1)
|
2015-08-27 06:58:05 +00:00
|
|
|
:documentation "Truncate long lines (no wrap)."
|
2015-07-25 13:14:53 +00:00
|
|
|
:evil-leader "tl")
|
2015-01-29 05:08:48 +00:00
|
|
|
(spacemacs|add-toggle visual-line-navigation
|
2015-07-25 13:14:53 +00:00
|
|
|
:status visual-line-mode
|
2016-04-19 12:21:45 +00:00
|
|
|
:on
|
|
|
|
(progn
|
|
|
|
(visual-line-mode)
|
|
|
|
(evil-define-minor-mode-key 'motion 'visual-line-mode "j" 'evil-next-visual-line)
|
|
|
|
(evil-define-minor-mode-key 'motion 'visual-line-mode "k" 'evil-previous-visual-line)
|
|
|
|
(when (bound-and-true-p evil-escape-mode)
|
|
|
|
(evil-escape-mode -1)
|
|
|
|
(setq evil-escape-motion-state-shadowed-func nil)
|
|
|
|
(evil-define-minor-mode-key 'motion 'visual-line-mode "j" 'evil-next-visual-line)
|
|
|
|
(evil-define-minor-mode-key 'motion 'visual-line-mode "k" 'evil-previous-visual-line)
|
|
|
|
(evil-escape-mode))
|
|
|
|
(evil-normalize-keymaps))
|
|
|
|
:off
|
|
|
|
(progn
|
|
|
|
(visual-line-mode -1)
|
|
|
|
(evil-normalize-keymaps))
|
2015-07-25 13:14:53 +00:00
|
|
|
:documentation "Move point according to visual lines."
|
|
|
|
:evil-leader "tL")
|
2015-03-08 04:09:37 +00:00
|
|
|
(spacemacs|add-toggle auto-fill-mode
|
2015-07-25 13:14:53 +00:00
|
|
|
:status auto-fill-function
|
|
|
|
:on (auto-fill-mode)
|
|
|
|
:off (auto-fill-mode -1)
|
|
|
|
:documentation "Break line beyond `current-fill-column` while editing."
|
|
|
|
:evil-leader "tF")
|
2015-03-08 04:52:03 +00:00
|
|
|
(spacemacs|add-toggle debug-on-error
|
2015-10-19 10:12:15 +00:00
|
|
|
:status debug-on-error
|
|
|
|
:on (setq debug-on-error t)
|
|
|
|
:off (setq debug-on-error nil)
|
2015-07-25 13:14:53 +00:00
|
|
|
:documentation "Toggle display of backtrace when an error happens."
|
|
|
|
:evil-leader "tD")
|
2015-04-10 14:30:46 +00:00
|
|
|
(spacemacs|add-toggle fringe
|
2015-07-25 13:14:53 +00:00
|
|
|
:status (not (equal fringe-mode 0))
|
|
|
|
:on (call-interactively 'fringe-mode)
|
|
|
|
:off (fringe-mode 0)
|
|
|
|
:documentation "Display the fringe in GUI mode."
|
|
|
|
:evil-leader "Tf")
|
2015-04-10 14:30:46 +00:00
|
|
|
(spacemacs|add-toggle fullscreen-frame
|
2015-10-11 12:13:16 +00:00
|
|
|
:status (memq (frame-parameter nil 'fullscreen) '(fullscreen fullboth))
|
2015-07-25 13:14:53 +00:00
|
|
|
:on (spacemacs/toggle-frame-fullscreen)
|
2015-10-11 12:13:16 +00:00
|
|
|
:off (spacemacs/toggle-frame-fullscreen)
|
2015-07-25 13:14:53 +00:00
|
|
|
:documentation "Display the current frame in full screen."
|
|
|
|
:evil-leader "TF")
|
2015-04-10 14:30:46 +00:00
|
|
|
(spacemacs|add-toggle maximize-frame
|
2016-02-02 15:27:34 +00:00
|
|
|
:status (eq (frame-parameter nil 'fullscreen) 'maximized)
|
2015-07-25 13:14:53 +00:00
|
|
|
:on (toggle-frame-maximized)
|
2015-10-11 12:13:16 +00:00
|
|
|
:off (toggle-frame-maximized)
|
2015-07-25 13:14:53 +00:00
|
|
|
:documentation "Maximize the current frame."
|
|
|
|
:evil-leader "TM")
|
2015-05-16 18:40:31 +00:00
|
|
|
(spacemacs|add-toggle mode-line
|
2015-11-16 21:48:01 +00:00
|
|
|
:status (not hidden-mode-line-mode)
|
|
|
|
:on (hidden-mode-line-mode -1)
|
|
|
|
:off (hidden-mode-line-mode)
|
2015-07-25 13:14:53 +00:00
|
|
|
:documentation "Toggle the visibility of modeline."
|
2016-10-21 22:40:38 +00:00
|
|
|
:evil-leader "tmT")
|
2016-10-19 19:22:58 +00:00
|
|
|
(spacemacs|add-toggle display-time
|
|
|
|
:mode display-time-mode
|
|
|
|
:documentation "Display time in modeline."
|
2016-10-21 22:40:38 +00:00
|
|
|
:evil-leader "tmt")
|
2016-10-19 19:39:09 +00:00
|
|
|
(spacemacs|add-toggle syntax-highlighting
|
|
|
|
:mode font-lock-mode
|
|
|
|
:documentation "Toggle syntax highlighting."
|
2016-10-21 22:46:05 +00:00
|
|
|
:evil-leader "ths")
|
2015-04-10 14:30:46 +00:00
|
|
|
(spacemacs|add-toggle transparent-frame
|
2015-07-25 13:14:53 +00:00
|
|
|
:status nil
|
|
|
|
:on (spacemacs/toggle-transparency)
|
|
|
|
:documentation "Make the current frame non-opaque."
|
|
|
|
:evil-leader "TT")
|
2015-01-29 05:08:48 +00:00
|
|
|
(spacemacs|add-toggle tool-bar
|
2015-07-25 13:14:53 +00:00
|
|
|
:if window-system
|
2016-05-31 13:11:00 +00:00
|
|
|
:mode tool-bar-mode
|
2015-07-25 13:14:53 +00:00
|
|
|
:documentation "Display the tool bar in GUI mode."
|
|
|
|
:evil-leader "Tt")
|
2015-01-29 05:08:48 +00:00
|
|
|
(spacemacs|add-toggle menu-bar
|
2016-06-21 01:50:30 +00:00
|
|
|
:if window-system
|
2016-05-31 13:11:00 +00:00
|
|
|
:mode menu-bar-mode
|
2015-07-25 13:14:53 +00:00
|
|
|
:documentation "Display the menu bar."
|
|
|
|
:evil-leader "Tm")
|
2015-04-15 22:57:31 +00:00
|
|
|
(spacemacs|add-toggle semantic-stickyfunc
|
2016-05-31 13:11:00 +00:00
|
|
|
:mode semantic-stickyfunc-mode
|
2015-07-25 13:14:53 +00:00
|
|
|
:documentation "Enable semantic-stickyfunc."
|
2016-04-01 04:21:52 +00:00
|
|
|
:evil-leader "TS")
|
2015-08-27 06:58:05 +00:00
|
|
|
(spacemacs|add-toggle semantic-stickyfunc-globally
|
2016-05-31 13:11:00 +00:00
|
|
|
:mode global-semantic-stickyfunc-mode
|
2015-07-25 13:14:53 +00:00
|
|
|
:documentation "Enable semantic-stickyfunc globally."
|
2016-04-01 04:21:52 +00:00
|
|
|
:evil-leader "T C-S")
|
2014-12-12 22:59:49 +00:00
|
|
|
;; quit -----------------------------------------------------------------------
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2015-01-29 16:19:55 +00:00
|
|
|
"qs" 'spacemacs/save-buffers-kill-emacs
|
|
|
|
"qq" 'spacemacs/prompt-kill-emacs
|
|
|
|
"qQ" 'spacemacs/kill-emacs
|
|
|
|
"qz" 'spacemacs/frame-killer)
|
2013-02-06 15:43:36 +00:00
|
|
|
;; window ---------------------------------------------------------------------
|
2014-12-24 05:08:56 +00:00
|
|
|
(defun split-window-below-and-focus ()
|
|
|
|
"Split the window vertically and focus the new window."
|
|
|
|
(interactive)
|
|
|
|
(split-window-below)
|
|
|
|
(windmove-down)
|
|
|
|
(when (and (boundp 'golden-ratio-mode)
|
|
|
|
(symbol-value golden-ratio-mode))
|
|
|
|
(golden-ratio)))
|
|
|
|
|
|
|
|
(defun split-window-right-and-focus ()
|
|
|
|
"Split the window horizontally and focus the new window."
|
|
|
|
(interactive)
|
|
|
|
(split-window-right)
|
|
|
|
(windmove-right)
|
|
|
|
(when (and (boundp 'golden-ratio-mode)
|
|
|
|
(symbol-value golden-ratio-mode))
|
|
|
|
(golden-ratio)))
|
|
|
|
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2016-12-25 06:15:35 +00:00
|
|
|
"w TAB" 'spacemacs/alternate-window
|
2015-08-23 01:47:30 +00:00
|
|
|
"w2" 'spacemacs/layout-double-columns
|
|
|
|
"w3" 'spacemacs/layout-triple-columns
|
|
|
|
"wb" 'spacemacs/switch-to-minibuffer-window
|
2016-06-26 03:40:41 +00:00
|
|
|
"wd" 'spacemacs/delete-window
|
2016-02-12 08:08:48 +00:00
|
|
|
"wt" 'spacemacs/toggle-current-window-dedication
|
2016-01-22 23:51:43 +00:00
|
|
|
"wf" 'follow-mode
|
2016-05-18 06:59:38 +00:00
|
|
|
"wF" 'make-frame
|
2014-04-14 01:23:54 +00:00
|
|
|
"wH" 'evil-window-move-far-left
|
2015-08-30 08:33:02 +00:00
|
|
|
"w <S-left>" 'evil-window-move-far-left
|
2014-04-14 01:23:54 +00:00
|
|
|
"wh" 'evil-window-left
|
2015-08-30 08:33:02 +00:00
|
|
|
"w <left>" 'evil-window-left
|
2014-04-14 01:23:54 +00:00
|
|
|
"wJ" 'evil-window-move-very-bottom
|
2015-08-30 08:33:02 +00:00
|
|
|
"w <S-down>" 'evil-window-move-very-bottom
|
2014-04-14 01:23:54 +00:00
|
|
|
"wj" 'evil-window-down
|
2015-08-30 08:33:02 +00:00
|
|
|
"w <down>" 'evil-window-down
|
2014-04-14 01:23:54 +00:00
|
|
|
"wK" 'evil-window-move-very-top
|
2015-08-30 08:33:02 +00:00
|
|
|
"w <S-up>" 'evil-window-move-very-top
|
2014-04-14 01:23:54 +00:00
|
|
|
"wk" 'evil-window-up
|
2015-08-30 08:33:02 +00:00
|
|
|
"w <up>" 'evil-window-up
|
2014-04-14 01:23:54 +00:00
|
|
|
"wL" 'evil-window-move-far-right
|
2015-08-30 08:33:02 +00:00
|
|
|
"w <S-right>" 'evil-window-move-far-right
|
2014-04-14 01:23:54 +00:00
|
|
|
"wl" 'evil-window-right
|
2015-08-30 08:33:02 +00:00
|
|
|
"w <right>" 'evil-window-right
|
2015-08-23 01:47:30 +00:00
|
|
|
"wm" 'spacemacs/toggle-maximize-buffer
|
2016-07-01 18:20:28 +00:00
|
|
|
"wc" 'spacemacs/toggle-centered-buffer-mode
|
|
|
|
"wC" 'spacemacs/centered-buffer-mode-full-width
|
2014-12-05 01:54:05 +00:00
|
|
|
"wo" 'other-frame
|
2016-08-23 15:58:23 +00:00
|
|
|
"wr" 'spacemacs/rotate-windows-forward
|
2016-04-11 14:16:35 +00:00
|
|
|
"wR" 'spacemacs/rotate-windows-backward
|
2014-12-03 05:20:18 +00:00
|
|
|
"ws" 'split-window-below
|
2014-12-24 05:08:56 +00:00
|
|
|
"wS" 'split-window-below-and-focus
|
2014-12-14 14:53:37 +00:00
|
|
|
"w-" 'split-window-below
|
2014-04-14 01:23:54 +00:00
|
|
|
"wU" 'winner-redo
|
|
|
|
"wu" 'winner-undo
|
2014-12-03 05:20:18 +00:00
|
|
|
"wv" 'split-window-right
|
2014-12-24 05:08:56 +00:00
|
|
|
"wV" 'split-window-right-and-focus
|
2015-03-04 15:00:10 +00:00
|
|
|
"ww" 'other-window
|
2015-03-17 06:06:49 +00:00
|
|
|
"w/" 'split-window-right
|
2016-07-01 18:20:28 +00:00
|
|
|
"w=" 'balance-windows
|
2016-11-12 20:22:46 +00:00
|
|
|
"w+" 'spacemacs/window-layout-toggle
|
2016-07-01 18:20:28 +00:00
|
|
|
"w_" 'spacemacs/maximize-horizontally)
|
2013-02-20 19:08:23 +00:00
|
|
|
;; text -----------------------------------------------------------------------
|
2015-09-28 18:50:58 +00:00
|
|
|
(defalias 'count-region 'count-words-region)
|
|
|
|
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2016-02-09 20:02:30 +00:00
|
|
|
"xa&" 'spacemacs/align-repeat-ampersand
|
|
|
|
"xa(" 'spacemacs/align-repeat-left-paren
|
|
|
|
"xa)" 'spacemacs/align-repeat-right-paren
|
2015-08-23 01:47:30 +00:00
|
|
|
"xa," 'spacemacs/align-repeat-comma
|
2016-02-09 20:02:30 +00:00
|
|
|
"xa." 'spacemacs/align-repeat-decimal
|
2015-08-23 01:47:30 +00:00
|
|
|
"xa:" 'spacemacs/align-repeat-colon
|
2016-02-09 20:02:30 +00:00
|
|
|
"xa;" 'spacemacs/align-repeat-semicolon
|
2015-08-23 01:47:30 +00:00
|
|
|
"xa=" 'spacemacs/align-repeat-equal
|
2016-02-25 19:16:34 +00:00
|
|
|
"xa\\" 'spacemacs/align-repeat-backslash
|
2016-02-09 20:02:30 +00:00
|
|
|
"xaa" 'align
|
|
|
|
"xac" 'align-current
|
|
|
|
"xam" 'spacemacs/align-repeat-math-oper
|
|
|
|
"xar" 'spacemacs/align-repeat
|
2015-08-23 01:47:30 +00:00
|
|
|
"xa|" 'spacemacs/align-repeat-bar
|
2015-09-28 18:50:58 +00:00
|
|
|
"xc" 'count-region
|
2014-04-14 01:23:54 +00:00
|
|
|
"xdw" 'delete-trailing-whitespace
|
2016-01-15 10:30:48 +00:00
|
|
|
"xjc" 'set-justification-center
|
|
|
|
"xjf" 'set-justification-full
|
|
|
|
"xjl" 'set-justification-left
|
|
|
|
"xjn" 'set-justification-none
|
|
|
|
"xjr" 'set-justification-right
|
2016-07-07 22:35:43 +00:00
|
|
|
"xld" 'spacemacs/duplicate-line-or-region
|
2015-08-27 22:17:16 +00:00
|
|
|
"xls" 'spacemacs/sort-lines
|
|
|
|
"xlu" 'spacemacs/uniquify-lines
|
2014-04-14 01:23:54 +00:00
|
|
|
"xtc" 'transpose-chars
|
|
|
|
"xtl" 'transpose-lines
|
|
|
|
"xtw" 'transpose-words
|
|
|
|
"xU" 'upcase-region
|
|
|
|
"xu" 'downcase-region
|
2016-06-15 11:40:06 +00:00
|
|
|
"xwc" 'spacemacs/count-words-analysis
|
|
|
|
"x TAB" 'indent-rigidly)
|
|
|
|
|
|
|
|
(define-key indent-rigidly-map "h" 'indent-rigidly-left)
|
|
|
|
(define-key indent-rigidly-map "l" 'indent-rigidly-right)
|
|
|
|
(define-key indent-rigidly-map "H" 'indent-rigidly-left-to-tab-stop)
|
|
|
|
(define-key indent-rigidly-map "L" 'indent-rigidly-right-to-tab-stop)
|
|
|
|
|
2015-03-26 06:04:35 +00:00
|
|
|
;; shell ----------------------------------------------------------------------
|
2015-09-29 05:07:57 +00:00
|
|
|
(with-eval-after-load 'shell
|
|
|
|
(evil-define-key 'insert comint-mode-map [up] 'comint-previous-input)
|
|
|
|
(evil-define-key 'insert comint-mode-map [down] 'comint-next-input))
|
2015-02-12 05:00:23 +00:00
|
|
|
|
|
|
|
;; ---------------------------------------------------------------------------
|
2016-01-30 11:32:53 +00:00
|
|
|
;; Transient-states
|
2015-02-12 05:00:23 +00:00
|
|
|
;; ---------------------------------------------------------------------------
|
|
|
|
|
2016-01-30 11:32:53 +00:00
|
|
|
;; Buffer transient state
|
2015-03-26 05:15:16 +00:00
|
|
|
|
2016-01-20 02:55:38 +00:00
|
|
|
(spacemacs|define-transient-state buffer
|
|
|
|
:title "Buffer Selection Transient State"
|
2015-03-26 05:15:16 +00:00
|
|
|
:bindings
|
2016-07-14 08:13:55 +00:00
|
|
|
("n" next-buffer "next")
|
|
|
|
("N" previous-buffer "previous")
|
|
|
|
("p" previous-buffer "previous")
|
2016-06-04 12:46:31 +00:00
|
|
|
("K" spacemacs/kill-this-buffer "kill")
|
2016-01-14 02:43:45 +00:00
|
|
|
("q" nil "quit" :exit t))
|
2016-01-20 02:55:38 +00:00
|
|
|
(spacemacs/set-leader-keys "b." 'spacemacs/buffer-transient-state/body)
|
2015-03-30 03:31:39 +00:00
|
|
|
|
2016-01-30 11:32:53 +00:00
|
|
|
;; end of Buffer transient state
|
2015-03-26 05:15:16 +00:00
|
|
|
|
2016-01-30 11:32:53 +00:00
|
|
|
;; Window Manipulation Transient State
|
2015-02-12 05:00:23 +00:00
|
|
|
|
|
|
|
(defun spacemacs/shrink-window-horizontally (delta)
|
|
|
|
"Wrap `spacemacs/shrink-window-horizontally'."
|
|
|
|
(interactive "p")
|
|
|
|
(shrink-window delta t))
|
|
|
|
|
|
|
|
(defun spacemacs/shrink-window (delta)
|
|
|
|
"Wrap `spacemacs/shrink-window'."
|
|
|
|
(interactive "p")
|
|
|
|
(shrink-window delta))
|
|
|
|
|
|
|
|
(defun spacemacs/enlarge-window (delta)
|
|
|
|
"Wrap `spacemacs/enlarge-window'."
|
|
|
|
(interactive "p")
|
|
|
|
(enlarge-window delta))
|
|
|
|
|
|
|
|
(defun spacemacs/enlarge-window-horizontally (delta)
|
|
|
|
"Wrap `spacemacs/enlarge-window-horizontally'."
|
|
|
|
(interactive "p")
|
|
|
|
(enlarge-window delta t))
|
|
|
|
|
2016-01-20 02:55:38 +00:00
|
|
|
(spacemacs|define-transient-state window-manipulation
|
|
|
|
:title "Window Manipulation Transient State"
|
2016-10-02 07:56:20 +00:00
|
|
|
:doc (concat "
|
2016-03-24 04:49:46 +00:00
|
|
|
Select^^^^ Move^^^^ Split^^ Resize^^ Other^^
|
|
|
|
──────^^^^───────────── ────^^^^───────────── ─────^^─────────────── ──────^^──────────────────── ─────^^──────────────────────────────
|
|
|
|
[_j_/_k_] down/up [_J_/_K_] down/up [_s_] vertical [_[_] shrink horizontally [_q_] quit
|
|
|
|
[_h_/_l_] left/right [_H_/_L_] left/right [_S_] vert & follow [_]_] enlarge horizontally [_u_] restore prev layout
|
2016-08-21 15:11:36 +00:00
|
|
|
[_0_-_9_] window N [_r_]^^ rotate fwd [_v_] horizontal [_{_] shrink vertically [_U_] restore next layout
|
|
|
|
[_w_]^^ other window [_R_]^^ rotate bwd [_V_] horiz & follow [_}_] enlarge vertically [_d_] close current
|
2016-10-02 07:56:20 +00:00
|
|
|
[_o_]^^ other frame ^^^^ ^^ ^^ [_D_] close other"
|
|
|
|
(if (configuration-layer/package-usedp 'golden-ratio)
|
|
|
|
"\n ^^^^ ^^^^ ^^ ^^ [_g_] golden-ratio %`golden-ratio-mode"
|
|
|
|
""))
|
2015-02-12 05:00:23 +00:00
|
|
|
:bindings
|
2016-01-14 02:43:45 +00:00
|
|
|
("q" nil :exit t)
|
|
|
|
("0" select-window-0)
|
|
|
|
("1" select-window-1)
|
|
|
|
("2" select-window-2)
|
|
|
|
("3" select-window-3)
|
|
|
|
("4" select-window-4)
|
|
|
|
("5" select-window-5)
|
|
|
|
("6" select-window-6)
|
|
|
|
("7" select-window-7)
|
|
|
|
("8" select-window-8)
|
|
|
|
("9" select-window-9)
|
|
|
|
("-" split-window-below-and-focus)
|
|
|
|
("/" split-window-right-and-focus)
|
|
|
|
("[" spacemacs/shrink-window-horizontally)
|
|
|
|
("]" spacemacs/enlarge-window-horizontally)
|
|
|
|
("{" spacemacs/shrink-window)
|
|
|
|
("}" spacemacs/enlarge-window)
|
2016-02-12 08:08:48 +00:00
|
|
|
("d" delete-window)
|
|
|
|
("D" delete-other-windows)
|
2016-01-14 02:43:45 +00:00
|
|
|
("h" evil-window-left)
|
|
|
|
("<left>" evil-window-left)
|
|
|
|
("j" evil-window-down)
|
|
|
|
("<down>" evil-window-down)
|
|
|
|
("k" evil-window-up)
|
|
|
|
("<up>" evil-window-up)
|
|
|
|
("l" evil-window-right)
|
|
|
|
("<right>" evil-window-right)
|
|
|
|
("H" evil-window-move-far-left)
|
|
|
|
("<S-left>" evil-window-move-far-left)
|
|
|
|
("J" evil-window-move-very-bottom)
|
|
|
|
("<S-down>" evil-window-move-very-bottom)
|
|
|
|
("K" evil-window-move-very-top)
|
|
|
|
("<S-up>" evil-window-move-very-top)
|
|
|
|
("L" evil-window-move-far-right)
|
|
|
|
("<S-right>" evil-window-move-far-right)
|
|
|
|
("o" other-frame)
|
2016-08-23 15:58:23 +00:00
|
|
|
("r" spacemacs/rotate-windows-forward)
|
2016-08-21 15:11:36 +00:00
|
|
|
("R" spacemacs/rotate-windows-backward)
|
2016-01-14 02:43:45 +00:00
|
|
|
("s" split-window-below)
|
|
|
|
("S" split-window-below-and-focus)
|
|
|
|
("u" winner-undo)
|
|
|
|
("U" winner-redo)
|
|
|
|
("v" split-window-right)
|
|
|
|
("V" split-window-right-and-focus)
|
|
|
|
("w" other-window))
|
|
|
|
(spacemacs/set-leader-keys "w."
|
2016-01-20 02:55:38 +00:00
|
|
|
'spacemacs/window-manipulation-transient-state/body)
|
2015-02-12 05:00:23 +00:00
|
|
|
|
2016-01-30 11:32:53 +00:00
|
|
|
;; end of Window Manipulation Transient State
|
2015-03-30 02:15:17 +00:00
|
|
|
|
2016-01-30 11:32:53 +00:00
|
|
|
;; text Manipulation Transient State
|
2015-03-30 02:15:17 +00:00
|
|
|
|
|
|
|
(defun spacemacs/scale-up-or-down-font-size (direction)
|
|
|
|
"Scale the font. If DIRECTION is positive or zero the font is scaled up,
|
|
|
|
otherwise it is scaled down."
|
|
|
|
(interactive)
|
|
|
|
(let ((scale 0.5))
|
|
|
|
(if (eq direction 0)
|
|
|
|
(text-scale-set 0)
|
|
|
|
(if (< direction 0)
|
|
|
|
(text-scale-decrease scale)
|
|
|
|
(text-scale-increase scale)))))
|
|
|
|
|
|
|
|
(defun spacemacs/scale-up-font ()
|
|
|
|
"Scale up the font."
|
|
|
|
(interactive)
|
|
|
|
(spacemacs/scale-up-or-down-font-size 1))
|
|
|
|
|
|
|
|
(defun spacemacs/scale-down-font ()
|
|
|
|
"Scale up the font."
|
|
|
|
(interactive)
|
|
|
|
(spacemacs/scale-up-or-down-font-size -1))
|
|
|
|
|
|
|
|
(defun spacemacs/reset-font-size ()
|
|
|
|
"Reset the font size."
|
|
|
|
(interactive)
|
|
|
|
(spacemacs/scale-up-or-down-font-size 0))
|
|
|
|
|
2016-01-20 02:55:38 +00:00
|
|
|
(spacemacs|define-transient-state scale-font
|
|
|
|
:title "Font Scaling Transient State"
|
2016-01-14 02:43:45 +00:00
|
|
|
:doc "\n[_+_/_=_] scale up [_-_] scale down [_0_] reset font [_q_] quit"
|
2015-03-30 02:15:17 +00:00
|
|
|
:bindings
|
|
|
|
("+" spacemacs/scale-up-font)
|
2015-11-16 14:08:24 +00:00
|
|
|
("=" spacemacs/scale-up-font)
|
2015-03-30 02:15:17 +00:00
|
|
|
("-" spacemacs/scale-down-font)
|
2015-11-16 14:08:24 +00:00
|
|
|
("0" spacemacs/reset-font-size)
|
2015-05-18 05:38:14 +00:00
|
|
|
("q" nil :exit t))
|
2016-01-20 02:55:38 +00:00
|
|
|
(spacemacs/set-leader-keys "zx" 'spacemacs/scale-font-transient-state/body)
|
2015-03-30 02:15:17 +00:00
|
|
|
|
2016-01-30 11:32:53 +00:00
|
|
|
;; end of Text Manipulation Transient State
|
2015-06-24 06:57:20 +00:00
|
|
|
|
2016-01-30 11:32:53 +00:00
|
|
|
;; Transparency transient-state
|
2015-06-24 06:57:20 +00:00
|
|
|
|
2016-10-04 23:54:36 +00:00
|
|
|
(defun spacemacs/toggle-transparency (&optional frame)
|
|
|
|
"Toggle between transparent and opaque state for FRAME.
|
|
|
|
If FRAME is nil, it defaults to the selected frame."
|
2015-06-24 06:57:20 +00:00
|
|
|
(interactive)
|
2016-10-04 23:54:36 +00:00
|
|
|
(let* ((alpha (frame-parameter frame 'alpha))
|
2016-01-05 16:26:47 +00:00
|
|
|
(dotfile-setting (cons dotspacemacs-active-transparency
|
|
|
|
dotspacemacs-inactive-transparency)))
|
2015-12-23 17:43:06 +00:00
|
|
|
(set-frame-parameter
|
|
|
|
frame 'alpha
|
2016-01-05 16:26:47 +00:00
|
|
|
(if (not (equal alpha dotfile-setting))
|
|
|
|
dotfile-setting
|
2016-01-14 02:43:45 +00:00
|
|
|
'(100 . 100)))))
|
2015-06-24 06:57:20 +00:00
|
|
|
|
2016-10-04 23:54:36 +00:00
|
|
|
(defun spacemacs/increase-transparency (&optional frame)
|
|
|
|
"Increase transparency for FRAME.
|
|
|
|
If FRAME is nil, it defaults to the selected frame."
|
2015-06-24 06:57:20 +00:00
|
|
|
(interactive)
|
2016-10-04 23:54:36 +00:00
|
|
|
(let* ((current-alpha (car (frame-parameter frame 'alpha)))
|
2015-06-24 06:57:20 +00:00
|
|
|
(increased-alpha (- current-alpha 5)))
|
|
|
|
(when (>= increased-alpha frame-alpha-lower-limit)
|
2016-10-04 23:54:36 +00:00
|
|
|
(set-frame-parameter frame 'alpha
|
2015-12-23 17:43:06 +00:00
|
|
|
(cons increased-alpha increased-alpha)))))
|
2015-06-24 06:57:20 +00:00
|
|
|
|
2016-10-04 23:54:36 +00:00
|
|
|
(defun spacemacs/decrease-transparency (&optional frame)
|
|
|
|
"Decrease transparency for FRAME.
|
|
|
|
If FRAME is nil, it defaults to the selected frame."
|
2015-06-24 06:57:20 +00:00
|
|
|
(interactive)
|
2016-10-04 23:54:36 +00:00
|
|
|
(let* ((current-alpha (car (frame-parameter frame 'alpha)))
|
2015-06-24 06:57:20 +00:00
|
|
|
(decreased-alpha (+ current-alpha 5)))
|
|
|
|
(when (<= decreased-alpha 100)
|
2016-10-04 23:54:36 +00:00
|
|
|
(set-frame-parameter frame 'alpha
|
2015-12-23 17:43:06 +00:00
|
|
|
(cons decreased-alpha decreased-alpha)))))
|
2015-06-24 06:57:20 +00:00
|
|
|
|
2016-01-20 02:55:38 +00:00
|
|
|
(spacemacs|define-transient-state scale-transparency
|
|
|
|
:title "Frame Transparency Transient State"
|
2016-04-08 15:43:18 +00:00
|
|
|
:doc "\n[_+_/_=_] increase transparency [_-_] decrease [_T_] toggle [_q_] quit"
|
2015-06-24 06:57:20 +00:00
|
|
|
:bindings
|
2016-04-21 11:21:28 +00:00
|
|
|
("+" spacemacs/increase-transparency)
|
|
|
|
("=" spacemacs/increase-transparency)
|
|
|
|
("-" spacemacs/decrease-transparency)
|
|
|
|
("T" spacemacs/toggle-transparency)
|
|
|
|
("q" nil :exit t))
|
2016-01-14 02:43:45 +00:00
|
|
|
(spacemacs/set-leader-keys "TT"
|
2016-01-20 02:55:38 +00:00
|
|
|
'spacemacs/scale-transparency-transient-state/spacemacs/toggle-transparency)
|
2015-06-24 06:57:20 +00:00
|
|
|
|
2016-01-30 11:32:53 +00:00
|
|
|
;; end of Transparency Transient State
|