0.4 bump; refactor + new plugins + level up emacsfu

This commit is contained in:
Henrik Lissner 2015-10-15 14:01:53 -04:00
parent d073d61531
commit c7db4e0096
12 changed files with 259 additions and 208 deletions

13
Cask
View file

@ -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")

View file

@ -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))

View file

@ -3,21 +3,27 @@
(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
evil-ex-visual-char-range t ; column range for ex commands evil-ex-visual-char-range t ; column range for ex commands
evil-want-fine-undo nil evil-want-fine-undo nil
evil-want-visual-char-semi-exclusive t evil-want-visual-char-semi-exclusive t
evil-ex-search-vim-style-regexp t evil-ex-search-vim-style-regexp t
evil-ex-interactive-search-highlight 'selected-window evil-ex-interactive-search-highlight 'selected-window
@ -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))

View file

@ -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

View file

@ -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,32 +192,34 @@
(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
(let* ((max-length (/ (window-width) 2)) (or narf--spaceline-file-path
(project-path (let ((p (narf/project-root))) (setq narf--spaceline-file-path
(if (string-match "/+\\'" p) (let* ((max-length (/ (window-width) 2))
(replace-match "" t t p) (project-path (let ((p (narf/project-root)))
p))) (if (string-match "/+\\'" p)
(path (f-dirname (f-relative buffer-file-truename (f-dirname project-path)))) (replace-match "" t t p)
(path-len (length path))) p)))
(if (> path-len max-length) (path (f-dirname (f-relative buffer-file-truename (f-dirname project-path))))
(concat "" (replace-regexp-in-string (path-len (length path)))
"^.*?/" "/" (if (> path-len max-length)
(substring path (- path-len max-length) path-len))) (concat "" (replace-regexp-in-string
path)) "^.*?/" "/"
'face (if (powerline-selected-window-active) (substring path (- path-len max-length) path-len)))
'mode-line-buffer-dir path))))
'mode-line-inactive) 'face (if (powerline-selected-window-active)
) 'mode-line-buffer-dir
buffer 'mode-line-inactive))
(if (and buffer-file-name (buffer-modified-p)) buffer
(propertize "%+" 'face 'mode-line-is-modified))) (when buffer-file-name
buffer) (propertize
" ")) (concat
;; Causes right side of this segment to be square (when (buffer-modified-p) "[+]")
:face line-face (when buffer-read-only "[RO]")
:tight-right t) (unless (file-exists-p buffer-file-name) "[!]"))
'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)

View file

@ -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

View file

@ -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
savehist-additional-variables (setq savehist-file (concat narf-temp-dir "savehist")
'(kill-ring global-mark-ring search-ring regexp-search-ring extended-command-history)) savehist-save-minibuffer-history t
(savehist-mode 1) savehist-additional-variables
'(kill-ring search-ring regexp-search-ring))
(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 ()
recentf-exclude '("/tmp/" "/ssh:" "\\.?ido\\.last$" "\\.revive$" "/TAGS$" (mapc (lambda (list)
"emacs\\.d/private/cache/.+" "emacs\\.d/workgroups/.+$" "wg-default" (with-demoted-errors
"/company-statistics-cache.el$") (when (boundp list)
recentf-max-menu-items 0 (set list (mapcar #'substring-no-properties (eval list))))))
recentf-max-saved-items 250 '(kill-ring
recentf-auto-cleanup 600) minibuffer-history
(recentf-mode 1) 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$"
"emacs\\.d/private/cache/.+" "emacs\\.d/workgroups/.+$" "wg-default"
"/company-statistics-cache.el$")
recentf-max-menu-items 0
recentf-max-saved-items 250
recentf-auto-cleanup 600)
(recentf-mode 1))
(use-package saveplace (use-package saveplace
:defer t :defer t

View file

@ -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

108
init.el
View file

@ -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,63 +42,65 @@
(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
`(core ; core/core.el
,(cond (IS-MAC 'core-os-osx)
(IS-LINUX 'core-os-linux)
(IS-WINDOWS 'core-os-win32))
core-ui ; draw me like one of your French editors (set-frame-parameter nil 'fullscreen 'fullboth)
core-evil ; come to the dark side, we have cookies
core-editor ; filling the editor-shaped hole in the emacs OS
core-company ; for the lazy typist
core-yasnippet ; for the lazier typist
core-auto-insert ; for the laziest typist
core-flycheck ; remember that semicolon you forgot?
core-project ; whose project am I in?
core-vcs ; version control is a programmer's best friend
core-helm ; a search engine for life and love
core-quickrun ; run code, run.
core-workgroups ; cure Emacs alzheimers
module-cc ; c/c++/obj-c madness (mapc 'require
;; module-crystal ; ruby at the speed of c `(core ; core/core.el
module-csharp ; unity, .NET, and mono shenanigans ,(cond (IS-MAC 'core-os-osx)
module-data ; dbs 'n data formats (IS-LINUX 'core-os-linux)
module-elisp ; drowning in parentheses (IS-WINDOWS 'core-os-win32))
;; module-eshell ; eshell (on windows)
module-go ; a hipster dialect
module-java ; the poster child for carpal tunnel syndome
module-js ; alert("not java, javascript!")
module-lb6 ; LaunchBar 6 development
module-lua ; one-based indices? one-based indices.
module-markdown ; markdown
module-org ; for fearless [organized] leader
module-php ; making php less painful to work with
module-python ; beautiful is better than ugly
module-regex ; /^[^\s](meaning)[^\n]*/
module-ruby ; <3
module-rust ; Fe2O3
module-sh ; she sells Z-shells by the C shore
module-swift ; yay, emoji variables!
module-vim ; the confessional
module-web ; for the 2.0'er
my-bindings core-ui ; draw me like one of your French editors
my-commands core-evil ; come to the dark side, we have cookies
)) core-editor ; filling the editor-shaped hole in the emacs OS
core-company ; for the lazy typist
core-yasnippet ; for the lazier typist
core-auto-insert ; for the laziest typist
core-flycheck ; remember that semicolon you forgot?
core-project ; whose project am I in?
core-vcs ; version control is a programmer's best friend
core-helm ; a search engine for life and love
core-quickrun ; run code, run.
core-workgroups ; cure Emacs alzheimers
(narf-init)) module-cc ; c/c++/obj-c madness
;; module-crystal ; ruby at the speed of c
module-csharp ; unity, .NET, and mono shenanigans
module-data ; dbs 'n data formats
module-elisp ; drowning in parentheses
module-eshell ; eshell (on windows)
module-go ; a hipster dialect
module-java ; the poster child for carpal tunnel syndome
module-js ; alert("not java, javascript!")
module-lb6 ; LaunchBar 6 development
module-lua ; one-based indices? one-based indices.
module-markdown ; markdown
module-org ; for fearless [organized] leader
module-php ; making php less painful to work with
module-python ; beautiful is better than ugly
module-regex ; /^[^\s](meaning)[^\n]*/
module-ruby ; <3
module-rust ; Fe2O3
module-sh ; she sells Z-shells by the C shore
module-swift ; yay, emoji variables!
module-vim ; the confessional
module-web ; for the 2.0'er
my-bindings
my-commands
))
(narf-init)
;;; I think so Brain... ;;; I think so Brain...

View file

@ -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)

View file

@ -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)))

View file

@ -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\\)/.*$")