Improve workgroup compatibility + fix invalid nlinum face bug on new-frame

This commit is contained in:
Henrik Lissner 2015-11-04 01:20:07 -05:00
parent d3a7fd08ed
commit 60ba39d709
3 changed files with 18 additions and 6 deletions

View file

@ -4,7 +4,9 @@
(use-package workgroups2
:when window-system
:init
(setq wg-session-file (expand-file-name "wg-default" narf-temp-dir)
(setq split-height-threshold 15
wg-session-file (expand-file-name "wg-default" narf-temp-dir)
wg-workgroup-directory (expand-file-name "workgroups" narf-temp-dir)
wg-first-wg-name "main"
wg-session-load-on-start t

View file

@ -57,7 +57,8 @@
(defun narf:workgroup-display ()
(interactive)
(when (wg-current-session t)
(message (wg-display-internal
(message "%s"
(wg-display-internal
(lambda (workgroup index)
(if (not workgroup) wg-nowg-string
(wg-element-display
@ -72,14 +73,16 @@
(interactive "<c>")
(if count
(wg-switch-to-workgroup-at-index (1- count))
(wg-switch-to-workgroup-left)))
(wg-switch-to-workgroup-left))
(narf:workgroup-display))
;;;###autoload (autoload 'narf:switch-to-workgroup-right "defuns-workgroup" nil t)
(evil-define-command narf:switch-to-workgroup-right (count)
(interactive "<c>")
(if count
(wg-switch-to-workgroup-at-index (1- count))
(wg-switch-to-workgroup-right)))
(wg-switch-to-workgroup-right))
(narf:workgroup-display))
;;;###autoload
(defun narf:switch-to-workgroup-at-index (index)

View file

@ -24,6 +24,13 @@
"M-t" 'helm-projectile-find-file
"A-`" 'narf-switch-to-iterm
"C-`" 'narf/popwin-toggle
"M-n" (λ (switch-to-buffer (generate-new-buffer "*new*")))
;; Disable nlinum to fix elusive "invalid face linum" bug
"M-N" (λ (let ((nlinum-p (and (featurep 'nlinum) global-nlinum-mode)))
(if nlinum-p (global-nlinum-mode -1))
(new-frame)
(if nlinum-p (global-nlinum-mode 1))))
;; Simpler window navigation
"C-j" 'evil-window-down
@ -149,8 +156,8 @@
:m "]e" 'narf/flycheck-next-error
:m "[e" 'narf/flycheck-previous-error
;; Switch workgroups
:n "]w" 'wg-switch-to-workgroup-right
:n "[w" 'wg-switch-to-workgroup-left
:n "]w" 'narf:switch-to-workgroup-right
:n "[w" 'narf:switch-to-workgroup-left
:m "gt" 'narf:switch-to-workgroup-right
:m "gT" 'narf:switch-to-workgroup-left