General comment and autoload tag update + clean up
This commit is contained in:
parent
eed919e1bb
commit
6a3252d902
11 changed files with 84 additions and 54 deletions
|
@ -9,10 +9,12 @@
|
||||||
;; Formatting
|
;; Formatting
|
||||||
delete-trailing-lines nil
|
delete-trailing-lines nil
|
||||||
fill-column 80
|
fill-column 80
|
||||||
|
;; Spaces, not tabs
|
||||||
indent-tabs-mode nil
|
indent-tabs-mode nil
|
||||||
require-final-newline t
|
require-final-newline t
|
||||||
tab-always-indent t
|
tab-always-indent t
|
||||||
tab-width 4
|
tab-width 4
|
||||||
|
;; Wrapping
|
||||||
truncate-lines t
|
truncate-lines t
|
||||||
truncate-partial-width-windows 50
|
truncate-partial-width-windows 50
|
||||||
visual-fill-column-center-text nil
|
visual-fill-column-center-text nil
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
(tool-bar-mode -1) ; no toolbar
|
(tool-bar-mode -1) ; no toolbar
|
||||||
;; full filename in frame title
|
;; full filename in frame title
|
||||||
(setq frame-title-format '(buffer-file-name "%f" ("%b")))
|
(setq frame-title-format '(buffer-file-name "%f" ("%b")))
|
||||||
;; set font
|
;; Set theme and font
|
||||||
(with-demoted-errors "FONT ERROR: %s"
|
(with-demoted-errors "FONT ERROR: %s"
|
||||||
(set-frame-font doom-default-font t)
|
(set-frame-font doom-default-font t)
|
||||||
;; Fallback to `doom-unicode-font' for Unicode characters
|
;; Fallback to `doom-unicode-font' for Unicode characters
|
||||||
|
|
|
@ -79,5 +79,10 @@ these workgroups won't be auto-renamed.")
|
||||||
(workgroups-mode +1)
|
(workgroups-mode +1)
|
||||||
(wg-create-workgroup wg-first-wg-name)))
|
(wg-create-workgroup wg-first-wg-name)))
|
||||||
|
|
||||||
|
(unless window-system
|
||||||
|
(defalias 'wg-workgroup-associated-buffers 'ignore)
|
||||||
|
(defalias 'wg-current-workgroup 'ignore)
|
||||||
|
(defalias 'wg-save-session 'ignore))
|
||||||
|
|
||||||
(provide 'core-workgroups)
|
(provide 'core-workgroups)
|
||||||
;;; core-workgroups.el ends here
|
;;; core-workgroups.el ends here
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
;;;###autoload (autoload 'doom:narrow "defuns-buffers" nil t)
|
;;;###autoload (autoload 'doom:narrow "defuns-buffers" nil t)
|
||||||
(evil-define-operator doom:narrow (&optional beg end bang)
|
(evil-define-operator doom:narrow (&optional beg end bang)
|
||||||
"Restrict editing in this buffer to the current region, indirectly. With BANG,
|
"Restrict editing in this buffer to the current region, indirectly. With BANG,
|
||||||
clone the buffer and hard-narrow the selection. Otherwise use fancy-narrow. If
|
clone the buffer and hard-narrow the selection. If mark isn't active, then widen
|
||||||
mark isn't active, then widen the buffer (if narrowed).
|
the buffer (if narrowed).
|
||||||
|
|
||||||
Inspired from http://demonastery.org/2013/04/emacs-evil-narrow-region/"
|
Inspired from http://demonastery.org/2013/04/emacs-evil-narrow-region/"
|
||||||
(interactive "<r><!>")
|
(interactive "<r><!>")
|
||||||
|
@ -19,14 +19,14 @@ Inspired from http://demonastery.org/2013/04/emacs-evil-narrow-region/"
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/set-read-only-region (begin end)
|
(defun doom/set-read-only-region (begin end)
|
||||||
"See http://stackoverflow.com/questions/7410125"
|
"Mark a region as read-only (http://stackoverflow.com/questions/7410125)"
|
||||||
(let ((modified (buffer-modified-p)))
|
(let ((modified (buffer-modified-p)))
|
||||||
(add-text-properties begin end '(read-only t))
|
(add-text-properties begin end '(read-only t))
|
||||||
(set-buffer-modified-p modified)))
|
(set-buffer-modified-p modified)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/set-region-writeable (begin end)
|
(defun doom/set-region-writeable (begin end)
|
||||||
"See http://stackoverflow.com/questions/7410125"
|
"Undoes `doom/set-read-only-region' (http://stackoverflow.com/questions/7410125)"
|
||||||
(let ((modified (buffer-modified-p))
|
(let ((modified (buffer-modified-p))
|
||||||
(inhibit-read-only t))
|
(inhibit-read-only t))
|
||||||
(remove-text-properties begin end '(read-only t))
|
(remove-text-properties begin end '(read-only t))
|
||||||
|
@ -35,17 +35,12 @@ Inspired from http://demonastery.org/2013/04/emacs-evil-narrow-region/"
|
||||||
|
|
||||||
;; Buffer Life and Death ;;;;;;;;;;;;;;;
|
;; Buffer Life and Death ;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(unless window-system
|
|
||||||
(defalias 'wg-workgroup-associated-buffers 'ignore)
|
|
||||||
(defalias 'wg-current-workgroup 'ignore)
|
|
||||||
(defalias 'wg-save-session 'ignore))
|
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/get-buffers (&optional all-p)
|
(defun doom/get-buffers (&optional all-p)
|
||||||
"Get all buffers in the current workgroup.
|
"Get all buffers in the current project, in the current workgroup.
|
||||||
|
|
||||||
If PROJECT-P is non-nil, get all buffers in current workgroup
|
If ALL-P is non-nil, get all buffers across all projects in current
|
||||||
If both are non-nil, get all project buffers across all workgroups"
|
workgroup."
|
||||||
(let ((buffers (if (wg-current-workgroup t)
|
(let ((buffers (if (wg-current-workgroup t)
|
||||||
(doom/get-buffers-in-workgroup)
|
(doom/get-buffers-in-workgroup)
|
||||||
(buffer-list)))
|
(buffer-list)))
|
||||||
|
@ -59,48 +54,64 @@ Inspired from http://demonastery.org/2013/04/emacs-evil-narrow-region/"
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/get-buffers-in-workgroup ()
|
(defun doom/get-buffers-in-workgroup ()
|
||||||
(let ((assoc-bufs (wg-workgroup-associated-buffers nil)))
|
"Get a list of buffers in current workgroup. Returns nil if workgroups2 isn't
|
||||||
(--filter (memq it assoc-bufs) (buffer-list))))
|
loaded."
|
||||||
|
(when (featurep 'workgroups2)
|
||||||
|
(let ((assoc-bufs (wg-workgroup-associated-buffers nil)))
|
||||||
|
(--filter (memq it assoc-bufs) (buffer-list)))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/get-buffer-names (&optional buffer-list)
|
(defun doom/get-buffer-names (&optional buffer-list)
|
||||||
|
"Get a list of names of buffers in the current workgroup, OR return the names
|
||||||
|
of the buffers in BUFFER-LIST."
|
||||||
(mapcar #'buffer-name (or buffer-list (doom/get-buffers))))
|
(mapcar #'buffer-name (or buffer-list (doom/get-buffers))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/get-visible-windows (&optional window-list)
|
(defun doom/get-visible-windows (&optional window-list)
|
||||||
"Get a list of the visible windows in the current frame (that aren't popups)."
|
"Get a list of the visible windows in the current frame (that aren't popups),
|
||||||
|
OR return only the visible windows in WINDOW-LIST."
|
||||||
(-remove #'doom/popup-p (or window-list (window-list))))
|
(-remove #'doom/popup-p (or window-list (window-list))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/get-visible-buffers (&optional buffer-list)
|
(defun doom/get-visible-buffers (&optional buffer-list)
|
||||||
"Get a list of unburied buffers in the current project and workgroup."
|
"Get a list of unburied buffers in the current project and workgroup, OR
|
||||||
|
return only the unburied buffers in BUFFER-LIST (a list of BUFFER-OR-NAMEs)."
|
||||||
(-filter #'get-buffer-window (or buffer-list (doom/get-buffers))))
|
(-filter #'get-buffer-window (or buffer-list (doom/get-buffers))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/get-buried-buffers (&optional buffer-list)
|
(defun doom/get-buried-buffers (&optional buffer-list)
|
||||||
"Get a list of buried buffers in the current project and workgroup."
|
"Get a list of buried buffers in the current project and workgroup, OR return
|
||||||
|
only the buried buffers in BUFFER-LIST (a list of BUFFER-OR-NAMEs)."
|
||||||
(-remove 'get-buffer-window (or buffer-list (doom/get-buffers))))
|
(-remove 'get-buffer-window (or buffer-list (doom/get-buffers))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/get-matching-buffers (pattern &optional buffer-list)
|
(defun doom/get-matching-buffers (pattern &optional buffer-list)
|
||||||
"Get a list of buffers that match the pattern"
|
"Get a list of all buffers (in the current workgroup OR in BUFFER-LIST) that
|
||||||
|
match the regex PATTERN."
|
||||||
(--filter (string-match-p pattern (buffer-name it))
|
(--filter (string-match-p pattern (buffer-name it))
|
||||||
(or buffer-list (doom/get-buffers))))
|
(or buffer-list (doom/get-buffers))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/get-buffers-in-modes (modes &optional buffer-list)
|
(defun doom/get-buffers-in-modes (modes &optional buffer-list)
|
||||||
"Get a list of buffers whose major-mode is one of MODES"
|
"Get a list of all buffers (in the current workgroup OR in BUFFER-LIST) whose
|
||||||
|
`major-mode' is one of MODES."
|
||||||
(--filter (memq (buffer-local-value 'major-mode it) modes)
|
(--filter (memq (buffer-local-value 'major-mode it) modes)
|
||||||
(or buffer-list (doom/get-buffers))))
|
(or buffer-list (doom/get-buffers))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/get-real-buffers (&optional buffer-list)
|
(defun doom/get-real-buffers (&optional buffer-list)
|
||||||
|
"Get a list of all buffers (in the current workgroup OR in BUFFER-LIST) that
|
||||||
|
`doom/real-buffer-p' returns non-nil for."
|
||||||
(-filter #'doom/real-buffer-p (or buffer-list (doom/get-buffers))))
|
(-filter #'doom/real-buffer-p (or buffer-list (doom/get-buffers))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/kill-real-buffer (&optional arg)
|
(defun doom/kill-real-buffer (&optional arg)
|
||||||
"Kill buffer (but only bury scratch buffer), then switch to a real buffer. Only buries
|
"Kill buffer then switch to a real buffer. Only buries the buffer if it is
|
||||||
the buffer if it is being displayed in another window."
|
being displayed in another window.
|
||||||
|
|
||||||
|
NOTE: only buries scratch buffer.
|
||||||
|
|
||||||
|
See `doom/real-buffer-p' for what 'real' means."
|
||||||
(interactive (list t))
|
(interactive (list t))
|
||||||
(cond ((eq (current-buffer) doom-buffer)
|
(cond ((eq (current-buffer) doom-buffer)
|
||||||
(doom-mode-init t))
|
(doom-mode-init t))
|
||||||
|
@ -124,7 +135,8 @@ the buffer if it is being displayed in another window."
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/kill-unreal-buffers ()
|
(defun doom/kill-unreal-buffers ()
|
||||||
"Kill all buried, unreal buffers in current frame. See `doom-unreal-buffers'"
|
"Kill all buried buffers in current frame that match any of the rules in
|
||||||
|
`doom-unreal-buffers'."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((kill-list (-remove 'doom/real-buffer-p
|
(let ((kill-list (-remove 'doom/real-buffer-p
|
||||||
(doom/get-buried-buffers (buffer-list)))))
|
(doom/get-buried-buffers (buffer-list)))))
|
||||||
|
@ -134,7 +146,7 @@ the buffer if it is being displayed in another window."
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/kill-process-buffers ()
|
(defun doom/kill-process-buffers ()
|
||||||
"Kill all buffers that represent running processes and aren't visible."
|
"Kill all buried buffers that represent running processes."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((buffer-list (buffer-list))
|
(let ((buffer-list (buffer-list))
|
||||||
(killed-processes 0))
|
(killed-processes 0))
|
||||||
|
@ -152,11 +164,13 @@ the buffer if it is being displayed in another window."
|
||||||
(message "Cleaned up %s processes" killed-processes)))
|
(message "Cleaned up %s processes" killed-processes)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/kill-matching-buffers (regexp &optional buffer-list)
|
(defun doom/kill-matching-buffers (pattern &optional buffer-list)
|
||||||
|
"Kill all buffers (in current workgroup OR in BUFFER-LIST) that match the
|
||||||
|
regex PATTERN."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((i 0))
|
(let ((i 0))
|
||||||
(mapc (lambda (b)
|
(mapc (lambda (b)
|
||||||
(when (string-match-p regexp (buffer-name b))
|
(when (string-match-p pattern (buffer-name b))
|
||||||
(kill-buffer b)
|
(kill-buffer b)
|
||||||
(setq i (1+ i))))
|
(setq i (1+ i))))
|
||||||
(if buffer-list buffer-list (doom/get-buffers)))
|
(if buffer-list buffer-list (doom/get-buffers)))
|
||||||
|
@ -164,8 +178,8 @@ the buffer if it is being displayed in another window."
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/cycle-real-buffers (&optional n)
|
(defun doom/cycle-real-buffers (&optional n)
|
||||||
"Switch to the previous buffer and avoid special buffers. If there's nothing
|
"Switch to the previous buffer, skipping over special buffers. If there's
|
||||||
left, create a scratch buffer."
|
nothing left, create a scratch buffer."
|
||||||
(let* ((start-buffer (current-buffer))
|
(let* ((start-buffer (current-buffer))
|
||||||
(move-func (if (> n 0) 'switch-to-next-buffer 'switch-to-prev-buffer))
|
(move-func (if (> n 0) 'switch-to-next-buffer 'switch-to-prev-buffer))
|
||||||
(max 25)
|
(max 25)
|
||||||
|
@ -194,8 +208,9 @@ left, create a scratch buffer."
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/real-buffer-p (&optional buffer)
|
(defun doom/real-buffer-p (&optional buffer)
|
||||||
"Returns whether BUFFER a 'real' buffer or not. Real means it isn't a popup,
|
"Returns whether BUFFER a 'real' buffer or not. Real means: a) it isn't a
|
||||||
temporary, scratch or special buffer."
|
popup (or temporary) window and b) it isn't a special buffer (e.g. scratch or
|
||||||
|
*messages* buffer)."
|
||||||
(setq buffer (or (and (bufferp buffer) buffer)
|
(setq buffer (or (and (bufferp buffer) buffer)
|
||||||
(and (stringp buffer) (get-buffer buffer))
|
(and (stringp buffer) (get-buffer buffer))
|
||||||
(current-buffer)))
|
(current-buffer)))
|
||||||
|
@ -206,16 +221,17 @@ temporary, scratch or special buffer."
|
||||||
(--any? (string-match-p it (buffer-name buffer))
|
(--any? (string-match-p it (buffer-name buffer))
|
||||||
(-filter 'stringp doom-unreal-buffers))))))))
|
(-filter 'stringp doom-unreal-buffers))))))))
|
||||||
|
|
||||||
;; Inspired by spacemacs <https://github.com/syl20bnr/spacemacs/blob/master/spacemacs/funcs.el>
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/next-real-buffer ()
|
(defun doom/next-real-buffer ()
|
||||||
"Switch to the next buffer and avoid special buffers."
|
"Switch to the next real buffer, skipping special buffers. See
|
||||||
|
`doom/real-buffer-p'."
|
||||||
(interactive)
|
(interactive)
|
||||||
(doom/cycle-real-buffers +1))
|
(doom/cycle-real-buffers +1))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/previous-real-buffer ()
|
(defun doom/previous-real-buffer ()
|
||||||
"Switch to the previous buffer and avoid special buffers."
|
"Switch to the previous real buffer, skipping special buffers. See
|
||||||
|
`doom/real-buffer-p'."
|
||||||
(interactive)
|
(interactive)
|
||||||
(doom/cycle-real-buffers -1))
|
(doom/cycle-real-buffers -1))
|
||||||
|
|
||||||
|
@ -247,22 +263,23 @@ temporary, scratch or special buffer."
|
||||||
|
|
||||||
;;;###autoload (autoload 'doom:kill-buried-buffers "defuns-buffers" nil t)
|
;;;###autoload (autoload 'doom:kill-buried-buffers "defuns-buffers" nil t)
|
||||||
(evil-define-command doom:kill-buried-buffers (&optional bang)
|
(evil-define-command doom:kill-buried-buffers (&optional bang)
|
||||||
"Kill buried project buffers (in workgroup) and report how many it found. BANG = get all
|
"Kill buried project buffers in current workgroup and report how many it
|
||||||
buffers regardless of project."
|
found. If BANG, then include buffers that aren't part of the current project."
|
||||||
(interactive "<!>")
|
(interactive "<!>")
|
||||||
(doom--kill-buffers (doom/get-buried-buffers (doom/get-buffers (not bang)))))
|
(doom--kill-buffers (doom/get-buried-buffers (doom/get-buffers (not bang)))))
|
||||||
|
|
||||||
;;;###autoload (autoload 'doom:kill-buried-buffers "defuns-buffers" nil t)
|
;;;###autoload (autoload 'doom:kill-buried-buffers "defuns-buffers" nil t)
|
||||||
(evil-define-command doom:kill-matching-buffers (&optional bang pattern)
|
(evil-define-command doom:kill-matching-buffers (&optional bang pattern)
|
||||||
"Kill project buffers matching regex pattern PATTERN. If BANG, then extend search to
|
"Kill project buffers in current workgroup that match regex PATTERN. If BANG,
|
||||||
buffers regardless of project."
|
then include buffers that aren't part of the current project."
|
||||||
:repeat nil
|
:repeat nil
|
||||||
(interactive "<!><a>")
|
(interactive "<!><a>")
|
||||||
(doom-kill-buffers (doom/get-matching-buffers pattern (doom/get-buffers (not bang)))))
|
(doom-kill-buffers (doom/get-matching-buffers pattern (doom/get-buffers (not bang)))))
|
||||||
|
|
||||||
;;;###autoload (autoload 'doom:scratch-buffer "defuns-buffers" nil t)
|
;;;###autoload (autoload 'doom:scratch-buffer "defuns-buffers" nil t)
|
||||||
(evil-define-operator doom:scratch-buffer (&optional beg end bang)
|
(evil-define-operator doom:scratch-buffer (&optional beg end bang)
|
||||||
"Send a selection to the scratch buffer. If BANG, don't use a popup."
|
"Send a region to and pop up the scratch buffer. If BANG, don't use a popup
|
||||||
|
(use the current window)."
|
||||||
:move-point nil
|
:move-point nil
|
||||||
:type inclusive
|
:type inclusive
|
||||||
(interactive "<r><!>")
|
(interactive "<r><!>")
|
||||||
|
@ -282,14 +299,14 @@ buffers regardless of project."
|
||||||
|
|
||||||
;;;###autoload (autoload 'doom:cd "defuns-buffers" nil t)
|
;;;###autoload (autoload 'doom:cd "defuns-buffers" nil t)
|
||||||
(evil-define-command doom:cd (dir)
|
(evil-define-command doom:cd (dir)
|
||||||
"Ex-command alias for `cd'"
|
"Change the `default-directory' to DIR (alias for `cd')"
|
||||||
:repeat nil
|
:repeat nil
|
||||||
(interactive "<f>")
|
(interactive "<f>")
|
||||||
(cd (if (zerop (length dir)) "~" dir)))
|
(cd (if (zerop (length dir)) "~" dir)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/kill-all-buffers-do-not-remember ()
|
(defun doom/kill-workgroup-and-quit ()
|
||||||
"Kill all buffers so that workgroups2 will wipe its current session."
|
"Wipe the current workgroup session and save the blank slate."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let (confirm-kill-emacs)
|
(let (confirm-kill-emacs)
|
||||||
(mapc 'kill-buffer (doom/get-buffers t))
|
(mapc 'kill-buffer (doom/get-buffers t))
|
||||||
|
|
|
@ -2,12 +2,14 @@
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/company-evil-complete-next (&optional arg)
|
(defun doom/company-evil-complete-next (&optional arg)
|
||||||
|
"dabbrev wrapper for `evil-complete-next'"
|
||||||
(call-interactively 'company-dabbrev)
|
(call-interactively 'company-dabbrev)
|
||||||
(if (eq company-candidates-length 1)
|
(if (eq company-candidates-length 1)
|
||||||
(company-complete)))
|
(company-complete)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/company-evil-complete-previous (&optional arg)
|
(defun doom/company-evil-complete-previous (&optional arg)
|
||||||
|
"dabbrev wrapper for `evil-complete-previous'"
|
||||||
(let ((company-selection-wrap-around t))
|
(let ((company-selection-wrap-around t))
|
||||||
(call-interactively 'company-dabbrev)
|
(call-interactively 'company-dabbrev)
|
||||||
(if (eq company-candidates-length 1)
|
(if (eq company-candidates-length 1)
|
||||||
|
@ -37,6 +39,8 @@
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/company-whole-lines (command &optional arg &rest ignored)
|
(defun doom/company-whole-lines (command &optional arg &rest ignored)
|
||||||
|
"`company-mode' completion backend that completes whole-lines, akin to vim's
|
||||||
|
C-x C-l."
|
||||||
(interactive (list 'interactive))
|
(interactive (list 'interactive))
|
||||||
(let ((lines (doom--company-whole-lines)))
|
(let ((lines (doom--company-whole-lines)))
|
||||||
(cl-case command
|
(cl-case command
|
||||||
|
@ -52,7 +56,7 @@
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/company-complete ()
|
(defun doom/company-complete ()
|
||||||
"Bring up the completion popup. If there is only one result, auto-complete it."
|
"Bring up the completion popup. If only one result, complete it."
|
||||||
(interactive)
|
(interactive)
|
||||||
(require 'company)
|
(require 'company)
|
||||||
(when (and (bound-and-true-p company-mode)
|
(when (and (bound-and-true-p company-mode)
|
||||||
|
|
|
@ -46,6 +46,7 @@
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/reselect-paste ()
|
(defun doom/reselect-paste ()
|
||||||
|
"Go back into visual mode and reselect the last pasted region."
|
||||||
(interactive)
|
(interactive)
|
||||||
(evil-goto-mark ?\[)
|
(evil-goto-mark ?\[)
|
||||||
(evil-visual-state)
|
(evil-visual-state)
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/embrace-escaped ()
|
(defun doom/embrace-escaped ()
|
||||||
"Escaped surround characters."
|
"Backslash-escaped surround character support for embrace."
|
||||||
(let ((char (read-char "\\")))
|
(let ((char (read-char "\\")))
|
||||||
(if (eq char 27)
|
(if (eq char 27)
|
||||||
(cons "" "")
|
(cons "" "")
|
||||||
|
@ -23,11 +23,12 @@
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/embrace-latex ()
|
(defun doom/embrace-latex ()
|
||||||
"LaTeX commands"
|
"LaTeX command support for embrace."
|
||||||
(cons (format "\\%s{" (read-string "\\")) "}"))
|
(cons (format "\\%s{" (read-string "\\")) "}"))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/embrace-elisp-fn ()
|
(defun doom/embrace-elisp-fn ()
|
||||||
|
"Elisp function support for embrace."
|
||||||
(cons (format "(%s " (or (read-string "(") "")) ")"))
|
(cons (format "(%s " (or (read-string "(") "")) ")"))
|
||||||
|
|
||||||
(provide 'defuns-embrace)
|
(provide 'defuns-embrace)
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
;;; defuns-evil.el
|
;;; defuns-evil.el
|
||||||
|
|
||||||
;;;###autoload (autoload 'doom:evil-open-folds "defuns-evil" nil t)
|
;;;###autoload (autoload 'doom/evil-open-folds "defuns-evil" nil t)
|
||||||
(evil-define-command doom/evil-open-folds (count)
|
(evil-define-command doom/evil-open-folds (count)
|
||||||
"Instead of `evil-open-folds'. Accepts COUNT for dictating fold level."
|
"Instead of `evil-open-folds'; accepts COUNT for dictating fold level."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(unless (bound-and-true-p hs-minor-mode)
|
(unless (bound-and-true-p hs-minor-mode)
|
||||||
(hs-minor-mode 1))
|
(hs-minor-mode 1))
|
||||||
(if count (hs-hide-level count) (evil-open-folds)))
|
(if count (hs-hide-level count) (evil-open-folds)))
|
||||||
|
|
||||||
;;;###autoload (autoload 'doom:evil-open-folds "defuns-evil" nil t)
|
;;;###autoload (autoload 'doom/evil-open-folds "defuns-evil" nil t)
|
||||||
(evil-define-command doom/evil-close-folds (count)
|
(evil-define-command doom/evil-close-folds (count)
|
||||||
"Instead of `evil-close-folds'. Accepts COUNT for dictating fold level."
|
"Instead of `evil-close-folds'; accepts COUNT for dictating fold level."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(unless (bound-and-true-p hs-minor-mode)
|
(unless (bound-and-true-p hs-minor-mode)
|
||||||
(hs-minor-mode 1))
|
(hs-minor-mode 1))
|
||||||
|
@ -18,14 +18,14 @@
|
||||||
|
|
||||||
;;;###autoload (autoload 'doom/multi-next-line "defuns-evil" nil t)
|
;;;###autoload (autoload 'doom/multi-next-line "defuns-evil" nil t)
|
||||||
(evil-define-motion doom/multi-next-line (count)
|
(evil-define-motion doom/multi-next-line (count)
|
||||||
"Move down 6 lines"
|
"Move down 6 lines."
|
||||||
:type line
|
:type line
|
||||||
(let ((line-move-visual visual-line-mode))
|
(let ((line-move-visual visual-line-mode))
|
||||||
(evil-line-move (* 6 (or count 1)))))
|
(evil-line-move (* 6 (or count 1)))))
|
||||||
|
|
||||||
;;;###autoload (autoload 'doom/multi-previous-line "defuns-evil" nil t)
|
;;;###autoload (autoload 'doom/multi-previous-line "defuns-evil" nil t)
|
||||||
(evil-define-motion doom/multi-previous-line (count)
|
(evil-define-motion doom/multi-previous-line (count)
|
||||||
"Move up 6 lines"
|
"Move up 6 lines."
|
||||||
:type line
|
:type line
|
||||||
(let ((line-move-visual visual-line-mode))
|
(let ((line-move-visual visual-line-mode))
|
||||||
(evil-line-move (- (* 6 (or count 1))))))
|
(evil-line-move (- (* 6 (or count 1))))))
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
;;;###autoload (autoload 'doom:file-delete "defuns-file" nil t)
|
;;;###autoload (autoload 'doom:file-delete "defuns-file" nil t)
|
||||||
(evil-define-command doom:file-delete (&optional bang filename)
|
(evil-define-command doom:file-delete (&optional bang filename)
|
||||||
"Delete current buffer's file. If bang, then kill the buffer afterwards as well."
|
"Delete current buffer's file. If BANG, kill buffer afterwards."
|
||||||
:repeat nil
|
:repeat nil
|
||||||
(interactive "<!><f>")
|
(interactive "<!><f>")
|
||||||
(let ((filename (file-truename (or filename (buffer-file-name)))))
|
(let ((filename (file-truename (or filename (buffer-file-name)))))
|
||||||
|
@ -41,7 +41,7 @@ provided."
|
||||||
;;;###autoload (autoload 'doom:file-move "defuns-file" nil t)
|
;;;###autoload (autoload 'doom:file-move "defuns-file" nil t)
|
||||||
(evil-define-command doom:file-move (path)
|
(evil-define-command doom:file-move (path)
|
||||||
"Move current buffer's file to PATH. Replaces %, # and other variables (see
|
"Move current buffer's file to PATH. Replaces %, # and other variables (see
|
||||||
`evil-ex-replace-special-filenames')"
|
`evil-ex-replace-special-filenames')"
|
||||||
:repeat nil
|
:repeat nil
|
||||||
(interactive "<f>")
|
(interactive "<f>")
|
||||||
(let* ((old-path (buffer-file-name))
|
(let* ((old-path (buffer-file-name))
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
;; (require 'ac-octave)
|
;; (require 'ac-octave)
|
||||||
;; (setq ac-sources '(ac-source-octave))))
|
;; (setq ac-sources '(ac-source-octave))))
|
||||||
|
|
||||||
(use-package octave-inf :commands (run-octave))
|
(use-package octave-inf :commands run-octave)
|
||||||
|
|
||||||
(provide 'module-octave)
|
(provide 'module-octave)
|
||||||
;;; module-octave.el ends here
|
;;; module-octave.el ends here
|
||||||
|
|
|
@ -107,7 +107,7 @@
|
||||||
:n "S" 'doom/yas-find-file
|
:n "S" 'doom/yas-find-file
|
||||||
;; Quick quitting
|
;; Quick quitting
|
||||||
:nv "Q" 'evil-save-and-quit
|
:nv "Q" 'evil-save-and-quit
|
||||||
:nv "C-q" 'doom/kill-all-buffers-do-not-remember
|
:nv "C-q" 'doom/kill-workgroup-and-quit
|
||||||
;; Quick access to config files
|
;; Quick access to config files
|
||||||
:nv "E" (@find-file-in doom-emacs-dir t)
|
:nv "E" (@find-file-in doom-emacs-dir t)
|
||||||
:nv "\\" (@find-file-in (f-expand ".dotfiles" "~") t)
|
:nv "\\" (@find-file-in (f-expand ".dotfiles" "~") t)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue