0.4 bump; refactor + new plugins + level up emacsfu
This commit is contained in:
parent
d073d61531
commit
c7db4e0096
12 changed files with 259 additions and 208 deletions
13
Cask
13
Cask
|
@ -8,7 +8,6 @@
|
||||||
(depends-on "s")
|
(depends-on "s")
|
||||||
(depends-on "f")
|
(depends-on "f")
|
||||||
(depends-on "use-package")
|
(depends-on "use-package")
|
||||||
(depends-on "popwin")
|
|
||||||
(depends-on "help-fns+")
|
(depends-on "help-fns+")
|
||||||
(depends-on "esup")
|
(depends-on "esup")
|
||||||
|
|
||||||
|
@ -18,14 +17,19 @@
|
||||||
(depends-on "applescript-mode")
|
(depends-on "applescript-mode")
|
||||||
|
|
||||||
;; UI --- core/core-ui.el
|
;; UI --- core/core-ui.el
|
||||||
(depends-on "nlinum")
|
(depends-on "hl-todo" :git "https://github.com/tarsius/hl-todo")
|
||||||
|
(depends-on "rainbow-delimiters")
|
||||||
|
(depends-on "rainbow-mode")
|
||||||
|
(depends-on "popwin")
|
||||||
(depends-on "fill-column-indicator")
|
(depends-on "fill-column-indicator")
|
||||||
|
(depends-on "volatile-highlights")
|
||||||
|
(depends-on "nlinum")
|
||||||
(depends-on "spaceline" :git "https://github.com/TheBB/spaceline")
|
(depends-on "spaceline" :git "https://github.com/TheBB/spaceline")
|
||||||
(depends-on "yascroll")
|
|
||||||
|
|
||||||
;; Evil --- core/core-evil.el
|
;; Evil --- core/core-evil.el
|
||||||
(depends-on "evil")
|
(depends-on "evil")
|
||||||
(depends-on "evil-anzu")
|
(depends-on "evil-anzu")
|
||||||
|
(depends-on "evil-args")
|
||||||
(depends-on "evil-commentary")
|
(depends-on "evil-commentary")
|
||||||
(depends-on "evil-exchange")
|
(depends-on "evil-exchange")
|
||||||
(depends-on "evil-iedit-state")
|
(depends-on "evil-iedit-state")
|
||||||
|
@ -48,9 +52,6 @@
|
||||||
(depends-on "expand-region")
|
(depends-on "expand-region")
|
||||||
(depends-on "fancy-narrow")
|
(depends-on "fancy-narrow")
|
||||||
(depends-on "goto-last-change")
|
(depends-on "goto-last-change")
|
||||||
(depends-on "hl-todo" :git "https://github.com/tarsius/hl-todo")
|
|
||||||
(depends-on "rainbow-delimiters")
|
|
||||||
(depends-on "rainbow-mode")
|
|
||||||
(depends-on "rotate-text" :git "https://github.com/debug-ito/rotate-text.el")
|
(depends-on "rotate-text" :git "https://github.com/debug-ito/rotate-text.el")
|
||||||
(depends-on "smart-forward")
|
(depends-on "smart-forward")
|
||||||
(depends-on "smartparens")
|
(depends-on "smartparens")
|
||||||
|
|
|
@ -107,6 +107,8 @@ enable multiple minor modes for the same regexp.")
|
||||||
:defer t
|
:defer t
|
||||||
:diminish undo-tree-mode
|
:diminish undo-tree-mode
|
||||||
:config
|
:config
|
||||||
|
(defalias 'redo #'undo-tree-redo)
|
||||||
|
(defalias 'undo #'undo-tree-undo)
|
||||||
;; Shut up undo-tree's constant complaining: http://youtu.be/Z6woIRLnbmE
|
;; Shut up undo-tree's constant complaining: http://youtu.be/Z6woIRLnbmE
|
||||||
;; (defadvice undo-tree-load-history-hook (around undo-tree-load-history-shut-up activate)
|
;; (defadvice undo-tree-load-history-hook (around undo-tree-load-history-shut-up activate)
|
||||||
;; (shut-up! ad-do-it))
|
;; (shut-up! ad-do-it))
|
||||||
|
@ -138,32 +140,6 @@ enable multiple minor modes for the same regexp.")
|
||||||
(use-package goto-last-change
|
(use-package goto-last-change
|
||||||
:commands goto-last-change)
|
:commands goto-last-change)
|
||||||
|
|
||||||
(use-package hl-todo
|
|
||||||
:commands hl-todo-mode
|
|
||||||
:init
|
|
||||||
(add-hook! prog-mode 'hl-todo-mode)
|
|
||||||
(defvar hl-todo-keyword-faces
|
|
||||||
'(("TODO" . "#cc9393")
|
|
||||||
("NOTE" . "#d0bf8f")
|
|
||||||
("FIXME" . "#cc9393"))))
|
|
||||||
|
|
||||||
(use-package hideshow
|
|
||||||
:commands (hs-minor-mode hs-toggle-hiding hs-already-hidden-p)
|
|
||||||
:diminish hs-minor-mode
|
|
||||||
:init
|
|
||||||
(after! evil
|
|
||||||
(defun narf-load-hs-minor-mode ()
|
|
||||||
(advice-remove 'evil-toggle-fold 'narf-load-hs-minor-mode)
|
|
||||||
(hs-minor-mode 1))
|
|
||||||
(advice-add 'evil-toggle-fold :before 'narf-load-hs-minor-mode)))
|
|
||||||
|
|
||||||
(use-package rainbow-delimiters
|
|
||||||
:commands rainbow-delimiters-mode
|
|
||||||
:init (add-hook! (emacs-lisp-mode js2-mode scss-mode) 'rainbow-delimiters-mode)
|
|
||||||
:config (setq rainbow-delimiters-outermost-only-face-count 1))
|
|
||||||
|
|
||||||
(use-package rainbow-mode :defer t)
|
|
||||||
|
|
||||||
(use-package rotate-text :commands (rotate-word-at-point rotate-region))
|
(use-package rotate-text :commands (rotate-word-at-point rotate-region))
|
||||||
|
|
||||||
(use-package smart-forward :commands (smart-up smart-down smart-left smart-right))
|
(use-package smart-forward :commands (smart-up smart-down smart-left smart-right))
|
||||||
|
|
|
@ -3,16 +3,22 @@
|
||||||
|
|
||||||
(use-package evil
|
(use-package evil
|
||||||
:init
|
:init
|
||||||
;; Speed up show-paren outside of normal mode (where my motions are minimal)
|
;; highlight matching delimiters where it's important
|
||||||
(add-hook! evil-normal-state-entry (setq show-paren-delay 0.075))
|
(defun show-paren-mode-off () (show-paren-mode -1))
|
||||||
(add-hook! evil-normal-state-exit (setq show-paren-delay 0))
|
(add-hook! evil-insert-state-entry 'show-paren-mode)
|
||||||
;; Disable highlights on insert-mode
|
(add-hook! evil-insert-state-exit 'show-paren-mode-off)
|
||||||
(add-hook! evil-insert-state-entry 'evil-ex-nohighlight)
|
(add-hook! evil-visual-state-entry 'show-paren-mode)
|
||||||
;; Prevents "matches )" messages in minibuffer
|
(add-hook! evil-visual-state-exit 'show-paren-mode-off)
|
||||||
(add-hook! evil-insert-state-entry (setq-default blink-matching-paren t))
|
(add-hook! evil-motion-state-entry 'show-paren-mode)
|
||||||
(add-hook! evil-insert-state-exit (setq-default blink-matching-paren nil))
|
(add-hook! evil-motion-state-exit 'show-paren-mode-off)
|
||||||
|
(add-hook! evil-operator-state-entry 'show-paren-mode)
|
||||||
|
(add-hook! evil-operator-state-exit 'show-paren-mode-off)
|
||||||
|
|
||||||
;; Always ensure evil-shift-width is consistent with tab-width
|
;; Always ensure evil-shift-width is consistent with tab-width
|
||||||
(add-hook! evil-local-mode (setq evil-shift-width tab-width))
|
(add-hook! evil-local-mode (setq evil-shift-width tab-width))
|
||||||
|
;; Disable highlights on insert-mode
|
||||||
|
(add-hook! evil-insert-state-entry 'evil-ex-nohighlight)
|
||||||
|
|
||||||
:config
|
:config
|
||||||
(setq evil-magic t
|
(setq evil-magic t
|
||||||
evil-want-C-u-scroll t ; enable C-u for scrolling
|
evil-want-C-u-scroll t ; enable C-u for scrolling
|
||||||
|
@ -67,7 +73,15 @@
|
||||||
"C-u" 'evil-delete-whole-line)))
|
"C-u" 'evil-delete-whole-line)))
|
||||||
|
|
||||||
;; evil plugins
|
;; evil plugins
|
||||||
(use-package evil-anzu)
|
(use-package evil-anzu
|
||||||
|
:config (setq anzu-cons-mode-line-p nil))
|
||||||
|
|
||||||
|
(use-package evil-args
|
||||||
|
:commands (evil-inner-arg evil-outer-arg evil-forward-arg evil-backward-arg evil-jump-out-args)
|
||||||
|
:init
|
||||||
|
(define-key evil-inner-text-objects-map "a" #'evil-inner-arg)
|
||||||
|
(define-key evil-outer-text-objects-map "a" #'evil-outer-arg)
|
||||||
|
(define-key evil-normal-state-map "K" #'evil-jump-out-args))
|
||||||
|
|
||||||
(use-package evil-commentary
|
(use-package evil-commentary
|
||||||
:diminish evil-commentary-mode
|
:diminish evil-commentary-mode
|
||||||
|
@ -115,9 +129,12 @@
|
||||||
evil-jumper-auto-save-interval 3600))
|
evil-jumper-auto-save-interval 3600))
|
||||||
|
|
||||||
(use-package evil-matchit
|
(use-package evil-matchit
|
||||||
:defer 1
|
:commands (evilmi-jump-items evilmi-text-object global-evil-matchit-mode)
|
||||||
:commands (evilmi-jump-items global-evil-matchit-mode)
|
:config (global-evil-matchit-mode 1)
|
||||||
:config (global-evil-matchit-mode 1))
|
:init
|
||||||
|
(define-key evil-normal-state-map "%" #'evilmi-jump-items)
|
||||||
|
(define-key evil-inner-text-objects-map "%" #'evilmi-text-object)
|
||||||
|
(define-key evil-outer-text-objects-map "%" #'evilmi-text-object))
|
||||||
|
|
||||||
(use-package evil-easymotion
|
(use-package evil-easymotion
|
||||||
:defer 1
|
:defer 1
|
||||||
|
@ -153,15 +170,24 @@
|
||||||
|
|
||||||
(use-package evil-snipe
|
(use-package evil-snipe
|
||||||
:diminish evil-snipe-mode
|
:diminish evil-snipe-mode
|
||||||
|
:commands (evil-snipe-f evil-snipe-F evil-snipe-t evil-snipe-T evil-snipe-s evil-snipe-S evil-snipe-x evil-snipe-X)
|
||||||
:init
|
:init
|
||||||
(setq-default
|
(setq-default
|
||||||
evil-snipe-smart-case t
|
evil-snipe-smart-case t
|
||||||
evil-snipe-repeat-keys nil ; using evil-space to repeat
|
evil-snipe-repeat-keys nil ; using evil-space to repeat
|
||||||
evil-snipe-scope 'line
|
evil-snipe-scope 'line
|
||||||
evil-snipe-repeat-scope 'buffer
|
evil-snipe-repeat-scope 'visible
|
||||||
evil-snipe-override-evil-repeat-keys nil ; causes problems with remapped ;
|
evil-snipe-override-evil-repeat-keys nil ; causes problems with remapped ;
|
||||||
evil-snipe-symbol-groups '((?\[ "[[{(]")
|
evil-snipe-symbol-groups '((?\[ "[[{(]")
|
||||||
(?\] "[]})]")))
|
(?\] "[]})]")))
|
||||||
|
(bind! :m "f" 'evil-snipe-f
|
||||||
|
:m "F" 'evil-snipe-F
|
||||||
|
:m "t" 'evil-snipe-t
|
||||||
|
:m "T" 'evil-snipe-T
|
||||||
|
:m "s" 'evil-snipe-s
|
||||||
|
:m "S" 'evil-snipe-S
|
||||||
|
:o "x" 'evil-snipe-x
|
||||||
|
:o "X" 'evil-snipe-X)
|
||||||
:config
|
:config
|
||||||
(evil-snipe-mode 1)
|
(evil-snipe-mode 1)
|
||||||
(evil-snipe-override-mode 1))
|
(evil-snipe-override-mode 1))
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
;; Related to: lib/defuns-flycheck.el
|
;; Related to: lib/defuns-flycheck.el
|
||||||
|
|
||||||
(use-package flycheck
|
(use-package flycheck
|
||||||
:functions (flycheck-buffer)
|
:commands (flycheck-mode flycheck-list-errors flycheck-buffer)
|
||||||
:commands (flycheck-mode flycheck-list-errors)
|
|
||||||
:init
|
:init
|
||||||
(setq flycheck-indication-mode nil
|
(setq flycheck-indication-mode nil
|
||||||
;; Removed checks on idle/change for snappiness
|
;; Removed checks on idle/change for snappiness
|
||||||
|
|
162
core/core-ui.el
162
core/core-ui.el
|
@ -2,13 +2,12 @@
|
||||||
;; see lib/ui-defuns.el
|
;; see lib/ui-defuns.el
|
||||||
|
|
||||||
(when window-system
|
(when window-system
|
||||||
(fringe-mode '(2 . 3))
|
|
||||||
(set-frame-font narf-default-font)
|
(set-frame-font narf-default-font)
|
||||||
(setq frame-title-format '(buffer-file-name "%f" ("%b"))))
|
(setq frame-title-format '(buffer-file-name "%f" ("%b")))
|
||||||
|
(fringe-mode '(2 . 3)))
|
||||||
|
|
||||||
;; Highlight matching parens
|
;; Highlight matching parens
|
||||||
(setq show-paren-delay 0.075)
|
(setq show-paren-delay 0.075)
|
||||||
(show-paren-mode 1)
|
|
||||||
|
|
||||||
(global-hl-line-mode 1) ; do highlight line
|
(global-hl-line-mode 1) ; do highlight line
|
||||||
(blink-cursor-mode 1) ; do blink cursor
|
(blink-cursor-mode 1) ; do blink cursor
|
||||||
|
@ -20,7 +19,6 @@
|
||||||
|
|
||||||
(setq-default
|
(setq-default
|
||||||
blink-matching-paren nil
|
blink-matching-paren nil
|
||||||
line-spacing 1
|
|
||||||
;; Multiple cursors across buffers cause a strange redraw delay for
|
;; Multiple cursors across buffers cause a strange redraw delay for
|
||||||
;; some things, like auto-complete or evil-mode's cursor color
|
;; some things, like auto-complete or evil-mode's cursor color
|
||||||
;; switching.
|
;; switching.
|
||||||
|
@ -33,56 +31,62 @@
|
||||||
redisplay-dont-pause t
|
redisplay-dont-pause t
|
||||||
indicate-buffer-boundaries nil
|
indicate-buffer-boundaries nil
|
||||||
indicate-empty-lines nil
|
indicate-empty-lines nil
|
||||||
fringes-outside-margins t) ; fringes on the other side of line numbers
|
fringes-outside-margins t ; fringes on the other side of line numbers
|
||||||
|
|
||||||
|
resize-mini-windows t)
|
||||||
|
|
||||||
|
;; hl-line-mode breaks minibuffer in TTY
|
||||||
|
(add-hook! minibuffer-setup
|
||||||
|
(make-variable-buffer-local 'global-hl-line-mode)
|
||||||
|
(setq global-hl-line-mode nil))
|
||||||
|
|
||||||
|
;; Hide modeline in help windows
|
||||||
|
(add-hook! help-mode (setq-local mode-line-format nil))
|
||||||
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
(use-package hl-todo
|
||||||
|
:commands hl-todo-mode
|
||||||
|
:init
|
||||||
|
(add-hook! prog-mode 'hl-todo-mode)
|
||||||
|
(defvar hl-todo-keyword-faces
|
||||||
|
'(("TODO" . "#cc9393")
|
||||||
|
("NOTE" . "#d0bf8f")
|
||||||
|
("FIXME" . "#cc9393"))))
|
||||||
|
|
||||||
|
(use-package hideshow
|
||||||
|
:commands (hs-minor-mode hs-toggle-hiding hs-already-hidden-p)
|
||||||
|
:diminish hs-minor-mode
|
||||||
|
:init
|
||||||
|
(after! evil
|
||||||
|
(defun narf-load-hs-minor-mode ()
|
||||||
|
(advice-remove 'evil-toggle-fold 'narf-load-hs-minor-mode)
|
||||||
|
(hs-minor-mode 1))
|
||||||
|
(advice-add 'evil-toggle-fold :before 'narf-load-hs-minor-mode)))
|
||||||
|
|
||||||
|
(use-package rainbow-delimiters
|
||||||
|
:commands rainbow-delimiters-mode
|
||||||
|
:when (display-graphic-p)
|
||||||
|
:init (add-hook! (emacs-lisp-mode js2-mode scss-mode) 'rainbow-delimiters-mode)
|
||||||
|
:config (setq rainbow-delimiters-outermost-only-face-count 1))
|
||||||
|
|
||||||
|
(use-package rainbow-mode :defer t)
|
||||||
|
|
||||||
(use-package popwin
|
(use-package popwin
|
||||||
:config
|
:config
|
||||||
|
(setq popwin:popup-window-height 25)
|
||||||
(mapc (lambda (rule) (push rule popwin:special-display-config))
|
(mapc (lambda (rule) (push rule popwin:special-display-config))
|
||||||
'(("*quickrun*" :position bottom :height 15)
|
'(("*quickrun*" :position bottom :height 15)
|
||||||
("*scratch*" :position bottom :height 20 :stick t :dedicated t)
|
("*scratch*" :position bottom :height 20 :stick t :dedicated t)
|
||||||
("*helm-ag-edit*" :position bottom :height 20 :stick t)
|
("*helm-ag-edit*" :position bottom :height 20 :stick t)
|
||||||
|
(help-mode :position bottom :height 15 :stick t)
|
||||||
("^\\*[Hh]elm.*?\\*\\'" :regexp t :position bottom :height 15)
|
("^\\*[Hh]elm.*?\\*\\'" :regexp t :position bottom :height 15)
|
||||||
("*eshell*" :position left :width 80 :stick t :dedicated t)
|
("*eshell*" :position left :width 80 :stick t :dedicated t)
|
||||||
("*Apropos*" :position bottom :height 40 :stick t :dedicated t)
|
("*Apropos*" :position bottom :height 40 :stick t :dedicated t)
|
||||||
("*Backtrace*" :position bottom :height 15 :stick t)))
|
("*Backtrace*" :position bottom :height 15 :stick t)))
|
||||||
(popwin-mode 1))
|
(popwin-mode 1))
|
||||||
|
|
||||||
(use-package yascroll
|
|
||||||
:config
|
|
||||||
(add-hook! evil-insert-state-exit 'yascroll:update-scroll-bar)
|
|
||||||
|
|
||||||
(defun yascroll:show-scroll-bar ()
|
|
||||||
"Show scroll bar in BUFFER."
|
|
||||||
(interactive)
|
|
||||||
(yascroll:hide-scroll-bar)
|
|
||||||
(let ((window-lines (window-height))
|
|
||||||
(buffer-lines (count-lines (point-min) (point-max))))
|
|
||||||
(when (< window-lines buffer-lines)
|
|
||||||
(let* ((scroll-top (count-lines (point-min) (window-start)))
|
|
||||||
(thumb-window-line (yascroll:compute-thumb-window-line window-lines buffer-lines scroll-top))
|
|
||||||
(thumb-buffer-line (+ scroll-top thumb-window-line))
|
|
||||||
(thumb-size (yascroll:compute-thumb-size window-lines buffer-lines))
|
|
||||||
(make-thumb-overlay 'yascroll:make-thumb-overlay-right-fringe))
|
|
||||||
(when (<= thumb-buffer-line buffer-lines)
|
|
||||||
(yascroll:make-thumb-overlays make-thumb-overlay
|
|
||||||
thumb-window-line
|
|
||||||
thumb-size))))))
|
|
||||||
|
|
||||||
(defun yascroll:compute-thumb-size (window-lines buffer-lines)
|
|
||||||
"Return the proper size (height) of scroll bar thumb."
|
|
||||||
(let ((window-lines (* window-lines 0.93)))
|
|
||||||
(if (zerop buffer-lines)
|
|
||||||
1
|
|
||||||
(max 1 (floor (* (/ window-lines buffer-lines) window-lines))))))
|
|
||||||
|
|
||||||
(setq yascroll:scroll-bar 'right-fringe
|
|
||||||
yascroll:delay-to-hide nil)
|
|
||||||
(add-to-list 'yascroll:enabled-window-systems 'mac)
|
|
||||||
(defun yascroll:before-change (beg end))
|
|
||||||
(global-yascroll-bar-mode 1))
|
|
||||||
|
|
||||||
(use-package fill-column-indicator
|
(use-package fill-column-indicator
|
||||||
:commands fci-mode
|
:commands fci-mode
|
||||||
:init
|
:init
|
||||||
|
@ -91,6 +95,23 @@
|
||||||
:config
|
:config
|
||||||
(setq fci-rule-color "#2b303f"))
|
(setq fci-rule-color "#2b303f"))
|
||||||
|
|
||||||
|
(use-package volatile-highlights
|
||||||
|
:diminish volatile-highlights-mode
|
||||||
|
:config
|
||||||
|
(vhl/define-extension 'my-evil-highlights
|
||||||
|
'evil-yank
|
||||||
|
'evil-paste-pop-proxy
|
||||||
|
'evil-paste-pop-next
|
||||||
|
'evil-paste-after
|
||||||
|
'evil-paste-before)
|
||||||
|
(vhl/install-extension 'my-evil-highlights)
|
||||||
|
|
||||||
|
(vhl/define-extension 'my-undo-tree-highlights
|
||||||
|
'undo-tree-undo
|
||||||
|
'undo-tree-redo)
|
||||||
|
(vhl/install-extension 'my-undo-tree-highlights)
|
||||||
|
(volatile-highlights-mode t))
|
||||||
|
|
||||||
(use-package nlinum ; line numbers
|
(use-package nlinum ; line numbers
|
||||||
:preface
|
:preface
|
||||||
(defvar narf--hl-nlinum-overlay nil)
|
(defvar narf--hl-nlinum-overlay nil)
|
||||||
|
@ -152,7 +173,7 @@
|
||||||
(use-package spaceline-segments
|
(use-package spaceline-segments
|
||||||
:config
|
:config
|
||||||
(setq-default
|
(setq-default
|
||||||
powerline-default-separator 'wave
|
powerline-default-separator nil
|
||||||
powerline-height 18)
|
powerline-height 18)
|
||||||
|
|
||||||
;; Modeline cache
|
;; Modeline cache
|
||||||
|
@ -171,8 +192,10 @@
|
||||||
(if (powerline-selected-window-active)
|
(if (powerline-selected-window-active)
|
||||||
'mode-line-buffer-file
|
'mode-line-buffer-file
|
||||||
'mode-line-inactive))))
|
'mode-line-inactive))))
|
||||||
(concat (if buffer-file-name
|
(if buffer-file-name
|
||||||
(concat (propertize
|
(concat (propertize
|
||||||
|
(or narf--spaceline-file-path
|
||||||
|
(setq narf--spaceline-file-path
|
||||||
(let* ((max-length (/ (window-width) 2))
|
(let* ((max-length (/ (window-width) 2))
|
||||||
(project-path (let ((p (narf/project-root)))
|
(project-path (let ((p (narf/project-root)))
|
||||||
(if (string-match "/+\\'" p)
|
(if (string-match "/+\\'" p)
|
||||||
|
@ -184,19 +207,19 @@
|
||||||
(concat "…" (replace-regexp-in-string
|
(concat "…" (replace-regexp-in-string
|
||||||
"^.*?/" "/"
|
"^.*?/" "/"
|
||||||
(substring path (- path-len max-length) path-len)))
|
(substring path (- path-len max-length) path-len)))
|
||||||
path))
|
path))))
|
||||||
'face (if (powerline-selected-window-active)
|
'face (if (powerline-selected-window-active)
|
||||||
'mode-line-buffer-dir
|
'mode-line-buffer-dir
|
||||||
'mode-line-inactive)
|
'mode-line-inactive))
|
||||||
)
|
|
||||||
buffer
|
buffer
|
||||||
(if (and buffer-file-name (buffer-modified-p))
|
(when buffer-file-name
|
||||||
(propertize "%+" 'face 'mode-line-is-modified)))
|
(propertize
|
||||||
buffer)
|
(concat
|
||||||
" "))
|
(when (buffer-modified-p) "[+]")
|
||||||
;; Causes right side of this segment to be square
|
(when buffer-read-only "[RO]")
|
||||||
:face line-face
|
(unless (file-exists-p buffer-file-name) "[!]"))
|
||||||
:tight-right t)
|
'face (if active 'mode-line-is-modified 'mode-line-inactive))))
|
||||||
|
buffer)))
|
||||||
|
|
||||||
(spaceline-define-segment narf-buffer-project-name
|
(spaceline-define-segment narf-buffer-project-name
|
||||||
"The project name."
|
"The project name."
|
||||||
|
@ -210,7 +233,8 @@
|
||||||
(if (string-match "\\(dos\\|unix\\|mac\\)" buf-coding)
|
(if (string-match "\\(dos\\|unix\\|mac\\)" buf-coding)
|
||||||
(match-string 1 buf-coding)
|
(match-string 1 buf-coding)
|
||||||
buf-coding))
|
buf-coding))
|
||||||
:when (not (string-match-p "unix" (symbol-name buffer-file-coding-system))))
|
:when (and buffer-file-name
|
||||||
|
(not (string-match-p "unix" (symbol-name buffer-file-coding-system)))))
|
||||||
|
|
||||||
(spaceline-define-segment narf-buffer-position
|
(spaceline-define-segment narf-buffer-position
|
||||||
"A more vim-like buffer position."
|
"A more vim-like buffer position."
|
||||||
|
@ -226,7 +250,6 @@
|
||||||
(format " %s %s%s " (char-to-string #xe0a0) vc
|
(format " %s %s%s " (char-to-string #xe0a0) vc
|
||||||
(case (vc-state buffer-file-name) ('edited "+") ('conflict "!!!") (t "")))))
|
(case (vc-state buffer-file-name) ('edited "+") ('conflict "!!!") (t "")))))
|
||||||
:when (and active vc-mode)
|
:when (and active vc-mode)
|
||||||
:face other-face
|
|
||||||
:tight t)
|
:tight t)
|
||||||
|
|
||||||
;; Display version string
|
;; Display version string
|
||||||
|
@ -247,33 +270,38 @@
|
||||||
(powerline-hud highlight-face default-face 1)
|
(powerline-hud highlight-face default-face 1)
|
||||||
:tight t)
|
:tight t)
|
||||||
|
|
||||||
(spaceline-define-segment narf-line-column
|
(spaceline-define-segment narf-anzu
|
||||||
"The current line and column numbers."
|
"Show the current match number and the total number of matches. Requires anzu
|
||||||
"%l/%c")
|
to be enabled."
|
||||||
|
(let ((here anzu--current-position)
|
||||||
(spaceline-define-segment narf-evil-state
|
(total anzu--total-matched))
|
||||||
"The current evil state. Requires `evil-mode' to be enabled."
|
(when anzu--state
|
||||||
(concat (substring (evil-state-property evil-state :tag t) 2 3) " ")
|
(cl-case anzu--state
|
||||||
:when (and active (bound-and-true-p evil-local-mode))
|
(search (format "%s/%d%s"
|
||||||
:tight-right t)
|
(anzu--format-here-position here total)
|
||||||
|
total (if anzu--overflow-p "+" "")))
|
||||||
|
(replace-query (format "%d replace" total))
|
||||||
|
(replace (format "%d/%d" here total)))))
|
||||||
|
:when (and active (bound-and-true-p anzu--state)))
|
||||||
|
|
||||||
;; Initialize modeline
|
;; Initialize modeline
|
||||||
(spaceline-install
|
(spaceline-install
|
||||||
;; Left side
|
;; Left side
|
||||||
'((narf-buffer-path remote-host)
|
'((narf-anzu :face highlight-face)
|
||||||
|
(narf-buffer-path remote-host)
|
||||||
narf-vc
|
narf-vc
|
||||||
narf-buffer-project-name
|
narf-buffer-project-name
|
||||||
((flycheck-error flycheck-warning flycheck-info) :when active))
|
((flycheck-error flycheck-warning flycheck-info) :when active))
|
||||||
;; Right side
|
;; Right side
|
||||||
'(selection-info
|
'((selection-info :face highlight-face)
|
||||||
anzu
|
|
||||||
narf-env-version
|
narf-env-version
|
||||||
narf-buffer-encoding-abbrev
|
narf-buffer-encoding-abbrev
|
||||||
((" " :tight t)
|
((" " :tight t)
|
||||||
major-mode (minor-modes :separator " ")
|
major-mode (minor-modes :tight t :separator " ")
|
||||||
process :when active)
|
process :when active)
|
||||||
(global :when active)
|
(global :when active)
|
||||||
(narf-line-column narf-buffer-position)
|
("%l/%c" narf-buffer-position)
|
||||||
|
narf-hud
|
||||||
)))
|
)))
|
||||||
|
|
||||||
(provide 'core-ui)
|
(provide 'core-ui)
|
||||||
|
|
|
@ -43,8 +43,5 @@ gets killed.")
|
||||||
"A list of files that count as 'project files', which determine whether a
|
"A list of files that count as 'project files', which determine whether a
|
||||||
folder is the root of a project or not.")
|
folder is the root of a project or not.")
|
||||||
|
|
||||||
(defcustom narf-big-font (font-spec :family "Ubuntu Mono" :size 18 :antialias t)
|
|
||||||
"Font to switch to in big mode")
|
|
||||||
|
|
||||||
(provide 'core-vars)
|
(provide 'core-vars)
|
||||||
;;; core-vars.el ends here
|
;;; core-vars.el ends here
|
||||||
|
|
34
core/core.el
34
core/core.el
|
@ -86,21 +86,41 @@
|
||||||
(make-directory path t)))))
|
(make-directory path t)))))
|
||||||
|
|
||||||
;; Save history across sessions
|
;; Save history across sessions
|
||||||
(require 'savehist)
|
(use-package savehist
|
||||||
(setq savehist-file (concat narf-temp-dir "savehist")
|
:config
|
||||||
|
(setq savehist-file (concat narf-temp-dir "savehist")
|
||||||
|
savehist-save-minibuffer-history t
|
||||||
savehist-additional-variables
|
savehist-additional-variables
|
||||||
'(kill-ring global-mark-ring search-ring regexp-search-ring extended-command-history))
|
'(kill-ring search-ring regexp-search-ring))
|
||||||
(savehist-mode 1)
|
(savehist-mode 1)
|
||||||
|
|
||||||
(require 'recentf)
|
;; text properties severely bloat the history so delete them (courtesy of PythonNut)
|
||||||
(setq recentf-save-file (concat narf-temp-dir "recentf")
|
(defun unpropertize-savehist ()
|
||||||
|
(mapc (lambda (list)
|
||||||
|
(with-demoted-errors
|
||||||
|
(when (boundp list)
|
||||||
|
(set list (mapcar #'substring-no-properties (eval list))))))
|
||||||
|
'(kill-ring
|
||||||
|
minibuffer-history
|
||||||
|
helm-grep-history
|
||||||
|
helm-ff-history
|
||||||
|
file-name-history
|
||||||
|
read-expression-history
|
||||||
|
extended-command-history
|
||||||
|
evil-ex-history)))
|
||||||
|
(add-hook 'kill-emacs-hook #'unpropertize-savehist)
|
||||||
|
(add-hook 'savehist-save-hook #'unpropertize-savehist))
|
||||||
|
|
||||||
|
(use-package recentf
|
||||||
|
:config
|
||||||
|
(setq recentf-save-file (concat narf-temp-dir "recentf")
|
||||||
recentf-exclude '("/tmp/" "/ssh:" "\\.?ido\\.last$" "\\.revive$" "/TAGS$"
|
recentf-exclude '("/tmp/" "/ssh:" "\\.?ido\\.last$" "\\.revive$" "/TAGS$"
|
||||||
"emacs\\.d/private/cache/.+" "emacs\\.d/workgroups/.+$" "wg-default"
|
"emacs\\.d/private/cache/.+" "emacs\\.d/workgroups/.+$" "wg-default"
|
||||||
"/company-statistics-cache.el$")
|
"/company-statistics-cache.el$")
|
||||||
recentf-max-menu-items 0
|
recentf-max-menu-items 0
|
||||||
recentf-max-saved-items 250
|
recentf-max-saved-items 250
|
||||||
recentf-auto-cleanup 600)
|
recentf-auto-cleanup 600)
|
||||||
(recentf-mode 1)
|
(recentf-mode 1))
|
||||||
|
|
||||||
(use-package saveplace
|
(use-package saveplace
|
||||||
:defer t
|
:defer t
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun narf:toggle-big-mode ()
|
(defun narf:toggle-big-mode ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(if narf--big-mode narf/default-font (narf/big-font))
|
(set-frame-font (if narf--big-mode narf-default-font narf-big-font))
|
||||||
(setq narf--big-mode (not narf--big-mode)))
|
(setq narf--big-mode (not narf--big-mode)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
|
28
init.el
28
init.el
|
@ -2,7 +2,7 @@
|
||||||
;;
|
;;
|
||||||
;; Author: Henrik Lissner <henrik@lissner.net>
|
;; Author: Henrik Lissner <henrik@lissner.net>
|
||||||
;; URL: https://github.com/hlissner/emacs.d
|
;; URL: https://github.com/hlissner/emacs.d
|
||||||
;; Version: 0.3.0
|
;; Version: 0.4.0
|
||||||
;;
|
;;
|
||||||
;;; Are you pondering what I'm pondering, Pinky?
|
;;; Are you pondering what I'm pondering, Pinky?
|
||||||
;;
|
;;
|
||||||
|
@ -42,18 +42,20 @@
|
||||||
|
|
||||||
(defconst narf-debug-mode nil)
|
(defconst narf-debug-mode nil)
|
||||||
(setq gc-cons-threshold 84857600) ; avoid garbage collection
|
(setq gc-cons-threshold 84857600) ; avoid garbage collection
|
||||||
|
(setq file-name-handler-alist nil) ; premature optimization weee!
|
||||||
|
|
||||||
(let (file-name-handler-alist) ; premature optimization weee!
|
(scroll-bar-mode -1) ; no scrollbar
|
||||||
(scroll-bar-mode -1) ; no scrollbar
|
(tool-bar-mode -1) ; no toolbar
|
||||||
(tool-bar-mode -1) ; no toolbar
|
(menu-bar-mode -1) ; no menubar
|
||||||
(menu-bar-mode -1) ; no menubar
|
|
||||||
|
|
||||||
(defconst narf-default-font (font-spec :family "terminus (ttf)" :size 12 :antialias nil))
|
(defconst narf-default-font (font-spec :family "terminus (ttf)" :size 12 :antialias nil))
|
||||||
(defconst narf-big-font (font-spec :family "Ubuntu Mono" :size 18 :antialias t))
|
(defconst narf-big-font (font-spec :family "Ubuntu Mono" :size 18 :antialias t))
|
||||||
(load (concat user-emacs-directory "init-load-path.el"))
|
(load (concat user-emacs-directory "init-load-path.el"))
|
||||||
(load-theme (if window-system 'narf-dark 'wombat) t)
|
(load-theme (if window-system 'narf-dark 'wombat) t)
|
||||||
(set-frame-parameter nil 'fullscreen 'fullboth)
|
|
||||||
(mapc 'require
|
(set-frame-parameter nil 'fullscreen 'fullboth)
|
||||||
|
|
||||||
|
(mapc 'require
|
||||||
`(core ; core/core.el
|
`(core ; core/core.el
|
||||||
,(cond (IS-MAC 'core-os-osx)
|
,(cond (IS-MAC 'core-os-osx)
|
||||||
(IS-LINUX 'core-os-linux)
|
(IS-LINUX 'core-os-linux)
|
||||||
|
@ -77,7 +79,7 @@
|
||||||
module-csharp ; unity, .NET, and mono shenanigans
|
module-csharp ; unity, .NET, and mono shenanigans
|
||||||
module-data ; dbs 'n data formats
|
module-data ; dbs 'n data formats
|
||||||
module-elisp ; drowning in parentheses
|
module-elisp ; drowning in parentheses
|
||||||
;; module-eshell ; eshell (on windows)
|
module-eshell ; eshell (on windows)
|
||||||
module-go ; a hipster dialect
|
module-go ; a hipster dialect
|
||||||
module-java ; the poster child for carpal tunnel syndome
|
module-java ; the poster child for carpal tunnel syndome
|
||||||
module-js ; alert("not java, javascript!")
|
module-js ; alert("not java, javascript!")
|
||||||
|
@ -99,6 +101,6 @@
|
||||||
my-commands
|
my-commands
|
||||||
))
|
))
|
||||||
|
|
||||||
(narf-init))
|
(narf-init)
|
||||||
|
|
||||||
;;; I think so Brain...
|
;;; I think so Brain...
|
||||||
|
|
|
@ -31,7 +31,11 @@
|
||||||
(when IS-MAC
|
(when IS-MAC
|
||||||
(after! flycheck
|
(after! flycheck
|
||||||
(setq-default flycheck-c/c++-clang-executable "clang++"
|
(setq-default flycheck-c/c++-clang-executable "clang++"
|
||||||
flycheck-clang-include-path '("/usr/local/include"))))
|
flycheck-clang-include-path '("/usr/local/include"))
|
||||||
|
|
||||||
|
(add-hook! c-mode (setq flycheck-clang-language-standard "C11"))
|
||||||
|
(add-hook! c++-mode (setq flycheck-clang-language-standard "c++11"
|
||||||
|
flycheck-clang-standard-library "libc++"))))
|
||||||
|
|
||||||
(after! company
|
(after! company
|
||||||
;; TODO Clang is *really* slow in larger projects, maybe replace it with
|
;; TODO Clang is *really* slow in larger projects, maybe replace it with
|
||||||
|
@ -41,8 +45,6 @@
|
||||||
(define-company-backend! objc-mode (c-headers xcode)))
|
(define-company-backend! objc-mode (c-headers xcode)))
|
||||||
|
|
||||||
(add-hook! c++-mode 'narf|init-c++-C11-highlights)
|
(add-hook! c++-mode 'narf|init-c++-C11-highlights)
|
||||||
(add-hook! c++-mode (setq flycheck-clang-language-standard "c++11"
|
|
||||||
flycheck-clang-standard-library "libc++"))
|
|
||||||
|
|
||||||
;; Fix enum and C++11 lambda indentation
|
;; Fix enum and C++11 lambda indentation
|
||||||
(defadvice c-lineup-arglist (around c-lineup-arglist-indent-fix activate)
|
(defadvice c-lineup-arglist (around c-lineup-arglist-indent-fix activate)
|
||||||
|
|
|
@ -65,7 +65,7 @@
|
||||||
(setq mode-name "JS2"))
|
(setq mode-name "JS2"))
|
||||||
|
|
||||||
(define-minor-mode nodejs-mode
|
(define-minor-mode nodejs-mode
|
||||||
:lighter " Node" :keymap (make-sparse-keymap)
|
:lighter " node" :keymap (make-sparse-keymap)
|
||||||
(add-yas-minor-mode! 'nodejs-mode))
|
(add-yas-minor-mode! 'nodejs-mode))
|
||||||
(associate! nodejs-mode :files ("package.json") :in (js2-mode)))
|
(associate! nodejs-mode :files ("package.json") :in (js2-mode)))
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
(define-minor-mode lb6-mode
|
(define-minor-mode lb6-mode
|
||||||
"Launchbar development mode."
|
"Launchbar development mode."
|
||||||
:init-value nil
|
:init-value nil
|
||||||
:lighter "lb6"
|
:lighter " lb6"
|
||||||
:keymap (make-sparse-keymap)
|
:keymap (make-sparse-keymap)
|
||||||
(add-yas-minor-mode! 'lb6-mode))
|
(add-yas-minor-mode! 'lb6-mode))
|
||||||
(associate! lb6-mode :match "\\.lb\\(action\\|ext\\)/.*$")
|
(associate! lb6-mode :match "\\.lb\\(action\\|ext\\)/.*$")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue