Add missing spacemacs/ prefix to functions.
Only touches the spacemacs layer.
This commit is contained in:
parent
138d141cf4
commit
d32e5e40ae
|
@ -23,7 +23,7 @@
|
|||
erc-yt
|
||||
))
|
||||
|
||||
(when (system-is-mac)
|
||||
(when (spacemacs/system-is-mac)
|
||||
(push 'erc-terminal-notifier erc-packages))
|
||||
|
||||
(when (configuration-layer/layer-usedp 'auto-completion)
|
||||
|
@ -53,9 +53,9 @@
|
|||
(defun no-linum (&rest ignore)
|
||||
(when (or 'linum-mode global-linum-mode)
|
||||
(linum-mode 0)))
|
||||
(add-to-hooks 'no-linum '(erc-hook
|
||||
erc-mode-hook
|
||||
erc-insert-pre-hook))
|
||||
(spacemacs/add-to-hooks 'no-linum '(erc-hook
|
||||
erc-mode-hook
|
||||
erc-insert-pre-hook))
|
||||
:config
|
||||
(progn
|
||||
(use-package erc-autoaway
|
||||
|
|
|
@ -24,9 +24,9 @@
|
|||
:defer t
|
||||
:init
|
||||
(progn
|
||||
(add-to-hook 'rcirc-mode-hook '(flyspell-mode
|
||||
rcirc-omit-mode
|
||||
rcirc-track-minor-mode))
|
||||
(spacemacs/add-to-hook 'rcirc-mode-hook '(flyspell-mode
|
||||
rcirc-omit-mode
|
||||
rcirc-track-minor-mode))
|
||||
|
||||
(defun spacemacs//rcirc-with-authinfo (arg)
|
||||
"Fire rcirc with support for authinfo."
|
||||
|
|
|
@ -126,7 +126,7 @@
|
|||
:init (push 'company-c-headers company-backends-c-mode-common))))
|
||||
|
||||
(defun c-c++/post-init-flycheck ()
|
||||
(add-to-hooks 'flycheck-mode '(c-mode-hook c++-mode-hook)))
|
||||
(spacemacs/add-to-hooks 'flycheck-mode '(c-mode-hook c++-mode-hook)))
|
||||
|
||||
(defun c-c++/init-gdb-mi ()
|
||||
(use-package gdb-mi
|
||||
|
@ -149,10 +149,10 @@
|
|||
(defun c-c++/post-init-srefactor ()
|
||||
(evil-leader/set-key-for-mode 'c-mode "mr" 'srefactor-refactor-at-point)
|
||||
(evil-leader/set-key-for-mode 'c++-mode "mr" 'srefactor-refactor-at-point)
|
||||
(add-to-hooks 'spacemacs/lazy-load-srefactor '(c-mode-hook c++-mode-hook)))
|
||||
(spacemacs/add-to-hooks 'spacemacs/lazy-load-srefactor '(c-mode-hook c++-mode-hook)))
|
||||
|
||||
(defun c-c++/post-init-stickyfunc-enhance ()
|
||||
(add-to-hooks 'spacemacs/lazy-load-stickyfunc-enhance '(c-mode-hook c++-mode-hook)))
|
||||
(spacemacs/add-to-hooks 'spacemacs/lazy-load-stickyfunc-enhance '(c-mode-hook c++-mode-hook)))
|
||||
|
||||
(defun c-c++/post-init-ycmd ()
|
||||
(add-hook 'c++-mode-hook 'ycmd-mode)
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
(smartparens-strict-mode -1)
|
||||
(turn-off-smartparens-mode))
|
||||
(add-hook 'slime-repl-mode-hook #'slime/disable-smartparens)
|
||||
(add-to-hooks 'slime-mode '(lisp-mode-hook)))
|
||||
(spacemacs/add-to-hooks 'slime-mode '(lisp-mode-hook)))
|
||||
:config
|
||||
(progn
|
||||
(slime-setup)
|
||||
|
|
|
@ -73,12 +73,12 @@
|
|||
("q" macrostep-collapse-all :exit t)))))
|
||||
|
||||
(defun emacs-lisp/post-init-evil ()
|
||||
(add-to-hook 'emacs-lisp-mode
|
||||
'(lambda ()
|
||||
(spacemacs|define-text-object ";"
|
||||
"elisp-comment"
|
||||
";; "
|
||||
""))))
|
||||
(spacemacs/add-to-hook 'emacs-lisp-mode
|
||||
'(lambda ()
|
||||
(spacemacs|define-text-object ";"
|
||||
"elisp-comment"
|
||||
";; "
|
||||
""))))
|
||||
|
||||
(defun emacs-lisp/post-init-flycheck ()
|
||||
;; Make flycheck recognize packages in loadpath
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
(defun load-gopath-file(gopath name)
|
||||
"Search for NAME file in all paths referenced in GOPATH."
|
||||
(let* ((sep (if (system-is-mswindows) ";" ":"))
|
||||
(let* ((sep (if (spacemacs/system-is-mswindows) ";" ":"))
|
||||
(paths (split-string gopath sep))
|
||||
found)
|
||||
(loop for p in paths
|
||||
|
|
|
@ -51,9 +51,9 @@
|
|||
(defun html/init-emmet-mode ()
|
||||
(use-package emmet-mode
|
||||
:defer t
|
||||
:init (add-to-hooks 'emmet-mode '(css-mode-hook
|
||||
html-mode-hook
|
||||
web-mode-hook))
|
||||
:init (spacemacs/add-to-hooks 'emmet-mode '(css-mode-hook
|
||||
html-mode-hook
|
||||
web-mode-hook))
|
||||
:config
|
||||
(progn
|
||||
(evil-define-key 'insert emmet-mode-keymap (kbd "TAB") 'emmet-expand-yas)
|
||||
|
@ -66,13 +66,13 @@
|
|||
(add-hook 'web-mode-hook 'evil-matchit-mode))
|
||||
|
||||
(defun html/post-init-flycheck ()
|
||||
(add-to-hooks 'flycheck-mode '(haml-mode-hook
|
||||
jade-mode-hook
|
||||
less-mode-hook
|
||||
sass-mode-hook
|
||||
scss-mode-hook
|
||||
slim-mode-hook
|
||||
web-mode-hook)))
|
||||
(spacemacs/add-to-hooks 'flycheck-mode '(haml-mode-hook
|
||||
jade-mode-hook
|
||||
less-mode-hook
|
||||
sass-mode-hook
|
||||
scss-mode-hook
|
||||
slim-mode-hook
|
||||
web-mode-hook)))
|
||||
|
||||
(defun html/init-haml-mode ()
|
||||
(use-package haml-mode
|
||||
|
@ -118,11 +118,11 @@
|
|||
(spacemacs|diminish tagedit-mode " Ⓣ" " T"))))
|
||||
|
||||
(defun html/post-init-rainbow-delimiters ()
|
||||
(add-to-hooks 'rainbow-delimiters-mode '(haml-mode-hook
|
||||
jade-mode-hook
|
||||
less-css-mode-hook
|
||||
scss-mode-hook
|
||||
slim-mode-hook)))
|
||||
(spacemacs/add-to-hooks 'rainbow-delimiters-mode '(haml-mode-hook
|
||||
jade-mode-hook
|
||||
less-css-mode-hook
|
||||
scss-mode-hook
|
||||
slim-mode-hook)))
|
||||
|
||||
(defun html/init-web-mode ()
|
||||
(use-package web-mode
|
||||
|
@ -220,6 +220,6 @@
|
|||
("\\.djhtml\\'" . web-mode))))
|
||||
|
||||
(defun html/post-init-yasnippet ()
|
||||
(add-to-hooks 'spacemacs/load-yasnippet '(css-mode-hook
|
||||
jade-mode
|
||||
slim-mode)))
|
||||
(spacemacs/add-to-hooks 'spacemacs/load-yasnippet '(css-mode-hook
|
||||
jade-mode
|
||||
slim-mode)))
|
||||
|
|
|
@ -139,9 +139,9 @@
|
|||
(setq indent-tabs-mode t))
|
||||
|
||||
(add-hook 'inferior-python-mode-hook #'inferior-python-setup-hook)
|
||||
(add-all-to-hook 'python-mode-hook
|
||||
'python-default
|
||||
'python-setup-shell))
|
||||
(spacemacs/add-all-to-hook 'python-mode-hook
|
||||
'python-default
|
||||
'python-setup-shell))
|
||||
:config
|
||||
(progn
|
||||
(add-hook 'inferior-python-mode-hook 'smartparens-mode)
|
||||
|
@ -231,10 +231,10 @@
|
|||
;; this key binding is for recentering buffer in Emacs
|
||||
;; it would be troublesome if Emacs user
|
||||
;; Vim users can use this key since they have other key
|
||||
(define-key inferior-python-mode-map (kbd "C-l") 'comint-clear-buffer))
|
||||
(define-key inferior-python-mode-map (kbd "C-l") 'spacemacs/comint-clear-buffer))
|
||||
|
||||
;; add this optional key binding for Emacs user, since it is unbound
|
||||
(define-key inferior-python-mode-map (kbd "C-c M-l") 'comint-clear-buffer)
|
||||
(define-key inferior-python-mode-map (kbd "C-c M-l") 'spacemacs/comint-clear-buffer)
|
||||
|
||||
;; fix for issue #2569 (https://github.com/syl20bnr/spacemacs/issues/2569)
|
||||
;; use `semantic-create-imenu-index' only when `semantic-mode' is enabled,
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
(setq dash-packages '(helm-dash))
|
||||
|
||||
(cond
|
||||
((system-is-mac) (push 'dash-at-point dash-packages))
|
||||
((system-is-linux) (push 'zeal-at-point dash-packages)))
|
||||
((spacemacs/system-is-mac) (push 'dash-at-point dash-packages))
|
||||
((spacemacs/system-is-linux) (push 'zeal-at-point dash-packages)))
|
||||
|
||||
(defun dash/init-helm-dash ()
|
||||
(use-package helm-dash
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
(use-package vim-empty-lines-mode
|
||||
:diminish vim-empty-lines-mode
|
||||
:init
|
||||
(add-to-hooks (lambda () (vim-empty-lines-mode -1)) '(comint-mode-hook
|
||||
eshell-mode-hook
|
||||
eww-mode-hook
|
||||
shell-mode-hook
|
||||
term-mode-hook))
|
||||
(spacemacs/add-to-hooks (lambda () (vim-empty-lines-mode -1)) '(comint-mode-hook
|
||||
eshell-mode-hook
|
||||
eww-mode-hook
|
||||
shell-mode-hook
|
||||
term-mode-hook))
|
||||
:config
|
||||
(progn
|
||||
(global-vim-empty-lines-mode)
|
||||
|
|
|
@ -214,8 +214,8 @@
|
|||
(let ((private-yas-dir (if auto-completion-private-snippets-directory
|
||||
auto-completion-private-snippets-directory
|
||||
(concat
|
||||
configuration-layer-private-directory
|
||||
"snippets/")))
|
||||
configuration-layer-private-directory
|
||||
"snippets/")))
|
||||
(spacemacs-snippets-dir (expand-file-name
|
||||
"snippets"
|
||||
spacemacs--auto-completion-dir)))
|
||||
|
@ -229,9 +229,9 @@
|
|||
(setq yas-wrap-around-region t))))
|
||||
(yas-minor-mode 1))
|
||||
|
||||
(add-to-hooks 'spacemacs/load-yasnippet '(prog-mode-hook
|
||||
markdown-mode-hook
|
||||
org-mode-hook))
|
||||
(spacemacs/add-to-hooks 'spacemacs/load-yasnippet '(prog-mode-hook
|
||||
markdown-mode-hook
|
||||
org-mode-hook))
|
||||
(spacemacs|add-toggle yasnippet
|
||||
:status yas-minor-mode
|
||||
:on (yas-minor-mode)
|
||||
|
@ -243,9 +243,9 @@
|
|||
(yas-minor-mode -1)
|
||||
(setq yas-dont-activate t))
|
||||
|
||||
(add-to-hooks 'spacemacs/force-yasnippet-off '(term-mode-hook
|
||||
shell-mode-hook
|
||||
eshell-mode-hook)))
|
||||
(spacemacs/add-to-hooks 'spacemacs/force-yasnippet-off '(term-mode-hook
|
||||
shell-mode-hook
|
||||
eshell-mode-hook)))
|
||||
:config
|
||||
(progn
|
||||
;; We need to know whether the smartparens was enabled, see
|
||||
|
|
|
@ -29,5 +29,5 @@
|
|||
;; If the Hiragino Sans GB font is not found in your system, you could call this
|
||||
;; method in dotspacemacs/config function with a different Chinese font name.
|
||||
;; If you are using mac, you could put the following code in your dotspacemacs/config function.
|
||||
;; (when (system-is-mac)
|
||||
;; (when (spacemacs/system-is-mac)
|
||||
;; (spacemacs//set-monospaced-font "Source Code Pro" "Hiragino Sans GB" 14 16))
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
"Display a short documentation in the mini buffer."
|
||||
(let ((var (intern (format
|
||||
"rainbow-identifiers-cie-l*a*b*-%s" component))))
|
||||
(echo "Change color %s mini-mode (value: %s)
|
||||
(spacemacs/echo "Change color %s mini-mode (value: %s)
|
||||
+ to increase %s
|
||||
- to decrease %s
|
||||
= to reset
|
||||
|
|
|
@ -166,7 +166,7 @@ Will work on both org-mode and any mode that accepts plain html."
|
|||
:defer t
|
||||
:init
|
||||
(progn
|
||||
(when (system-is-mac)
|
||||
(when (spacemacs/system-is-mac)
|
||||
(setq org-pomodoro-audio-player "/usr/bin/afplay"))
|
||||
(evil-leader/set-key-for-mode 'org-mode
|
||||
"mp" 'org-pomodoro))))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
(when (system-is-mac)
|
||||
(when (spacemacs/system-is-mac)
|
||||
(evil-leader/set-key "bf" 'reveal-in-osx-finder)
|
||||
|
||||
;; this is only applicable to GUI mode
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
reveal-in-osx-finder
|
||||
))
|
||||
|
||||
(when (system-is-mac)
|
||||
(when (spacemacs/system-is-mac)
|
||||
;; Note: `delete-by-moving-to-trash' is set to true globaly in
|
||||
;; `spacemacs/config.el'
|
||||
;; (setq trash-directory "~/.Trash/emacs") ; bare minimum
|
||||
|
@ -17,7 +17,7 @@
|
|||
(if (executable-find "trash")
|
||||
(defun system-move-file-to-trash (file)
|
||||
"Use `trash' to move FILE to the system/volume trash can.
|
||||
Can be installed with `brew install trash'."
|
||||
Can be installed with `brew install trash'."
|
||||
(call-process (executable-find "trash") nil 0 nil file))
|
||||
(setq mac-system-move-file-to-trash-use-finder t))
|
||||
|
||||
|
@ -34,12 +34,12 @@ Can be installed with `brew install trash'."
|
|||
|
||||
(defun osx/init-pbcopy ()
|
||||
(use-package pbcopy
|
||||
:if (and (system-is-mac)(not (display-graphic-p)))
|
||||
:if (and (spacemacs/system-is-mac) (not (display-graphic-p)))
|
||||
:init (turn-on-pbcopy)))
|
||||
|
||||
(defun osx/init-launchctl ()
|
||||
(use-package launchctl
|
||||
:if (system-is-mac)
|
||||
:if (spacemacs/system-is-mac)
|
||||
:defer t
|
||||
:init
|
||||
(progn
|
||||
|
@ -71,5 +71,5 @@ Can be installed with `brew install trash'."
|
|||
|
||||
(defun osx/init-reveal-in-osx-finder ()
|
||||
(use-package reveal-in-osx-finder
|
||||
:if (system-is-mac)
|
||||
:if (spacemacs/system-is-mac)
|
||||
:commands reveal-in-osx-finder))
|
||||
|
|
|
@ -364,6 +364,6 @@ These should have their own segments in the modeline.")
|
|||
;; ;; ;; If the *scratch* buffer is the current one, then create a new
|
||||
;; ;; ;; empty untitled buffer to hide *scratch*
|
||||
;; ;; (if (string= (buffer-name) "*scratch*")
|
||||
;; ;; (new-empty-buffer))
|
||||
;; ;; (spacemacs/new-empty-buffer))
|
||||
;; )
|
||||
;; t) ;; append this hook to the tail
|
||||
|
|
|
@ -11,53 +11,56 @@
|
|||
;;; License: GPLv3
|
||||
|
||||
;; add emacs binary helper functions
|
||||
(defun emacsbin-path()
|
||||
(defun spacemacs/emacsbin-path ()
|
||||
(interactive)
|
||||
(concat exec-directory (if (system-is-mswindows) "bin/") "emacs"))
|
||||
(concat exec-directory (if (spacemacs/system-is-mswindows) "bin/") "emacs"))
|
||||
|
||||
(defun emacs()
|
||||
(defun spacemacs/emacs-start ()
|
||||
(interactive)
|
||||
(call-process (emacsbin-path) nil 0 nil)
|
||||
(call-process (spacemacs/emacsbin-path) nil 0 nil)
|
||||
(message "Started 'emacs' - it will be ready soon ..."))
|
||||
|
||||
(defun emacs-debug-init()
|
||||
(defun spacemacs/emacs-debug-init ()
|
||||
(interactive)
|
||||
(call-process (emacsbin-path) nil 0 nil "--debug-init")
|
||||
(call-process (spacemacs/emacsbin-path) nil 0 nil "--debug-init")
|
||||
(message "Started 'emacs --debug-init' - it will be ready soon ..."))
|
||||
|
||||
(defun emacs-reload()
|
||||
(defun spacemacs/emacs-reload ()
|
||||
(interactive)
|
||||
(load-file user-init-file)
|
||||
(message ".emacs reloaded successfully"))
|
||||
|
||||
(defun emacs-Q() (interactive)
|
||||
(call-process (emacsbin-path) nil 0 nil "-Q")
|
||||
(defun spacemacs/emacs-Q ()
|
||||
(interactive)
|
||||
(call-process (spacemacs/emacsbin-path) nil 0 nil "-Q")
|
||||
(message "Started 'emacs -Q' - it will be ready soon ..."))
|
||||
|
||||
;; from https://github.com/cofi/dotfiles/blob/master/emacs.d/config/cofi-util.el#L38
|
||||
(defun add-to-hooks (fun hooks)
|
||||
(defun spacemacs/add-to-hooks (fun hooks)
|
||||
"Add function to hooks"
|
||||
(dolist (hook hooks)
|
||||
(add-hook hook fun)))
|
||||
(defun add-all-to-hook (hook &rest funs)
|
||||
|
||||
(defun spacemacs/add-all-to-hook (hook &rest funs)
|
||||
"Add functions to hook."
|
||||
(add-to-hook hook funs))
|
||||
(defun add-to-hook (hook funs)
|
||||
(spacemacs/add-to-hook hook funs))
|
||||
|
||||
(defun spacemacs/add-to-hook (hook funs)
|
||||
"Add list of functions to hook."
|
||||
(dolist (fun funs)
|
||||
(add-hook hook fun)))
|
||||
|
||||
(defun echo (msg &rest args)
|
||||
(defun spacemacs/echo (msg &rest args)
|
||||
"Display MSG in echo-area without logging it in *Messages* buffer."
|
||||
(interactive)
|
||||
(let ((message-log-max nil))
|
||||
(apply 'message msg args)))
|
||||
|
||||
(defun system-is-mac ()
|
||||
(defun spacemacs/system-is-mac ()
|
||||
(string-equal system-type "darwin"))
|
||||
(defun system-is-linux ()
|
||||
(defun spacemacs/system-is-linux ()
|
||||
(string-equal system-type "gnu/linux"))
|
||||
(defun system-is-mswindows ()
|
||||
(defun spacemacs/system-is-mswindows ()
|
||||
(string-equal system-type "windows-nt"))
|
||||
|
||||
(defvar spacemacs/prefix-command-string "group:"
|
||||
|
@ -88,9 +91,9 @@ LONG-NAME if given is stored in `spacemacs/prefix-command-alist'."
|
|||
(push (cons full-prefix-emacs long-name) spacemacs/prefix-titles))))
|
||||
|
||||
(defun spacemacs/declare-prefix-for-mode (mode prefix name)
|
||||
;; "Declare a prefix PREFIX. MODE is the mode in which this prefix command should
|
||||
;; be added. PREFIX is a string describing a key sequence. NAME is a symbol name
|
||||
;; used as the prefix command."
|
||||
"Declare a prefix PREFIX. MODE is the mode in which this prefix command should
|
||||
be added. PREFIX is a string describing a key sequence. NAME is a symbol name
|
||||
used as the prefix command."
|
||||
(let ((command (intern (concat spacemacs/prefix-command-string name))))
|
||||
(define-prefix-command command)
|
||||
(evil-leader/set-key-for-mode mode prefix command)))
|
||||
|
@ -133,7 +136,7 @@ auto-indent."
|
|||
(evil-end-of-line))
|
||||
|
||||
;; insert one or several line below without changing current evil state
|
||||
(defun evil-insert-line-below (count)
|
||||
(defun spacemacs/evil-insert-line-below (count)
|
||||
"Insert one of several lines below the current point's line without changing
|
||||
the current state and point position."
|
||||
(interactive "p")
|
||||
|
@ -141,14 +144,14 @@ the current state and point position."
|
|||
(evil-save-state (evil-open-below count))))
|
||||
|
||||
;; insert one or several line above without changing current evil state
|
||||
(defun evil-insert-line-above (count)
|
||||
(defun spacemacs/evil-insert-line-above (count)
|
||||
"Insert one of several lines above the current point's line without changing
|
||||
the current state and point position."
|
||||
(interactive "p")
|
||||
(save-excursion
|
||||
(evil-save-state (evil-open-above count))))
|
||||
|
||||
(defun evil-goto-next-line-and-indent (&optional count)
|
||||
(defun spacemacs/evil-goto-next-line-and-indent (&optional count)
|
||||
(interactive "p")
|
||||
(let ((counter (or count 1)))
|
||||
(while (> counter 0)
|
||||
|
@ -191,7 +194,7 @@ the current state and point position."
|
|||
(whitespace-cleanup))))
|
||||
|
||||
;; linum gutter helpers
|
||||
(defvar *linum-mdown-line* nil
|
||||
(defvar spacemacs-linum-mdown-line nil
|
||||
"Define persistent variable for linum selection")
|
||||
|
||||
(defun spacemacs/line-at-click ()
|
||||
|
@ -206,25 +209,24 @@ the current state and point position."
|
|||
)))
|
||||
|
||||
(defun spacemacs/md-select-linum (event)
|
||||
"Set point as *linum-mdown-line*"
|
||||
"Set point as spacemacs-linum-mdown-line"
|
||||
(interactive "e")
|
||||
(mouse-select-window event)
|
||||
(goto-line (spacemacs/line-at-click))
|
||||
(set-mark (point))
|
||||
(setq *linum-mdown-line*
|
||||
(setq spacemacs-linum-mdown-line
|
||||
(line-number-at-pos)))
|
||||
|
||||
(defun spacemacs/mu-select-linum ()
|
||||
"Select code block between point and *linum-mdown-line*"
|
||||
"Select code block between point and spacemacs-linum-mdown-line"
|
||||
(interactive)
|
||||
(when *linum-mdown-line*
|
||||
(when spacemacs-linum-mdown-line
|
||||
(let (mu-line)
|
||||
(setq mu-line (spacemacs/line-at-click))
|
||||
(goto-line (max *linum-mdown-line* mu-line))
|
||||
(goto-line (max spacemacs-linum-mdown-line mu-line))
|
||||
(set-mark (line-end-position))
|
||||
(goto-line (min *linum-mdown-line* mu-line))
|
||||
(setq *linum-mdown*
|
||||
nil))))
|
||||
(goto-line (min spacemacs-linum-mdown-line mu-line))
|
||||
(setq spacemacs-linum-mdown-line nil))))
|
||||
|
||||
(defun spacemacs/select-current-block ()
|
||||
"Select the current block of text between blank lines."
|
||||
|
@ -253,7 +255,7 @@ the current state and point position."
|
|||
(call-interactively 'eval-last-sexp)))
|
||||
|
||||
;; from magnars
|
||||
(defun eval-and-replace ()
|
||||
(defun spacemacs/eval-and-replace ()
|
||||
"Replace the preceding sexp with its value."
|
||||
(interactive)
|
||||
(backward-kill-sexp)
|
||||
|
@ -264,7 +266,7 @@ the current state and point position."
|
|||
(insert (current-kill 0)))))
|
||||
|
||||
;; from https://gist.github.com/3402786
|
||||
(defun toggle-maximize-buffer ()
|
||||
(defun spacemacs/toggle-maximize-buffer ()
|
||||
"Maximize buffer"
|
||||
(interactive)
|
||||
(if (and (= 1 (length (window-list)))
|
||||
|
@ -274,7 +276,7 @@ the current state and point position."
|
|||
(window-configuration-to-register '_)
|
||||
(delete-other-windows))))
|
||||
|
||||
(defun toggle-maximize-centered-buffer ()
|
||||
(defun spacemacs/toggle-maximize-centered-buffer ()
|
||||
"Maximize buffer and center it on the screen"
|
||||
(interactive)
|
||||
(if (= 1 (length (window-list)))
|
||||
|
@ -285,8 +287,8 @@ the current state and point position."
|
|||
(delete-other-windows)
|
||||
(bzg-big-fringe-mode 1))))
|
||||
|
||||
(defun toggle-triple-double-column-mode ()
|
||||
" Toggle between triple columns and double columns mode quickly. "
|
||||
(defun spacemacs/toggle-triple-double-column-mode ()
|
||||
"Toggle between triple columns and double columns mode quickly."
|
||||
(interactive)
|
||||
(if (= 3 (length (window-list)))
|
||||
(progn (delete-window (window-next-sibling))
|
||||
|
@ -300,23 +302,23 @@ the current state and point position."
|
|||
(progn (split-window-right)
|
||||
(balance-windows)))))))
|
||||
|
||||
(defun layout-triple-columns ()
|
||||
" Set the layout to triple columns. "
|
||||
(defun spacemacs/layout-triple-columns ()
|
||||
"Set the layout to triple columns."
|
||||
(interactive)
|
||||
(golden-ratio-mode 0)
|
||||
(delete-other-windows)
|
||||
(dotimes (i 2) (split-window-right))
|
||||
(balance-windows))
|
||||
|
||||
(defun layout-double-columns ()
|
||||
" Set the layout to double columns. "
|
||||
(defun spacemacs/layout-double-columns ()
|
||||
"Set the layout to double columns."
|
||||
(interactive)
|
||||
(golden-ratio-mode 1)
|
||||
(delete-other-windows)
|
||||
(split-window-right))
|
||||
|
||||
;; from magnars modified by ffevotte for dedicated windows support
|
||||
(defun rotate-windows (count)
|
||||
(defun spacemacs/rotate-windows (count)
|
||||
"Rotate your windows.
|
||||
Dedicated windows are left untouched. Giving a negative prefix
|
||||
argument takes the kindows rotate backwards."
|
||||
|
@ -345,10 +347,10 @@ argument takes the kindows rotate backwards."
|
|||
(set-window-start w2 s1)
|
||||
(setq i next-i)))))))
|
||||
|
||||
(defun rotate-windows-backward (count)
|
||||
(defun spacemacs/rotate-windows-backward (count)
|
||||
"Rotate your windows backward."
|
||||
(interactive "p")
|
||||
(rotate-windows (* -1 count)))
|
||||
(spacemacs/rotate-windows (* -1 count)))
|
||||
|
||||
(defun spacemacs/useless-buffer-p (buffer)
|
||||
"Determines if a buffer is useful."
|
||||
|
@ -385,7 +387,7 @@ argument takes the kindows rotate backwards."
|
|||
(previous-buffer))))
|
||||
|
||||
;; from magnars
|
||||
(defun rename-current-buffer-file ()
|
||||
(defun spacemacs/rename-current-buffer-file ()
|
||||
"Renames current buffer and file it is visiting."
|
||||
(interactive)
|
||||
(let ((name (buffer-name))
|
||||
|
@ -406,7 +408,7 @@ argument takes the kindows rotate backwards."
|
|||
(message "File '%s' successfully renamed to '%s'" name (file-name-nondirectory new-name))))))))
|
||||
|
||||
;; from magnars
|
||||
(defun delete-current-buffer-file ()
|
||||
(defun spacemacs/delete-current-buffer-file ()
|
||||
"Removes file connected to current buffer and kills buffer."
|
||||
(interactive)
|
||||
(let ((filename (buffer-file-name))
|
||||
|
@ -420,19 +422,19 @@ argument takes the kindows rotate backwards."
|
|||
(message "File '%s' successfully removed" filename)))))
|
||||
|
||||
;; from magnars
|
||||
(defun find-or-create-file-at-point ()
|
||||
(defun spacemacs/find-or-create-file-at-point ()
|
||||
"Guesses what parts of the buffer under point is a file name and opens it."
|
||||
(interactive)
|
||||
(find-file (file-name-at-point)))
|
||||
(find-spacemacs/file (file-name-at-point)))
|
||||
|
||||
;; from magnars
|
||||
(defun find-or-create-file-at-point-other-window ()
|
||||
(defun spacemacs/find-or-create-file-at-point-other-window ()
|
||||
"Guesses what parts of the buffer under point is a file name and opens it."
|
||||
(interactive)
|
||||
(find-file-other-window (file-name-at-point)))
|
||||
(find-spacemacs/file-other-window (file-name-at-point)))
|
||||
|
||||
;; from magnars
|
||||
(defun file-name-at-point ()
|
||||
(defun spacemacs/file-name-at-point ()
|
||||
(save-excursion
|
||||
(let* ((file-name-regexp "[./a-zA-Z0-9\-_~]")
|
||||
(start (progn
|
||||
|
@ -446,21 +448,21 @@ argument takes the kindows rotate backwards."
|
|||
(buffer-substring start end))))
|
||||
|
||||
;; from magnars
|
||||
(defun touch-buffer-file ()
|
||||
(defun spacemacs/touch-buffer-file ()
|
||||
(interactive)
|
||||
(insert " ")
|
||||
(backward-delete-char 1)
|
||||
(save-buffer))
|
||||
|
||||
;; from magnars
|
||||
(defun sudo-edit (&optional arg)
|
||||
(defun spacemacs/sudo-edit (&optional arg)
|
||||
(interactive "p")
|
||||
(if (or arg (not buffer-file-name))
|
||||
(find-file (concat "/sudo:root@localhost:" (ido-read-file-name "File: ")))
|
||||
(find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name))))
|
||||
|
||||
;; found at http://emacswiki.org/emacs/KillingBuffers
|
||||
(defun kill-other-buffers ()
|
||||
(defun spacemacs/kill-other-buffers ()
|
||||
"Kill all other buffers."
|
||||
(interactive)
|
||||
(let (name (buffer-name))
|
||||
|
@ -469,20 +471,20 @@ argument takes the kindows rotate backwards."
|
|||
(message "Buffers deleted!"))))
|
||||
|
||||
;; evenly split windows horizontally
|
||||
(defun evenly-split-window-right ()
|
||||
(defun spacemacs/evenly-split-window-right ()
|
||||
"Evenly split frame horizontally."
|
||||
(interactive)
|
||||
(split-window-right)
|
||||
(balance-windows))
|
||||
;; evenly split windows vertically
|
||||
(defun evenly-split-window-below ()
|
||||
(defun spacemacs/evenly-split-window-below ()
|
||||
"Evenly split frame vertically."
|
||||
(interactive)
|
||||
(split-window-below)
|
||||
(balance-windows))
|
||||
|
||||
;; from http://dfan.org/blog/2009/02/19/emacs-dedicated-windows/
|
||||
(defun toggle-current-window-dedication ()
|
||||
(defun spacemacs/toggle-current-window-dedication ()
|
||||
"Toggle dedication state of a window."
|
||||
(interactive)
|
||||
(let* ((window (selected-window))
|
||||
|
@ -493,7 +495,7 @@ argument takes the kindows rotate backwards."
|
|||
(buffer-name))))
|
||||
|
||||
;; http://camdez.com/blog/2013/11/14/emacs-show-buffer-file-name/
|
||||
(defun show-and-copy-buffer-filename ()
|
||||
(defun spacemacs/show-and-copy-buffer-filename ()
|
||||
"Show the full path to the current file in the minibuffer."
|
||||
(interactive)
|
||||
(let ((file-name (buffer-file-name)))
|
||||
|
@ -505,28 +507,28 @@ argument takes the kindows rotate backwards."
|
|||
|
||||
;; adapted from bozhidar
|
||||
;; http://emacsredux.com/blog/2013/05/18/instant-access-to-init-dot-el/
|
||||
(defun find-user-init-file ()
|
||||
(defun spacemacs/find-user-init-file ()
|
||||
"Edit the `user-init-file', in the current window."
|
||||
(interactive)
|
||||
(find-file-existing user-init-file))
|
||||
|
||||
(defun find-dotfile ()
|
||||
(defun spacemacs/find-dotfile ()
|
||||
"Edit the `dotfile', in the current window."
|
||||
(interactive)
|
||||
(find-file-existing (dotspacemacs/location)))
|
||||
|
||||
(defun ediff-dotfile-and-template ()
|
||||
(defun spacemacs/ediff-dotfile-and-template ()
|
||||
"ediff the current `dotfile' with the template"
|
||||
(interactive)
|
||||
(ediff-files (dotspacemacs/location)
|
||||
(concat dotspacemacs-template-directory ".spacemacs.template")))
|
||||
|
||||
(defun find-spacemacs-file ()
|
||||
(defun spacemacs/find-spacemacs-file ()
|
||||
(interactive)
|
||||
"Edit the `file' in the spacemacs base directory, in the current window."
|
||||
(ido-find-file-in-dir spacemacs-directory))
|
||||
|
||||
(defun find-contrib-file ()
|
||||
(defun spacemacs/find-contrib-file ()
|
||||
(interactive)
|
||||
"Edit the `file' in the spacemacs base directory, in the current window."
|
||||
(ido-find-file-in-dir configuration-layer-contrib-directory))
|
||||
|
@ -548,35 +550,35 @@ argument takes the kindows rotate backwards."
|
|||
(message "compilation ok.")))))
|
||||
|
||||
;; from https://gist.github.com/timcharper/493269
|
||||
(defun split-window-vertically-and-switch ()
|
||||
(defun spacemacs/split-window-vertically-and-switch ()
|
||||
(interactive)
|
||||
(split-window-vertically)
|
||||
(other-window 1))
|
||||
|
||||
(defun split-window-horizontally-and-switch ()
|
||||
(defun spacemacs/split-window-horizontally-and-switch ()
|
||||
(interactive)
|
||||
(split-window-horizontally)
|
||||
(other-window 1))
|
||||
|
||||
(defun ido-invoke-in-other-window ()
|
||||
(defun spacemacs/ido-invoke-in-other-window ()
|
||||
"signals ido mode to switch to (or create) another window after exiting"
|
||||
(interactive)
|
||||
(setq ido-exit-minibuffer-target-window 'other)
|
||||
(ido-exit-minibuffer))
|
||||
|
||||
(defun ido-invoke-in-horizontal-split ()
|
||||
(defun spacemacs/ido-invoke-in-horizontal-split ()
|
||||
"signals ido mode to split horizontally and switch after exiting"
|
||||
(interactive)
|
||||
(setq ido-exit-minibuffer-target-window 'horizontal)
|
||||
(ido-exit-minibuffer))
|
||||
|
||||
(defun ido-invoke-in-vertical-split ()
|
||||
(defun spacemacs/ido-invoke-in-vertical-split ()
|
||||
"signals ido mode to split vertically and switch after exiting"
|
||||
(interactive)
|
||||
(setq ido-exit-minibuffer-target-window 'vertical)
|
||||
(ido-exit-minibuffer))
|
||||
|
||||
(defun ido-invoke-in-new-frame ()
|
||||
(defun spacemacs/ido-invoke-in-new-frame ()
|
||||
"signals ido mode to create a new frame after exiting"
|
||||
(interactive)
|
||||
(setq ido-exit-minibuffer-target-window 'frame)
|
||||
|
@ -589,19 +591,19 @@ argument takes the kindows rotate backwards."
|
|||
(cond
|
||||
((equal ido-exit-minibuffer-target-window 'other)
|
||||
(if (= 1 (count-windows))
|
||||
(split-window-horizontally-and-switch)
|
||||
(spacemacs/split-window-horizontally-and-switch)
|
||||
(other-window 1)))
|
||||
((equal ido-exit-minibuffer-target-window 'horizontal)
|
||||
(split-window-horizontally-and-switch))
|
||||
(spacemacs/split-window-horizontally-and-switch))
|
||||
|
||||
((equal ido-exit-minibuffer-target-window 'vertical)
|
||||
(split-window-vertically-and-switch))
|
||||
(spacemacs/split-window-vertically-and-switch))
|
||||
((equal ido-exit-minibuffer-target-window 'frame)
|
||||
(make-frame)))
|
||||
(switch-to-buffer this-buffer) ;; why? Some ido commands, such as textmate.el's textmate-goto-symbol don't switch the current buffer
|
||||
result))
|
||||
|
||||
(defun set-google-translate-languages (source target)
|
||||
(defun spacemacs/set-google-translate-languages (source target)
|
||||
"Set source language for google translate.
|
||||
For instance pass En as source for english."
|
||||
(interactive "sEnter source language (ie. En): \nsEnter target language (ie. En): "
|
||||
|
@ -612,7 +614,7 @@ For instance pass En as source for english."
|
|||
(setq google-translate-default-target-language target))
|
||||
|
||||
;; from http://www.emacswiki.org/emacs/WordCount
|
||||
(defun count-words-analysis (start end)
|
||||
(defun spacemacs/count-words-analysis (start end)
|
||||
"Count how many times each word is used in the region.
|
||||
Punctuation is ignored."
|
||||
(interactive "r")
|
||||
|
@ -629,13 +631,13 @@ For instance pass En as source for english."
|
|||
(message "%S" words))
|
||||
words))
|
||||
|
||||
(defun set-attributes-from-alist (face attr)
|
||||
(defun spacemacs/set-attributes-from-alist (face attr)
|
||||
"Apply an alist of attributes in the form ((:PROP . VALUE)) to face."
|
||||
(while (car attr)
|
||||
(set-face-attribute face nil (caar attr) (cdar attr))
|
||||
(setq attr (cdr attr))))
|
||||
|
||||
(defun new-empty-buffer ()
|
||||
(defun spacemacs/new-empty-buffer ()
|
||||
"Create a new buffer called untitled(<n>)"
|
||||
(interactive)
|
||||
(let ((newbuf (generate-new-buffer-name "untitled")))
|
||||
|
@ -644,8 +646,7 @@ For instance pass En as source for english."
|
|||
(defun spacemacs/home ()
|
||||
"Go to home Spacemacs buffer"
|
||||
(interactive)
|
||||
(switch-to-buffer "*spacemacs*")
|
||||
)
|
||||
(switch-to-buffer "*spacemacs*"))
|
||||
|
||||
(defun spacemacs/insert-line-above-no-indent (count)
|
||||
(interactive "p")
|
||||
|
@ -671,7 +672,7 @@ For instance pass En as source for english."
|
|||
(setq count (1- count)))))
|
||||
|
||||
;; from https://github.com/gempesaw/dotemacs/blob/emacs/dg-defun.el
|
||||
(defun kill-matching-buffers-rudely (regexp &optional internal-too)
|
||||
(defun spacemacs/kill-matching-buffers-rudely (regexp &optional internal-too)
|
||||
"Kill buffers whose name matches the specified REGEXP. This
|
||||
function, unlike the built-in `kill-matching-buffers` does so
|
||||
WITHOUT ASKING. The optional second argument indicates whether to
|
||||
|
@ -689,7 +690,7 @@ kill internal buffers too."
|
|||
(defvar spacemacs-really-kill-emacs nil
|
||||
"prevent window manager close from closing instance.")
|
||||
|
||||
(defun spacemacs-persistent-server-running-p ()
|
||||
(defun spacemacs/persistent-server-running-p ()
|
||||
"Requires spacemacs-really-kill-emacs to be toggled and
|
||||
dotspacemacs-persistent-server to be t"
|
||||
(and (fboundp 'server-running-p)
|
||||
|
@ -699,7 +700,7 @@ dotspacemacs-persistent-server to be t"
|
|||
(defadvice kill-emacs (around spacemacs-really-exit activate)
|
||||
"Only kill emacs if a prefix is set"
|
||||
(if (and (not spacemacs-really-kill-emacs)
|
||||
(spacemacs-persistent-server-running-p))
|
||||
(spacemacs/persistent-server-running-p))
|
||||
(spacemacs/frame-killer)
|
||||
ad-do-it))
|
||||
|
||||
|
@ -750,22 +751,20 @@ dotspacemacs-persistent-server to be t"
|
|||
(* 100 (frame-char-width)))
|
||||
2))))
|
||||
|
||||
(defun fill-char-to-column (char column)
|
||||
(defun spacemacs/fill-char-to-column (char column)
|
||||
" Fill the line with CHAR up to the given COLUMN"
|
||||
(interactive "cFill with char: \nnUp to column: "
|
||||
char column)
|
||||
|
||||
)
|
||||
char column))
|
||||
|
||||
(defun spacemacs/toggle-frame-fullscreen ()
|
||||
"Respect the `dotspacemacs-fullscreen-use-non-native' variable when
|
||||
toggling fullscreen."
|
||||
(interactive)
|
||||
(if dotspacemacs-fullscreen-use-non-native
|
||||
(toggle-frame-fullscreen-non-native)
|
||||
(spacemacs/toggle-frame-fullscreen-non-native)
|
||||
(toggle-frame-fullscreen)))
|
||||
|
||||
(defun toggle-fullscreen ()
|
||||
(defun spacemacs/toggle-fullscreen ()
|
||||
"Toggle full screen on X11 and Carbon"
|
||||
(interactive)
|
||||
(cond
|
||||
|
@ -776,10 +775,9 @@ toggling fullscreen."
|
|||
((eq window-system 'mac)
|
||||
(set-frame-parameter
|
||||
nil 'fullscreen
|
||||
(when (not (frame-parameter nil 'fullscreen)) 'fullscreen)))
|
||||
))
|
||||
(when (not (frame-parameter nil 'fullscreen)) 'fullscreen)))))
|
||||
|
||||
(defun toggle-frame-fullscreen-non-native ()
|
||||
(defun spacemacs/toggle-frame-fullscreen-non-native ()
|
||||
"Toggle full screen non-natively. Uses the `fullboth' frame paramerter
|
||||
rather than `fullscreen'. Useful to fullscreen on OSX w/o animations."
|
||||
(interactive)
|
||||
|
@ -806,7 +804,7 @@ The body of the advice is in BODY."
|
|||
,@body))
|
||||
commands)))
|
||||
|
||||
(defun disable-electric-indent-mode ()
|
||||
(defun spacemacs/disable-electric-indent-mode ()
|
||||
(if (fboundp 'electric-indent-local-mode)
|
||||
;; for 24.4
|
||||
(electric-indent-local-mode -1)
|
||||
|
@ -859,9 +857,9 @@ current window."
|
|||
(buffer-file-name))))
|
||||
(if file-path
|
||||
(cond
|
||||
((system-is-mswindows) (w32-shell-execute "open" (replace-regexp-in-string "/" "\\\\" file-path)))
|
||||
((system-is-mac) (shell-command (format "open \"%s\"" file-path)))
|
||||
((system-is-linux) (let ((process-connection-type nil))
|
||||
((spacemacs/system-is-mswindows) (w32-shell-execute "open" (replace-regexp-in-string "/" "\\\\" file-path)))
|
||||
((spacemacs/system-is-mac) (shell-command (format "open \"%s\"" file-path)))
|
||||
((spacemacs/system-is-linux) (let ((process-connection-type nil))
|
||||
(start-process "" nil "xdg-open" file-path))))
|
||||
(message "No file associated to this buffer."))))
|
||||
|
||||
|
@ -881,25 +879,24 @@ current window."
|
|||
(call-interactively 'flycheck-previous-error)
|
||||
(call-interactively 'previous-error)))
|
||||
|
||||
(defun switch-to-minibuffer-window ()
|
||||
(defun spacemacs/switch-to-minibuffer-window ()
|
||||
"switch to minibuffer window (if active)"
|
||||
(interactive)
|
||||
(when (active-minibuffer-window)
|
||||
(select-window (active-minibuffer-window))))
|
||||
|
||||
(defun comint-clear-buffer ()
|
||||
(defun spacemacs/comint-clear-buffer ()
|
||||
(interactive)
|
||||
(let ((comint-buffer-maximum-size 0))
|
||||
(comint-truncate-buffer)))
|
||||
|
||||
;; http://stackoverflow.com/a/10216338/4869
|
||||
(defun copy-whole-buffer-to-clipboard ()
|
||||
(defun spacemacs/copy-whole-buffer-to-clipboard ()
|
||||
"Copy entire buffer to clipboard"
|
||||
(interactive)
|
||||
(clipboard-kill-ring-save (point-min) (point-max)))
|
||||
|
||||
|
||||
(defun copy-clipboard-to-whole-buffer ()
|
||||
(defun spacemacs/copy-clipboard-to-whole-buffer ()
|
||||
"Copy clipboard and replace buffer"
|
||||
(interactive)
|
||||
(delete-region (point-min) (point-max))
|
||||
|
@ -908,7 +905,7 @@ current window."
|
|||
|
||||
;; indent on paste
|
||||
;; from Prelude: https://github.com/bbatsov/prelude
|
||||
(defun yank-advised-indent-function (beg end)
|
||||
(defun spacemacs/yank-advised-indent-function (beg end)
|
||||
"Do indentation, as long as the region isn't too large."
|
||||
(if (<= (- end beg) spacemacs-yank-indent-threshold)
|
||||
(indent-region beg end nil)))
|
||||
|
@ -947,12 +944,12 @@ current window."
|
|||
(or (derived-mode-p 'prog-mode)
|
||||
(member major-mode spacemacs-indent-sensitive-modes)))
|
||||
(let ((transient-mark-mode nil))
|
||||
(yank-advised-indent-function (region-beginning) (region-end)))))
|
||||
(spacemacs/yank-advised-indent-function (region-beginning) (region-end)))))
|
||||
|
||||
;; BEGIN align functions
|
||||
|
||||
;; modified function from http://emacswiki.org/emacs/AlignCommands
|
||||
(defun align-repeat (start end regexp &optional justify-right after)
|
||||
(defun spacemacs/align-repeat (start end regexp &optional justify-right after)
|
||||
"Repeat alignment with respect to the given regular expression.
|
||||
If JUSTIFY-RIGHT is non nil justify to the right instead of the
|
||||
left. If AFTER is non-nil, add whitespace to the left instead of
|
||||
|
@ -965,7 +962,7 @@ the right."
|
|||
(align-regexp start end complete-regexp group 1 t)))
|
||||
|
||||
;; Modified answer from http://emacs.stackexchange.com/questions/47/align-vertical-columns-of-numbers-on-the-decimal-point
|
||||
(defun align-repeat-decimal (start end)
|
||||
(defun spacemacs/align-repeat-decimal (start end)
|
||||
"Align a table of numbers on decimal points and dollar signs (both optional)"
|
||||
(interactive "r")
|
||||
(require 'align)
|
||||
|
@ -977,22 +974,22 @@ the right."
|
|||
(justify nil t)))
|
||||
nil))
|
||||
|
||||
(defmacro create-align-repeat-x (name regexp &optional justify-right default-after)
|
||||
(let ((new-func (intern (concat "align-repeat-" name))))
|
||||
(defmacro spacemacs|create-align-repeat-x (name regexp &optional justify-right default-after)
|
||||
(let ((new-func (intern (concat "spacemacs/align-repeat-" name))))
|
||||
`(defun ,new-func (start end switch)
|
||||
(interactive "r\nP")
|
||||
(let ((after (not (eq (if switch t nil) (if ,default-after t nil)))))
|
||||
(align-repeat start end ,regexp ,justify-right after)))))
|
||||
|
||||
(create-align-repeat-x "comma" "," nil t)
|
||||
(create-align-repeat-x "semicolon" ";" nil t)
|
||||
(create-align-repeat-x "colon" ":" nil t)
|
||||
(create-align-repeat-x "equal" "=")
|
||||
(create-align-repeat-x "math-oper" "[+\\-*/]")
|
||||
(create-align-repeat-x "ampersand" "&")
|
||||
(create-align-repeat-x "bar" "|")
|
||||
(create-align-repeat-x "left-paren" "(")
|
||||
(create-align-repeat-x "right-paren" ")" t)
|
||||
(spacemacs|create-align-repeat-x "comma" "," nil t)
|
||||
(spacemacs|create-align-repeat-x "semicolon" ";" nil t)
|
||||
(spacemacs|create-align-repeat-x "colon" ":" nil t)
|
||||
(spacemacs|create-align-repeat-x "equal" "=")
|
||||
(spacemacs|create-align-repeat-x "math-oper" "[+\\-*/]")
|
||||
(spacemacs|create-align-repeat-x "ampersand" "&")
|
||||
(spacemacs|create-align-repeat-x "bar" "|")
|
||||
(spacemacs|create-align-repeat-x "left-paren" "(")
|
||||
(spacemacs|create-align-repeat-x "right-paren" ")" t)
|
||||
|
||||
;; END align functions
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
(define-key global-map (kbd "RET") 'newline-and-indent)
|
||||
|
||||
;; improve delete-other-windows
|
||||
(define-key global-map (kbd "C-x 1") 'toggle-maximize-buffer)
|
||||
(define-key global-map (kbd "C-x 1") 'spacemacs/toggle-maximize-buffer)
|
||||
|
||||
;; replace `dired-goto-file' with `helm-find-files', since `helm-find-files'
|
||||
;; can do the same thing and with fuzzy matching and other features.
|
||||
|
@ -66,14 +66,14 @@
|
|||
"TAB" 'spacemacs/alternate-buffer
|
||||
"bh" 'spacemacs/home
|
||||
"be" 'spacemacs/safe-erase-buffer
|
||||
"bK" 'kill-other-buffers
|
||||
"bK" 'spacemacs/kill-other-buffers
|
||||
"bk" 'ido-kill-buffer
|
||||
"b C-k" 'kill-matching-buffers-rudely
|
||||
"bP" 'copy-clipboard-to-whole-buffer
|
||||
"b C-k" 'spacemacs/kill-matching-buffers-rudely
|
||||
"bP" 'spacemacs/copy-clipboard-to-whole-buffer
|
||||
"bn" 'spacemacs/next-useful-buffer
|
||||
"bp" 'spacemacs/previous-useful-buffer
|
||||
"bR" 'spacemacs/safe-revert-buffer
|
||||
"bY" 'copy-whole-buffer-to-clipboard
|
||||
"bY" 'spacemacs/copy-whole-buffer-to-clipboard
|
||||
"bw" 'read-only-mode)
|
||||
;; Cycling settings -----------------------------------------------------------
|
||||
(evil-leader/set-key "Tn" 'spacemacs/cycle-spacemacs-theme)
|
||||
|
@ -111,28 +111,28 @@ Ensure that helm is required before calling FUNC."
|
|||
;; file -----------------------------------------------------------------------
|
||||
(evil-leader/set-key
|
||||
"fc" 'spacemacs/copy-file
|
||||
"fD" 'delete-current-buffer-file
|
||||
"fei" 'find-user-init-file
|
||||
"fes" 'find-spacemacs-file
|
||||
"fec" 'find-contrib-file
|
||||
"fed" 'find-dotfile
|
||||
"feD" 'ediff-dotfile-and-template
|
||||
"fD" 'spacemacs/delete-current-buffer-file
|
||||
"fei" 'spacemacs/find-user-init-file
|
||||
"fes" 'spacemacs/find-spacemacs-file
|
||||
"fec" 'spacemacs/find-contrib-file
|
||||
"fed" 'spacemacs/find-dotfile
|
||||
"feD" 'spacemacs/ediff-dotfile-and-template
|
||||
"feR" 'dotspacemacs/sync-configuration-layers
|
||||
"fev" 'spacemacs/display-and-copy-version
|
||||
"fg" 'rgrep
|
||||
"fj" 'dired-jump
|
||||
"fl" 'find-file-literally
|
||||
"fo" 'spacemacs/open-in-external-app
|
||||
"fR" 'rename-current-buffer-file
|
||||
"fR" 'spacemacs/rename-current-buffer-file
|
||||
"fS" 'evil-write-all
|
||||
"fs" 'spacemacs/write-file
|
||||
"fy" 'show-and-copy-buffer-filename)
|
||||
"fy" 'spacemacs/show-and-copy-buffer-filename)
|
||||
;; insert stuff ---------------------------------------------------------------
|
||||
(evil-leader/set-key
|
||||
"iJ" 'spacemacs/insert-line-below-no-indent
|
||||
"iK" 'spacemacs/insert-line-above-no-indent
|
||||
"ik" 'evil-insert-line-above
|
||||
"ij" 'evil-insert-line-below)
|
||||
"ik" 'spacemacs/evil-insert-line-above
|
||||
"ij" 'spacemacs/evil-insert-line-below)
|
||||
;; format ---------------------------------------------------------------------
|
||||
;; <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
|
||||
|
@ -142,7 +142,7 @@ Ensure that helm is required before calling FUNC."
|
|||
"jo" 'open-line
|
||||
"j=" 'spacemacs/indent-region-or-buffer
|
||||
"jJ" 'spacemacs/split-and-new-line
|
||||
"jk" 'evil-goto-next-line-and-indent)
|
||||
"jk" 'spacemacs/evil-goto-next-line-and-indent)
|
||||
|
||||
;; navigation -----------------------------------------------------------------
|
||||
(evil-leader/set-key
|
||||
|
@ -295,11 +295,11 @@ Ensure that helm is required before calling FUNC."
|
|||
(golden-ratio)))
|
||||
|
||||
(evil-leader/set-key
|
||||
"w2" 'layout-double-columns
|
||||
"w3" 'layout-triple-columns
|
||||
"wb" 'switch-to-minibuffer-window
|
||||
"w2" 'spacemacs/layout-double-columns
|
||||
"w3" 'spacemacs/layout-triple-columns
|
||||
"wb" 'spacemacs/switch-to-minibuffer-window
|
||||
"wc" 'delete-window
|
||||
"wd" 'toggle-current-window-dedication
|
||||
"wd" 'spacemacs/toggle-current-window-dedication
|
||||
"wH" 'evil-window-move-far-left
|
||||
"wh" 'evil-window-left
|
||||
"wJ" 'evil-window-move-very-bottom
|
||||
|
@ -308,10 +308,10 @@ Ensure that helm is required before calling FUNC."
|
|||
"wk" 'evil-window-up
|
||||
"wL" 'evil-window-move-far-right
|
||||
"wl" 'evil-window-right
|
||||
"wm" 'toggle-maximize-buffer
|
||||
"wM" 'toggle-maximize-centered-buffer
|
||||
"wm" 'spacemacs/toggle-maximize-buffer
|
||||
"wM" 'spacemacs/toggle-maximize-centered-buffer
|
||||
"wo" 'other-frame
|
||||
"wR" 'rotate-windows
|
||||
"wR" 'spacemacs/rotate-windows
|
||||
"ws" 'split-window-below
|
||||
"wS" 'split-window-below-and-focus
|
||||
"w-" 'split-window-below
|
||||
|
@ -325,28 +325,28 @@ Ensure that helm is required before calling FUNC."
|
|||
;; text -----------------------------------------------------------------------
|
||||
(evil-leader/set-key
|
||||
"xaa" 'align
|
||||
"xar" 'align-repeat
|
||||
"xam" 'align-repeat-math-oper
|
||||
"xa." 'align-repeat-decimal
|
||||
"xa," 'align-repeat-comma
|
||||
"xa;" 'align-repeat-semicolon
|
||||
"xa:" 'align-repeat-colon
|
||||
"xa=" 'align-repeat-equal
|
||||
"xa&" 'align-repeat-ampersand
|
||||
"xa|" 'align-repeat-bar
|
||||
"xa(" 'align-repeat-left-paren
|
||||
"xa)" 'align-repeat-right-paren
|
||||
"xar" 'spacemacs/align-repeat
|
||||
"xam" 'spacemacs/align-repeat-math-oper
|
||||
"xa." 'spacemacs/align-repeat-decimal
|
||||
"xa," 'spacemacs/align-repeat-comma
|
||||
"xa;" 'spacemacs/align-repeat-semicolon
|
||||
"xa:" 'spacemacs/align-repeat-colon
|
||||
"xa=" 'spacemacs/align-repeat-equal
|
||||
"xa&" 'spacemacs/align-repeat-ampersand
|
||||
"xa|" 'spacemacs/align-repeat-bar
|
||||
"xa(" 'spacemacs/align-repeat-left-paren
|
||||
"xa)" 'spacemacs/align-repeat-right-paren
|
||||
"xdw" 'delete-trailing-whitespace
|
||||
"xtc" 'transpose-chars
|
||||
"xtl" 'transpose-lines
|
||||
"xtw" 'transpose-words
|
||||
"xU" 'upcase-region
|
||||
"xu" 'downcase-region
|
||||
"xwC" 'count-words-analysis
|
||||
"xwC" 'spacemacs/count-words-analysis
|
||||
"xwc" 'count-words-region)
|
||||
;; google translate -----------------------------------------------------------
|
||||
(evil-leader/set-key
|
||||
"xgl" 'set-google-translate-languages)
|
||||
"xgl" 'spacemacs/set-google-translate-languages)
|
||||
;; shell ----------------------------------------------------------------------
|
||||
(eval-after-load "shell"
|
||||
'(progn
|
||||
|
@ -475,7 +475,7 @@ Ensure that helm is required before calling FUNC."
|
|||
("K" evil-window-move-very-top :doc (spacemacs//window-manipulation-move-doc))
|
||||
("L" evil-window-move-far-right :doc (spacemacs//window-manipulation-move-doc))
|
||||
("o" other-frame :doc (spacemacs//window-manipulation-move-doc))
|
||||
("R" rotate-windows :doc (spacemacs//window-manipulation-move-doc))
|
||||
("R" spacemacs/rotate-windows :doc (spacemacs//window-manipulation-move-doc))
|
||||
("s" split-window-below :doc (spacemacs//window-manipulation-split-doc))
|
||||
("S" split-window-below-and-focus :doc (spacemacs//window-manipulation-split-doc))
|
||||
("u" winner-undo :doc (spacemacs//window-manipulation-layout-doc))
|
||||
|
|
|
@ -231,8 +231,8 @@
|
|||
(use-package auto-highlight-symbol
|
||||
:defer t
|
||||
:init
|
||||
(add-to-hooks 'auto-highlight-symbol-mode '(prog-mode-hook
|
||||
markdown-mode-hook))
|
||||
(spacemacs/add-to-hooks 'auto-highlight-symbol-mode '(prog-mode-hook
|
||||
markdown-mode-hook))
|
||||
:config
|
||||
(progn
|
||||
(setq ahs-case-fold-search nil
|
||||
|
@ -723,8 +723,8 @@
|
|||
;; Make the current definition and/or comment visible.
|
||||
(define-key evil-normal-state-map "zf" 'reposition-window)
|
||||
;; toggle maximize buffer
|
||||
(define-key evil-window-map (kbd "o") 'toggle-maximize-buffer)
|
||||
(define-key evil-window-map (kbd "C-o") 'toggle-maximize-buffer)
|
||||
(define-key evil-window-map (kbd "o") 'spacemacs/toggle-maximize-buffer)
|
||||
(define-key evil-window-map (kbd "C-o") 'spacemacs/toggle-maximize-buffer)
|
||||
|
||||
(evil-leader/set-key "re" 'evil-show-registers)
|
||||
|
||||
|
@ -867,7 +867,7 @@ Example: (evil-map visual \"<\" \"<gv\")"
|
|||
;; between percent signs:
|
||||
(spacemacs|define-text-object "%" "percent" "%" "%"))
|
||||
|
||||
(add-to-hook 'prog-mode-hook '(spacemacs//standard-text-objects))
|
||||
(spacemacs/add-to-hook 'prog-mode-hook '(spacemacs//standard-text-objects))
|
||||
|
||||
;; support smart 1parens-strict-mode
|
||||
(when (configuration-layer/package-usedp 'smartparens)
|
||||
|
@ -1017,7 +1017,7 @@ Example: (evil-map visual \"<\" \"<gv\")"
|
|||
(progn
|
||||
(defun spacemacs/evil-numbers-micro-state-doc ()
|
||||
"Display a short documentation in the mini buffer."
|
||||
(echo "+/= to increase the value or - to decrease it"))
|
||||
(spacemacs/echo "+/= to increase the value or - to decrease it"))
|
||||
|
||||
(defun spacemacs/evil-numbers-micro-state-overlay-map ()
|
||||
"Set a temporary overlay map to easily increase or decrease a number"
|
||||
|
@ -2317,10 +2317,10 @@ Put (global-hungry-delete-mode) in dotspacemacs/config to enable by default."
|
|||
(define-key ido-completion-map (kbd "C-S-n") 'next-history-element)
|
||||
(define-key ido-completion-map (kbd "C-S-p") 'previous-history-element)
|
||||
;; ido-other window maps
|
||||
(define-key ido-completion-map (kbd "C-o") 'ido-invoke-in-other-window)
|
||||
(define-key ido-completion-map (kbd "C-s") 'ido-invoke-in-vertical-split)
|
||||
(define-key ido-completion-map (kbd "C-t") 'ido-invoke-in-new-frame)
|
||||
(define-key ido-completion-map (kbd "C-v") 'ido-invoke-in-horizontal-split)
|
||||
(define-key ido-completion-map (kbd "C-o") 'spacemacs/ido-invoke-in-other-window)
|
||||
(define-key ido-completion-map (kbd "C-s") 'spacemacs/ido-invoke-in-vertical-split)
|
||||
(define-key ido-completion-map (kbd "C-t") 'spacemacs/ido-invoke-in-new-frame)
|
||||
(define-key ido-completion-map (kbd "C-v") 'spacemacs/ido-invoke-in-horizontal-split)
|
||||
;; more natural navigation keys: up, down to change current item
|
||||
;; left to go up dir
|
||||
;; right to open the selected item
|
||||
|
@ -2397,12 +2397,12 @@ Put (global-hungry-delete-mode) in dotspacemacs/config to enable by default."
|
|||
("K" ido-prev-match-dir)
|
||||
("l" ido-exit-minibuffer :exit t)
|
||||
("n" ido-next-match-dir)
|
||||
("o" ido-invoke-in-other-window :exit t)
|
||||
("o" spacemacs/ido-invoke-in-other-window :exit t)
|
||||
("p" ido-prev-match-dir)
|
||||
("q" nil :exit t)
|
||||
("s" ido-invoke-in-vertical-split :exit t)
|
||||
("t" ido-invoke-in-new-frame :exit t)
|
||||
("v" ido-invoke-in-horizontal-split :exit t)))))
|
||||
("s" spacemacs/ido-invoke-in-vertical-split :exit t)
|
||||
("t" spacemacs/ido-invoke-in-new-frame :exit t)
|
||||
("v" spacemacs/ido-invoke-in-horizontal-split :exit t)))))
|
||||
|
||||
(defun spacemacs/init-iedit ()
|
||||
(use-package iedit
|
||||
|
@ -2627,8 +2627,8 @@ It will toggle the overlay under point or create an overlay of one character."
|
|||
"pt" 'neotree-find-project-root))
|
||||
|
||||
:config
|
||||
(add-to-hook 'neotree-mode-hook '(spacemacs//init-neotree
|
||||
spacemacs//neotree-key-bindings))))
|
||||
(spacemacs/add-to-hook 'neotree-mode-hook '(spacemacs//init-neotree
|
||||
spacemacs//neotree-key-bindings))))
|
||||
|
||||
(defun spacemacs/init-page-break-lines ()
|
||||
(use-package page-break-lines
|
||||
|
@ -3309,7 +3309,7 @@ one of `l' or `r'."
|
|||
;; note for Windows: GNU find or Cygwin find must be in path
|
||||
;; default parameters are not supported on Windows, we default
|
||||
;; to simplest call to find.
|
||||
(when (system-is-mswindows)
|
||||
(when (spacemacs/system-is-mswindows)
|
||||
(setq projectile-generic-command "find . -type f"))
|
||||
(setq projectile-enable-caching t
|
||||
projectile-indexing-method 'alien
|
||||
|
@ -3353,7 +3353,7 @@ one of `l' or `r'."
|
|||
(progn
|
||||
(evil-leader/set-key "tCd" 'rainbow-delimiters-mode)
|
||||
(when (member dotspacemacs-highlight-delimiters '(any all))
|
||||
(add-to-hooks 'rainbow-delimiters-mode '(prog-mode-hook))))))
|
||||
(spacemacs/add-to-hooks 'rainbow-delimiters-mode '(prog-mode-hook))))))
|
||||
|
||||
(defun spacemacs/init-recentf ()
|
||||
(use-package recentf
|
||||
|
@ -3405,10 +3405,10 @@ one of `l' or `r'."
|
|||
:defer t
|
||||
:init
|
||||
(progn
|
||||
(add-to-hooks (if dotspacemacs-smartparens-strict-mode
|
||||
'smartparens-strict-mode
|
||||
'smartparens-mode)
|
||||
'(prog-mode-hook))
|
||||
(spacemacs/add-to-hooks (if dotspacemacs-smartparens-strict-mode
|
||||
'smartparens-strict-mode
|
||||
'smartparens-mode)
|
||||
'(prog-mode-hook))
|
||||
|
||||
;; enable smartparens-mode in `eval-expression'
|
||||
(defun conditionally-enable-smartparens-mode ()
|
||||
|
|
Loading…
Reference in New Issue