Improve workgroups2 tab emulation

This commit is contained in:
Henrik Lissner 2015-12-29 23:37:43 -05:00
parent af9003e529
commit 54c2541777
4 changed files with 45 additions and 34 deletions

View file

@ -63,7 +63,21 @@ lib/defuns-workgroups.el.")
(advice-add 'wg-change-modeline :override 'ignore) (advice-add 'wg-change-modeline :override 'ignore)
;; Don't remember popup windows ;; Don't remember popup windows
(add-hook! kill-emacs 'narf-popup-close-all)) (add-hook! kill-emacs 'narf-popup-close-all)
;; This helps abstract some of the underlying functions away, just in case I want to
;; switch to a different package in the future, like persp-mode, eyebrowse or wconf.
(defalias 'narf/helm-tabs 'narf:helm-wg)
(defalias 'narf/close-window-or-tab 'narf/close-window-or-workgroup)
(defalias 'narf:switch-to-tab 'narf:switch-to-workgroup-at-index)
(defalias 'narf/tab-display 'narf/workgroup-display)
(defalias 'narf:tab-create 'narf:workgroup-new)
(defalias 'narf:tab-rename 'narf:workgroup-rename)
(defalias 'narf:kill-tab 'narf:workgroup-delete)
(defalias 'narf:kill-other-tabs 'narf:kill-other-workgroups)
(defalias 'narf:switch-to-tab-left 'wg-switch-to-workgroup-left)
(defalias 'narf:switch-to-tab-right 'wg-switch-to-workgroup-right)
(defalias 'narf:switch-to-tab-last 'wg-switch-to-previous-workgroup))
(provide 'core-workgroups) (provide 'core-workgroups)
;;; core-workgroups.el ends here ;;; core-workgroups.el ends here

View file

@ -155,7 +155,7 @@
(defun display-startup-echo-area-message () (defun display-startup-echo-area-message ()
(after! workgroups2 (after! workgroups2
(message "%sLoaded in %s" (narf/workgroup-display t t) (emacs-init-time)))) (message "%sLoaded in %s" (narf/tab-display t) (emacs-init-time))))
(require 'server) (require 'server)
(unless (server-running-p) (unless (server-running-p)

View file

@ -28,14 +28,14 @@
"<f9>" 'what-face "<f9>" 'what-face
"M-b" 'narf:build "M-b" 'narf:build
"M-t" 'narf:workgroup-new "M-t" 'narf:tab-create
"M-T" 'narf/workgroup-display "M-T" 'narf/tab-display
"A-`" 'os-switch-to-term "A-`" 'os-switch-to-term
"C-`" 'narf/popup-messages "C-`" 'narf/popup-messages
"C-~" 'rtog/toggle-repl "C-~" 'rtog/toggle-repl
"M-`" 'narf/popup-toggle "M-`" 'narf/popup-toggle
"M-w" 'narf/close-window-or-workgroup "M-w" 'narf/close-window-or-tab
"M-W" 'delete-frame "M-W" 'delete-frame
"M-n" 'narf/new-buffer "M-n" 'narf/new-buffer
"M-N" 'narf/new-frame "M-N" 'narf/new-frame
@ -57,15 +57,15 @@
:n "M-o" 'narf/ido-find-file :n "M-o" 'narf/ido-find-file
:n "M-O" 'narf/ido-find-project-file :n "M-O" 'narf/ido-find-project-file
:m "M-1" (λ! (narf:switch-to-workgroup-at-index 0)) :m "M-1" (λ! (narf:switch-to-tab 0))
:m "M-2" (λ! (narf:switch-to-workgroup-at-index 1)) :m "M-2" (λ! (narf:switch-to-tab 1))
:m "M-3" (λ! (narf:switch-to-workgroup-at-index 2)) :m "M-3" (λ! (narf:switch-to-tab 2))
:m "M-4" (λ! (narf:switch-to-workgroup-at-index 3)) :m "M-4" (λ! (narf:switch-to-tab 3))
:m "M-5" (λ! (narf:switch-to-workgroup-at-index 4)) :m "M-5" (λ! (narf:switch-to-tab 4))
:m "M-6" (λ! (narf:switch-to-workgroup-at-index 5)) :m "M-6" (λ! (narf:switch-to-tab 5))
:m "M-7" (λ! (narf:switch-to-workgroup-at-index 6)) :m "M-7" (λ! (narf:switch-to-tab 6))
:m "M-8" (λ! (narf:switch-to-workgroup-at-index 7)) :m "M-8" (λ! (narf:switch-to-tab 7))
:m "M-9" (λ! (narf:switch-to-workgroup-at-index 8)) :m "M-9" (λ! (narf:switch-to-tab 8))
(:when IS-MAC (:when IS-MAC
"<A-left>" 'backward-word "<A-left>" 'backward-word
@ -127,8 +127,8 @@
:n "r" 'narf/vcs-revert-hunk) :n "r" 'narf/vcs-revert-hunk)
:n "b" 'helm-bookmarks :n "b" 'helm-bookmarks
:n "w" 'narf/workgroup-display :n "w" 'narf/tab-display
:n "W" 'narf:helm-wg :n "W" 'narf/helm-tabs
:n "n" 'narf/neotree :n "n" 'narf/neotree
:nv "l" 'narf/nlinum-toggle :nv "l" 'narf/nlinum-toggle
@ -204,11 +204,11 @@
:m "[d" 'narf/vcs-prev-hunk :m "[d" 'narf/vcs-prev-hunk
:m "]e" 'narf/flycheck-next-error :m "]e" 'narf/flycheck-next-error
:m "[e" 'narf/flycheck-previous-error :m "[e" 'narf/flycheck-previous-error
;; Switch workgroups ;; Switch tabs
:n "]w" 'narf:switch-to-workgroup-right :n "]w" 'narf:switch-to-tab-right
:n "[w" 'narf:switch-to-workgroup-left :n "[w" 'narf:switch-to-tab-left
:m "gt" 'narf:switch-to-workgroup-right :m "gt" 'narf:switch-to-tab-right
:m "gT" 'narf:switch-to-workgroup-left :m "gT" 'narf:switch-to-tab-left
;; Increment/decrement number under cursor ;; Increment/decrement number under cursor
:n "g=" 'evil-numbers/inc-at-pt :n "g=" 'evil-numbers/inc-at-pt

View file

@ -70,19 +70,16 @@
(after! flycheck (after! flycheck
(exmap "er[rors]" (λ! (flycheck-buffer) (flycheck-list-errors)))) (exmap "er[rors]" (λ! (flycheck-buffer) (flycheck-list-errors))))
(after! workgroups2 (exmap "sl[oad]" 'narf:load-session)
(exmap "sl[oad]" 'narf:load-session) (exmap "ss[ave]" 'narf:save-session)
(exmap "ss[ave]" 'narf:save-session) (exmap "tabs" 'narf/tab-display)
(exmap "wg" 'narf/workgroup-display) (exmap "tabn[ew]" 'narf:tab-create)
(exmap "tab" 'narf/workgroup-display) (exmap "tabr[ename]" 'narf:tab-rename)
(exmap "tabn[ew]" 'narf:workgroup-new) (exmap "tabc[lose]" 'narf:kill-tab)
(exmap "tabr[ename]" 'narf:workgroup-rename) (exmap "tabc[lose]o" 'narf:kill-other-tabs)
(exmap "tabn[ext]" 'wg-switch-to-workgroup-right) (exmap "tabn[ext]" 'narf:switch-to-tab-right)
(exmap "tabp[rev]" 'wg-switch-to-workgroup-left) (exmap "tabp[rev]" 'narf:switch-to-tab-left)
(exmap "tabl[ast]" 'wg-switch-to-previous-workgroup) (exmap "tabl[ast]" 'narf:switch-to-tab-last)
(exmap "tabq[uit]" 'narf:workgroup-delete)
(exmap "k[ill]w" 'wg-kill-workgroup)
(exmap "k[ill]ow" 'narf:kill-other-workgroups))
(provide 'my-commands) (provide 'my-commands)
;;; my-commands.el ends here ;;; my-commands.el ends here