General clean up
This commit is contained in:
parent
b8a845d9ee
commit
0759cefa7e
7 changed files with 13 additions and 16 deletions
|
@ -387,7 +387,7 @@
|
|||
|
||||
(add-hook! emacs-lisp-mode
|
||||
(setq evil-surround-pairs-alist
|
||||
(cons '(?\` . ("`" . "*")) evil-surround-pairs-alist)))
|
||||
(cons '(?\` . ("`" . "'")) evil-surround-pairs-alist)))
|
||||
|
||||
(add-hook! python-mode
|
||||
(setq evil-surround-pairs-alist
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
;; Helm tries to clean up after itself, but shackle has already done this. This fixes
|
||||
;; that. To reproduce, add a helm rule in `shackle-rules', open two splits
|
||||
;; side-by-side, move to the buffer on the right and invoke helm. It will close all
|
||||
;; but th left-most buffer.
|
||||
;; but the left-most buffer.
|
||||
(setq-default helm-split-window-in-side-p t))
|
||||
|
||||
(after! helm-swoop
|
||||
|
@ -151,6 +151,7 @@
|
|||
(setq narf-popup-windows (delete window narf-popup-windows)))
|
||||
|
||||
(defun narf/popup-p (&optional window)
|
||||
"Whether WINDOW is a shackle popup window or not."
|
||||
(and narf-popup-windows
|
||||
(-any? (lambda (w)
|
||||
(if (window-live-p w) t (narf--popup-remove w) nil))
|
||||
|
@ -160,11 +161,13 @@
|
|||
t)))
|
||||
|
||||
(defun narf/popup-buffer (buffer &optional plist)
|
||||
"Display BUFFER in a shackle popup."
|
||||
(let ((buffer-name (if (stringp buffer) buffer (buffer-name buffer))))
|
||||
(shackle-display-buffer (get-buffer-create buffer-name)
|
||||
nil (or plist (shackle-match buffer-name)))))
|
||||
|
||||
(defun narf/popup-close (&optional window dont-kill dont-close-all)
|
||||
"Find and close the currently active popup (if available)."
|
||||
(interactive)
|
||||
(when (not window)
|
||||
(if (narf/popup-p (selected-window))
|
||||
|
@ -186,26 +189,29 @@
|
|||
(delete-window window)))
|
||||
|
||||
(defun narf-popup-close-all (&optional dont-kill-buffers)
|
||||
"Closes all popup windows (and kills the buffers if DONT-KILL-BUFFERS is non-nil)"
|
||||
(interactive)
|
||||
(mapc (lambda (w) (narf/popup-close w dont-kill-buffers))
|
||||
narf-popup-windows)
|
||||
(setq narf-popup-windows nil))
|
||||
|
||||
;;;;;
|
||||
|
||||
;;
|
||||
(defun narf/popup-toggle ()
|
||||
"Toggles the popup window, reopening the last popup (if available)."
|
||||
(interactive)
|
||||
(if (narf/popup-p)
|
||||
(narf/popup-close t)
|
||||
(narf/popup-last-buffer)))
|
||||
|
||||
(defun narf/popup-last-buffer ()
|
||||
"Pop up the last popup buffer."
|
||||
(interactive)
|
||||
(if shackle-last-buffer
|
||||
(narf/popup-buffer shackle-last-buffer)
|
||||
(narf/popup-messages)))
|
||||
|
||||
(defun narf/popup-messages ()
|
||||
"Pop up the *Messages* buffer."
|
||||
(interactive)
|
||||
(narf/popup-buffer "*Messages*")
|
||||
(with-current-buffer "*Messages*"
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
(use-package workgroups2
|
||||
:when (display-graphic-p)
|
||||
:init
|
||||
(add-hook! after-init 'workgroups-mode)
|
||||
(setq-default
|
||||
wg-session-file (expand-file-name "wg-default" narf-temp-dir)
|
||||
wg-workgroup-directory (expand-file-name "workgroups" narf-temp-dir)
|
||||
|
@ -44,6 +43,8 @@
|
|||
(candidates . wg-workgroup-names)
|
||||
(action . narf/wg-helm-switch-to-workgroup)))
|
||||
|
||||
(add-hook! emacs-startup (workgroups-mode +1))
|
||||
:config
|
||||
(unless (file-exists-p wg-workgroup-directory)
|
||||
(mkdir wg-workgroup-directory))
|
||||
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
:group 'convenience
|
||||
:prefix 'narf-)
|
||||
|
||||
;; TODO Make these defcustom's
|
||||
|
||||
(defvar narf-leader-prefix "," "Prefix key for <leader> maps")
|
||||
(defvar narf-localleader-prefix "\\" "Prefix key for <localleader> maps")
|
||||
|
||||
|
|
|
@ -10,9 +10,6 @@
|
|||
:init
|
||||
(add-hook! markdown-mode 'narf|enable-hard-wrap)
|
||||
:config
|
||||
(add-hook! markdown-mode
|
||||
(exmap! "preview" 'narf/markdown-preview)
|
||||
(exmap! "export" 'narf:org-export))
|
||||
(map! (:map markdown-mode-map
|
||||
"<backspace>" nil
|
||||
"<M-left>" nil
|
||||
|
|
|
@ -48,11 +48,6 @@
|
|||
(when (evil-ex-p)
|
||||
(message "[Tmux] %s" command))))
|
||||
|
||||
;;;###autoload
|
||||
(defun narf/tmux-new-window ()
|
||||
(interactive)
|
||||
(tmux "tmux new-window" t))
|
||||
|
||||
;;;###autoload
|
||||
(defun narf/tmux-cd-to-here (&optional dir)
|
||||
(interactive)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue