General cleanup; core-file-templates -> core-autoinsert

This commit is contained in:
Henrik Lissner 2016-05-12 22:11:43 -04:00
parent 5999c1d5a2
commit 70b4f0d188
10 changed files with 216 additions and 188 deletions

View file

@ -73,6 +73,11 @@
(setq narf-current-theme narf-default-theme (setq narf-current-theme narf-default-theme
narf-current-font narf-default-font) narf-current-font narf-default-font)
;; Here we a'go! ;; Here we a'go!
(mapc 'require packages))) (mapc 'require packages)
(when (display-graphic-p)
(require 'server)
(unless (server-running-p)
(server-start)))))
;;; bootstrap.el ends here ;;; bootstrap.el ends here

View file

@ -1,4 +1,4 @@
;;; core-file-templates.el ;;; core-autoinsert.el
(use-package autoinsert (use-package autoinsert
:after yasnippet :after yasnippet
@ -99,5 +99,5 @@
("\\.z?sh$" "__" sh-mode) ("\\.z?sh$" "__" sh-mode)
))) )))
(provide 'core-file-templates) (provide 'core-autoinsert)
;;; core-file-templates.el ends here ;;; core-autoinsert.el ends here

View file

@ -59,11 +59,13 @@ Examples:
(list func-or-forms))) (list func-or-forms)))
(forms '())) (forms '()))
(mapc (mapc
(lambda (f) (let ((func (cond ((symbolp f) `(quote ,f)) (lambda (f)
(t `(lambda (&rest _) ,@func-or-forms))))) (let ((func (cond ((symbolp f) `(quote ,f))
(mapc (t `(lambda (&rest _) ,@func-or-forms)))))
(lambda (h) (push `(add-hook ',(if quoted h (intern (format "%s-hook" h))) ,func) forms)) (mapc
(if (listp hook) hook (list hook))))) funcs) (lambda (h)
(push `(add-hook ',(if quoted h (intern (format "%s-hook" h))) ,func) forms))
(-list hook)))) funcs)
`(progn ,@forms))) `(progn ,@forms)))
(defmacro associate! (mode &rest rest) (defmacro associate! (mode &rest rest)

View file

@ -8,7 +8,7 @@
require-final-newline t require-final-newline t
delete-trailing-lines nil delete-trailing-lines nil
fill-column 90 fill-column 80
line-spacing 0 line-spacing 0
word-wrap t word-wrap t
truncate-lines t truncate-lines t
@ -55,8 +55,9 @@
(with-demoted-errors (with-demoted-errors
(when (boundp list) (when (boundp list)
(set list (mapcar #'substring-no-properties (eval list)))))) (set list (mapcar #'substring-no-properties (eval list))))))
'(kill-ring minibuffer-history helm-grep-history helm-ff-history file-name-history '(kill-ring minibuffer-history helm-grep-history helm-ff-history
read-expression-history extended-command-history evil-ex-history))) file-name-history read-expression-history extended-command-history
evil-ex-history)))
(add-hook 'kill-emacs-hook #'unpropertize-savehist) (add-hook 'kill-emacs-hook #'unpropertize-savehist)
(add-hook 'savehist-save-hook #'unpropertize-savehist) (add-hook 'savehist-save-hook #'unpropertize-savehist)
@ -64,8 +65,8 @@
(require 'recentf) (require 'recentf)
(setq recentf-save-file (concat narf-temp-dir "/recentf") (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/.+$"
"/company-statistics-cache.el$") "wg-default" "/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)
@ -75,9 +76,10 @@
(use-package editorconfig (use-package editorconfig
:config :config
(editorconfig-mode +1) (editorconfig-mode +1)
(associate! editorconfig-conf-mode :match "/\\.?editorconfig$")
;; So whitespace in tabs indentation mode ;; So whitespace in tabs indentation mode
(add-hook! 'editorconfig-custom-hooks (if indent-tabs-mode (whitespace-mode +1))) (add-hook! 'editorconfig-custom-hooks
(associate! editorconfig-conf-mode :match "/\\.?editorconfig$")) (if indent-tabs-mode (whitespace-mode +1))))
;; ;;
@ -145,7 +147,8 @@ enable multiple minor modes for the same regexp.")
(when (and (eolp) narf-electric-indent-words) (when (and (eolp) narf-electric-indent-words)
(save-excursion (save-excursion
(backward-word) (backward-word)
(looking-at-p (concat "\\<" (regexp-opt narf-electric-indent-words)))))) (looking-at-p
(concat "\\<" (regexp-opt narf-electric-indent-words))))))
electric-indent-functions) electric-indent-functions)
;; ;;
@ -219,8 +222,10 @@ enable multiple minor modes for the same regexp.")
(display-string (format " ... " (count-lines (overlay-start ov) (display-string (format " ... " (count-lines (overlay-start ov)
(overlay-end ov))))) (overlay-end ov)))))
(put-text-property 0 1 'display (put-text-property 0 1 'display
(list 'right-fringe 'hs-marker 'hs-fringe-face) marker-string) (list 'right-fringe 'hs-marker 'hs-fringe-face)
(put-text-property 0 (length display-string) 'face 'hs-face display-string) marker-string)
(put-text-property 0 (length display-string)
'face 'hs-face display-string)
(overlay-put ov 'before-string marker-string) (overlay-put ov 'before-string marker-string)
(overlay-put ov 'display display-string)))))) (overlay-put ov 'display display-string))))))
@ -255,7 +260,8 @@ enable multiple minor modes for the same regexp.")
:commands (rotate-text rotate-text-backward) :commands (rotate-text rotate-text-backward)
:config (push '("true" "false") rotate-text-words)) :config (push '("true" "false") rotate-text-words))
(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))
(use-package smartparens (use-package smartparens
:config :config
@ -281,8 +287,11 @@ enable multiple minor modes for the same regexp.")
(sp-pair "[" nil :post-handlers '(("| " " ")) (sp-pair "[" nil :post-handlers '(("| " " "))
:unless '(sp-point-before-word-p sp-point-before-same-p)) :unless '(sp-point-before-word-p sp-point-before-same-p))
(sp-local-pair 'css-mode "/*" "*/" :post-handlers '(("[d-3]||\n[i]" "RET") ("| " "SPC"))) (sp-local-pair
(sp-local-pair '(sh-mode markdown-mode) "`" "`" :unless '(sp-point-before-word-p sp-point-before-same-p)) 'css-mode "/*" "*/" :post-handlers '(("[d-3]||\n[i]" "RET") ("| " "SPC")))
(sp-local-pair
'(sh-mode markdown-mode) "`" "`"
:unless '(sp-point-before-word-p sp-point-before-same-p))
(sp-with-modes '(xml-mode nxml-mode php-mode) (sp-with-modes '(xml-mode nxml-mode php-mode)
(sp-local-pair "<!--" "-->" :post-handlers '(("| " "SPC"))))) (sp-local-pair "<!--" "-->" :post-handlers '(("| " "SPC")))))

View file

@ -92,7 +92,8 @@
;; Fix harmless (yet disruptive) error reporting w/ hidden buffers caused by ;; Fix harmless (yet disruptive) error reporting w/ hidden buffers caused by
;; workgroups killing windows ;; workgroups killing windows
;; TODO Delete timer on dead windows ;; TODO Delete timer on dead windows
(defadvice evil-ex-hl-do-update-highlight (around evil-ex-hidden-buffer-ignore-errors activate) (defadvice evil-ex-hl-do-update-highlight
(around evil-ex-hidden-buffer-ignore-errors activate)
(ignore-errors ad-do-it)) (ignore-errors ad-do-it))
;; Hide keystroke display while isearch is active ;; Hide keystroke display while isearch is active
@ -110,8 +111,10 @@
(def-repeat! evil-snipe-X evil-snipe-repeat evil-snipe-repeat-reverse)) (def-repeat! evil-snipe-X evil-snipe-repeat evil-snipe-repeat-reverse))
(after! evil-visualstar (after! evil-visualstar
(def-repeat! evil-visualstar/begin-search-forward evil-ex-search-next evil-ex-search-previous) (def-repeat! evil-visualstar/begin-search-forward
(def-repeat! evil-visualstar/begin-search-backward evil-ex-search-previous evil-ex-search-next)) evil-ex-search-next evil-ex-search-previous)
(def-repeat! evil-visualstar/begin-search-backward
evil-ex-search-previous evil-ex-search-next))
(def-repeat! evil-ex-search-next evil-ex-search-next evil-ex-search-previous) (def-repeat! evil-ex-search-next evil-ex-search-next evil-ex-search-previous)
(def-repeat! evil-ex-search-previous evil-ex-search-next evil-ex-search-previous) (def-repeat! evil-ex-search-previous evil-ex-search-next evil-ex-search-previous)

View file

@ -81,9 +81,12 @@
(global-eldoc-mode -1)) (global-eldoc-mode -1))
;; Highlight TODO/FIXME/NOTE tags ;; Highlight TODO/FIXME/NOTE tags
(defface narf-todo-face '((t (:inherit font-lock-warning-face))) "Face for TODOs") (defface narf-todo-face '((t (:inherit font-lock-warning-face)))
(defface narf-fixme-face '((t (:inherit font-lock-warning-face))) "Face for FIXMEs") "Face for TODOs")
(defface narf-note-face '((t (:inherit font-lock-warning-face))) "Face for NOTEs") (defface narf-fixme-face '((t (:inherit font-lock-warning-face)))
"Face for FIXMEs")
(defface narf-note-face '((t (:inherit font-lock-warning-face)))
"Face for NOTEs")
(add-hook! (prog-mode emacs-lisp-mode) (add-hook! (prog-mode emacs-lisp-mode)
(font-lock-add-keywords (font-lock-add-keywords
nil '(("\\<\\(TODO\\((.+)\\)?:?\\)" 1 'narf-todo-face prepend) nil '(("\\<\\(TODO\\((.+)\\)?:?\\)" 1 'narf-todo-face prepend)
@ -125,16 +128,16 @@
visual-fill-column-width fill-column)) visual-fill-column-width fill-column))
(use-package highlight-indentation (use-package highlight-indentation
:commands (highlight-indentation-mode highlight-indentation-current-column-mode) :commands (highlight-indentation-mode
highlight-indentation-current-column-mode)
:init :init
(add-hook! (nxml-mode yaml-mode json-mode scss-mode (add-hook! (nxml-mode yaml-mode json-mode scss-mode
c-mode-common ruby-mode python-mode lua-mode) c-mode-common ruby-mode python-mode lua-mode)
'highlight-indentation-mode) 'highlight-indentation-mode)
(after! editorconfig (after! editorconfig
(defun narf*hl-indent-guess-offset () (advice-add 'highlight-indentation-guess-offset
(string-to-int (gethash 'indent_size (editorconfig-get-properties)))) :override 'narf*hl-indent-guess-offset))
(advice-add 'highlight-indentation-guess-offset :override 'narf*hl-indent-guess-offset))
;; A long-winded method for ensuring whitespace is maintained (so that ;; A long-winded method for ensuring whitespace is maintained (so that
;; highlight-indentation-mode can display them consistently) ;; highlight-indentation-mode can display them consistently)
@ -160,17 +163,19 @@
(use-package rainbow-mode (use-package rainbow-mode
:commands (rainbow-mode) :commands (rainbow-mode)
:init :init
;; NOTE: hl-line-mode and rainbow-mode don't play well together ;; hl-line-mode and rainbow-mode don't play well together
(add-hook! (sass-mode scss-mode less-css-mode) '(rainbow-mode narf|hl-line-off))) (add-hook! (sass-mode scss-mode less-css-mode)
'(rainbow-mode narf|hl-line-off)))
(use-package nlinum (use-package nlinum
:commands nlinum-mode :commands nlinum-mode
:preface :preface
(defface linum-highlight-face '((t (:inherit linum))) "Face for line highlights") (setq linum-format "%3d ")
(defvar nlinum-format "%4d ")
(defvar narf--hl-nlinum-overlay nil) (defvar narf--hl-nlinum-overlay nil)
(defvar narf--hl-nlinum-line nil) (defvar narf--hl-nlinum-line nil)
(defvar nlinum-format "%4d ") (defface linum-highlight-face '((t (:inherit linum)))
(setq linum-format "%3d ") "Face for line highlights")
:init :init
(add-hook! (add-hook!
(markdown-mode prog-mode scss-mode web-mode conf-mode) (markdown-mode prog-mode scss-mode web-mode conf-mode)
@ -202,27 +207,28 @@
;; Custom modeline segments ;; Custom modeline segments
(spaceline-define-segment *buffer-path (spaceline-define-segment *buffer-path
(concat (when buffer-file-name (concat
(powerline-raw (when buffer-file-name
(f-dirname (powerline-raw
(let ((buffer-path (file-relative-name buffer-file-name (narf/project-root))) (f-dirname
(max-length (truncate (/ (window-body-width) 1.75)))) (let ((buffer-path (f-relative buffer-file-name (narf/project-root)))
(concat (projectile-project-name) "/" (max-length (truncate (/ (window-body-width) 1.75))))
(if (> (length buffer-path) max-length) (concat (projectile-project-name) "/"
(let ((path (reverse (split-string buffer-path "/" t))) (if (> (length buffer-path) max-length)
(output "")) (let ((path (reverse (split-string buffer-path "/" t)))
(when (and path (equal "" (car path))) (output ""))
(setq path (cdr path))) (when (and path (equal "" (car path)))
(while (and path (<= (length output) (- max-length 4))) (setq path (cdr path)))
(setq output (concat (car path) "/" output)) (while (and path (<= (length output) (- max-length 4)))
(setq path (cdr path))) (setq output (concat (car path) "/" output))
(when path (setq path (cdr path)))
(setq output (concat "../" output))) (when path
(when (string-suffix-p "/" output) (setq output (concat "../" output)))
(setq output (substring output 0 -1))) (when (string-suffix-p "/" output)
output) (setq output (substring output 0 -1)))
buffer-path)))) output)
(if active 'mode-line-buffer-path))) buffer-path))))
(if active 'mode-line-buffer-path)))
(powerline-raw "%b" (if active 'mode-line-buffer-file))) (powerline-raw "%b" (if active 'mode-line-buffer-file)))
:tight-right t) :tight-right t)
@ -257,7 +263,8 @@
"Version control info" "Version control info"
(when (and active vc-mode) (when (and active vc-mode)
(powerline-raw (powerline-raw
(substring vc-mode (+ 1 (length (symbol-name (vc-backend buffer-file-name))))) (substring
vc-mode (1+ (length (symbol-name (vc-backend buffer-file-name)))))
other-face)) other-face))
:tight-right t) :tight-right t)
@ -278,21 +285,23 @@ anzu to be enabled."
:tight t) :tight t)
(spaceline-define-segment *iedit (spaceline-define-segment *iedit
"Show the number of matches and what match you're on (or after). Requires iedit." "Show the number of matches and what match you're on (or after). Requires
iedit."
(when (bound-and-true-p iedit-mode) (when (bound-and-true-p iedit-mode)
(propertize (propertize
(let ((this-oc (iedit-find-current-occurrence-overlay)) (let ((this-oc (iedit-find-current-occurrence-overlay))
(length (or (ignore-errors (length iedit-occurrences-overlays)) 0))) (length (or (ignore-errors (length iedit-occurrences-overlays)) 0)))
(format " %s/%s " (format
(save-excursion " %s/%s "
(unless this-oc (save-excursion
(iedit-prev-occurrence) (unless this-oc
(setq this-oc (iedit-find-current-occurrence-overlay))) (iedit-prev-occurrence)
(if this-oc (setq this-oc (iedit-find-current-occurrence-overlay)))
;; NOTE: Not terribly reliable (if this-oc
(- length (-elem-index this-oc iedit-occurrences-overlays)) ;; NOTE: Not terribly reliable
"-")) (- length (-elem-index this-oc iedit-occurrences-overlays))
length)) "-"))
length))
'face (if active 'mode-line-count-face 'mode-line-inactive))) 'face (if active 'mode-line-count-face 'mode-line-inactive)))
:tight t) :tight t)
@ -390,18 +399,21 @@ anzu to be enabled."
narf--flycheck-cache) narf--flycheck-cache)
(and (setq narf--flycheck-err-cache flycheck-current-errors) (and (setq narf--flycheck-err-cache flycheck-current-errors)
(setq narf--flycheck-cache (setq narf--flycheck-cache
(let ((fe (narf--flycheck-count 'error)) (let ((fe (narf/-flycheck-count 'error))
(fw (narf--flycheck-count 'warning)) (fw (narf/-flycheck-count 'warning)))
;; (fi (narf--flycheck-count 'info))
)
(concat (concat
(if fe (propertize (format " ⚠%s " fe) 'face (if active 'spaceline-flycheck-error 'mode-line))) (if fe (propertize (format " ⚠%s " fe)
(if fw (propertize (format " ⚠%s " fw) 'face (if active 'spaceline-flycheck-warning 'mode-line))) 'face (if active
;; (if fi (propertize (format " ⚠%s " fi) 'face 'spaceline-flycheck-info)) 'spaceline-flycheck-error
)))))) 'mode-line)))
(if fw (propertize (format " ⚠%s " fw)
'face (if active
'spaceline-flycheck-warning
'mode-line)))))))))
:tight t) :tight t)
(defvar narf--mode-line-padding (pl/percent-xpm powerline-height 100 0 100 0 1 nil nil)) (defvar narf--mode-line-padding
(pl/percent-xpm powerline-height 100 0 100 0 1 nil nil))
(spaceline-define-segment *pad (spaceline-define-segment *pad
"Padding, to ensure the mode-line is `powerline-height' pixels tall" "Padding, to ensure the mode-line is `powerline-height' pixels tall"
narf--mode-line-padding narf--mode-line-padding

View file

@ -2,16 +2,16 @@
;; ;;
;;; Naming conventions: ;;; Naming conventions:
;; ;;
;; narf-... A public variable/constant or function ;; narf- A public variable/constant or function
;; narf--... An internal variable or function (non-interactive) ;; narf-- An internal variable or function (non-interactive)
;; narf/... An autoloaded interactive function ;; narf/ An autoloaded interactive function
;; narf:... An ex command ;; narf: An ex command
;; narf|... A hook ;; narf| A hook
;; narf*... An advising function ;; narf* An advising function
;; narf.... Custom prefix commands ;; narf. Custom prefix commands
;; ...! Macro ;; ! Macro
;; ;;
;; You will find all autoloaded function in {core,modules}/defuns/defuns-*.el ;; Autoloaded functions are in {core,modules}/defuns/defuns-*.el
;; ;;
;;; ;;;
@ -95,22 +95,25 @@
ignored when using `narf:next-real-buffer' and `narf:previous-real-buffer', and ignored when using `narf:next-real-buffer' and `narf:previous-real-buffer', and
killed by `narf/kill-unreal-buffers'. killed by `narf/kill-unreal-buffers'.
`narf:kill-this-buffer' will also gloss over these buffers when finding a new `narf/kill-real-buffer' will also gloss over these buffers when finding a new
buffer to display.") buffer to display.")
(defvar narf-ignore-buffers '("*Completions*" "*Compile-Log*" "*inferior-lisp*" (defvar narf-ignore-buffers '("*Completions*" "*Compile-Log*" "*inferior-lisp*"
"*Fuzzy Completions*" "*Apropos*" "*Help*" "*cvs*" "*Fuzzy Completions*" "*Apropos*" "*Help*" "*cvs*"
"*Buffer List*" "*Ibuffer*" "*esh command on file*" "*Buffer List*" "*Ibuffer*" "*NeoTree*" "
"*WoMan-Log*" "*compilation*" "*use-package*" *NeoTree*" "*esh command on file*" "*WoMan-Log*"
"*quickrun*" "*eclim: problems*" "*Flycheck errors*" "*compilation*" "*use-package*" "*quickrun*"
"*popwin-dummy*" "*NeoTree*" " *NeoTree*" "*eclim: problems*" "*Flycheck errors*"
"*popwin-dummy*"
;; Helm ;; Helm
"*helm*" "*helm recentf*" "*helm projectile*" "*helm imenu*" "*helm*" "*helm recentf*" "*helm projectile*"
"*helm company*" "*helm buffers*" "*Helm Css SCSS*" "*helm imenu*" "*helm company*" "*helm buffers*"
"*helm-ag*" "*helm-ag-edit*" "*Helm Swoop*" "*Helm Css SCSS*" "*helm-ag*" "*helm-ag-edit*"
"*helm M-x*" "*helm mini*" "*Helm Completions*" "*Helm Swoop*" "*helm M-x*" "*helm mini*"
"*Helm Find Files*" "*helm mu*" "*helm mu contacts*" "*Helm Completions*" "*Helm Find Files*"
"*helm-mode-describe-variable*" "*helm-mode-describe-function*" "*helm mu*" "*helm mu contacts*"
"*helm-mode-describe-variable*"
"*helm-mode-describe-function*"
;; Org ;; Org
"*Org todo*" "*Org Links*" "*Agenda Commands*") "*Org todo*" "*Org Links*" "*Agenda Commands*")
"List of buffer names to ignore when using `winner-undo', or `winner-redo'") "List of buffer names to ignore when using `winner-undo', or `winner-redo'")
@ -129,7 +132,7 @@ gets killed.")
"gulpfile.js" "Gruntfile.js" "bower.json" "composer.json" "Cargo.toml" "gulpfile.js" "Gruntfile.js" "bower.json" "composer.json" "Cargo.toml"
"mix.exs") "mix.exs")
"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.")
;; Fringe/margins ;; Fringe/margins
(defvar narf-fringe-size 6 "Default width to use for the fringes.") (defvar narf-fringe-size 6 "Default width to use for the fringes.")
@ -181,11 +184,6 @@ gets killed.")
"Prevent annoying \"Active processes exist\" query when you quit Emacs." "Prevent annoying \"Active processes exist\" query when you quit Emacs."
(cl-flet ((process-list ())) ad-do-it))) (cl-flet ((process-list ())) ad-do-it)))
(when (display-graphic-p)
(require 'server)
(unless (server-running-p)
(server-start)))
(defun display-startup-echo-area-message () (defun display-startup-echo-area-message ()
(message ":: Loaded in %s" (emacs-init-time))) (message ":: Loaded in %s" (emacs-init-time)))

140
init.el
View file

@ -6,35 +6,35 @@
;; ;;
;;; Are you pondering what I'm pondering, Pinky? ;;; Are you pondering what I'm pondering, Pinky?
;; ;;
;; ,,, !/:. ;; ,,, !/:.
;; /::\". !!::: ;; /::\". !!:::
;; :::::\". ," \:,:: ;; :::::\". ," \:,::
;; ::::::\ ". ,","\::. ;; ::::::\ ". ,","\::.
;; \:::::":\ "/""v' :' ;; \:::::":\ "/""v' :'
;; !::::\ ! \ \ __ ;; !::::\ ! \ \ __
;; "::::\ \ ! \.&&&&, ;; "::::\ \ ! \.&&&&,
;; ," __ ", cd,&&&&&&' ;; ," __ ", cd,&&&&&&'
;; \ ". "" / \&&&" _,--- ;; \ ". "" / \&&&" _,---
;; "",__\_ / _,:"::::: ;; "",__\_ / _,:":::::
;; _," ,"" ,-,__,/":,_ ,","::::::: ;; _," ,"" ,-,__,/":,_ ,",":::::::
;; _," ," `'' ::::,",__,,----,,__," /::::::::: ;; _," ," `'' ::::,",__,,----,,__," /:::::::::
;; ," ,".__, \:::," " /:::":::::/ ;; ," ,".__, \:::," " /:::":::::/
;; ," ,/"::::::\ >" (_-"/:::::: ;; ," ,/"::::::\ >" (_-"/::::::
;; / ,"_!:::::::/, ," _,,--, /::::::/ ;; / ,"_!:::::::/, ," _,,--, /::::::/
;; / "" _,"\:::::::' ! ," ){:::::/ ;; / "" _,"\:::::::' ! ," ){:::::/
;; ! _," \ "", \,"""-,____,"__,,,"_," _/ ;; ! _," \ "", \,"""-,____,"__,,,"_," _/
;; ""t" \\ \ "-,_(*)&&&&(*)," \ ." ;; ""t" \\ \ "-,_(*)&&&&(*)," \ ."
;; / \", ! , \ ! - ) ;; / \", ! , \ ! - )
;; ! \ "" ! !==!"-,__,' ;; ! \ "" ! !==!"-,__,'
;; ! \ """_""""`, ", /"_ ;; ! \ """_""""`, ", /"_
;; \ , .l /" " ", \! ,_/ ;; \ , .l /" " ", \! ,_/
;; ), \ / \ \/ ,, /! ! ;; ), \ / \ \/ ,, /! !
;; ,::\ \," \ ! \/ ! ! ;; ,::\ \," \ ! \/ ! !
;; _,::::" ) )\ ," ___ \ -,_, ,"",! ! ;; _,::::" ) )\ ," ___ \ -,_, ,"",! !
;; __,,,::::"" ," ,":::,-:::--:" __\_!__/_""-,_! ;; __,,,::::"" ," ,":::,-:::--:" __\_!__/_""-,_!
;; ,,:::""""""" ,:_,""__...._"""::::"" /:::::" "":::::: ;; ,,:::""""""" ,:_,""__...._"""::::"" /:::::" ""::::::
;; (:._ l::::::::::::\\/ "" "" ;; (:._ l::::::::::::\\/ "" ""
;; """"--,,,--- """" ;; """"--,,,--- """"
;; ;;
;; These mice are not part of GNU Emacs. ;; These mice are not part of GNU Emacs.
;; ;;
@ -57,53 +57,53 @@
(IS-WINDOWS 'core-os-win32)) (IS-WINDOWS 'core-os-win32))
;; The heart of NARF ;; The heart of NARF
core-popup ; taming sudden and inevitable windows core-popup ; taming sudden and inevitable windows
core-ui ; draw me like one of your French editors core-ui ; draw me like one of your French editors
core-evil ; come to the dark side, we have cookies core-evil ; come to the dark side, we have cookies
core-editor ; filling the editor-shaped hole in the emacs OS core-editor ; filling the editor-shaped hole in the emacs OS
core-company ; for the lazy typist core-company ; for the lazy typist
core-yasnippet ; for the lazier typist core-yasnippet ; for the lazier typist
core-file-templates ; for the laziest typist core-autoinsert ; for the laziest typist
core-flycheck ; get tazed for every semicolon you forget core-flycheck ; get tazed for every semicolon you forget
core-project ; whose project am I in? core-project ; whose project am I in?
core-vcs ; remember remember, that commit in November core-vcs ; remember remember, that commit in November
core-helm ; a search engine for life and love core-helm ; a search engine for life and love
core-workgroups ; cure Emacs alzheimers + tab emulation core-workgroups ; cure Emacs alzheimers + tab emulation
core-eval ; run code, run; debug too core-eval ; run code, run; debug too
;; Environments ;; Environments
module-apple ; Applescript, Swift, Launchbar, iOS, wallet syphons, etc. module-apple ; Applescript, Swift, Launchbar & other wallet syphons
module-cc ; C/C++/Obj-C madness module-cc ; C/C++/Obj-C madness
module-crystal ; ruby at the speed of c module-crystal ; ruby at the speed of c
module-csharp ; unity, .NET, and mono shenanigans module-csharp ; unity, .NET, and mono shenanigans
module-data ; config and data formats module-data ; config and data formats
module-go ; the hipster dialect module-go ; the hipster dialect
module-haskell ; a language that's lazier than I am module-haskell ; a language that's lazier than I am
module-java ; the poster child for carpal tunnel syndrome module-java ; the poster child for carpal tunnel syndrome
module-js ; all(hope(abandon(ye(who(enter(here)))))) module-js ; all(hope(abandon(ye(who(enter(here))))))
module-julia ; MATLAB, but fast module-julia ; MATLAB, but fast
module-latex ; for writing papers in Emacs module-latex ; for writing papers in Emacs
module-lisp ; drowning in parentheses module-lisp ; drowning in parentheses
module-lua ; one-based indices? one-based indices. module-lua ; one-based indices? one-based indices.
module-org ; for organized fearless leader module-org ; for organized fearless leader
module-php ; making php less painful to work with module-php ; making php less painful to work with
module-processing ; pretty prototypes module-processing ; pretty prototypes
module-python ; beautiful is better than ugly module-python ; beautiful is better than ugly
module-ruby ; 1.step do {|i| p "Ruby is #{i&1==0?'love':'life'}"} module-ruby ; 1.step do {|i| p "Ruby is #{i&1==0?'love':'life'}"}
module-rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap() module-rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
module-scala ; Java, but good module-scala ; Java, but good
module-sh ; she sells Z-shells by the C XOR module-sh ; she sells Z-shells by the C XOR
module-text ; writing docs for people to ignore module-text ; writing docs for people to ignore
module-web ; #big-bang::before { content: ""; } module-web ; #big-bang::before { content: ""; }
;; Experimental ;; Experimental
;;module-eshell ; for inferior OSes *cough*windows ;;module-eshell ; for inferior OSes *cough*windows
;; Extra libraries ;; Extra libraries
extra-demo ; allow me to demonstrate... extra-demo ; allow me to demonstrate...
extra-tags ; if you liked it you should've generated a tag for it extra-tags ; if you liked it you should've generated a tag for it
extra-tmux ; close the rift between GUI & terminal extra-tmux ; close the rift between GUI & terminal
extra-write ; Emacs as a word processor extra-write ; Emacs as a word processor
;; Customization ;; Customization
my-bindings my-bindings

View file

@ -2,23 +2,23 @@
(use-package cc-mode (use-package cc-mode
:commands (c-mode c++-mode objc-mode java-mode) :commands (c-mode c++-mode objc-mode java-mode)
:mode ("\\.mm" . objc-mode)
:init :init
(associate! objc-mode :match "\\.mm$")
(add-hook! c++-mode '(highlight-numbers-mode narf|init-c++-C11-highlights)) (add-hook! c++-mode '(highlight-numbers-mode narf|init-c++-C11-highlights))
(add-hook 'c-initialization-hook 'narf|init-c/c++-settings) (add-hook 'c-initialization-hook 'narf|init-c/c++-settings)
;; C++ header files ;; C++ header files
(push `(,(lambda () (and (f-ext? buffer-file-name "h") (push (cons (lambda () (and (f-ext? buffer-file-name "h")
(or (f-exists? (f-swap-ext buffer-file-name "cpp")) (or (f-exists? (f-swap-ext buffer-file-name "cpp"))
(awhen (car-safe (projectile-get-other-files (buffer-file-name) (projectile-current-project-files))) (awhen (car-safe (projectile-get-other-files (buffer-file-name) (projectile-current-project-files)))
(f-ext? it "cpp"))))) (f-ext? it "cpp")))))
. c++-mode) 'c++-mode)
magic-mode-alist) magic-mode-alist)
;; Obj-C ;; Obj-C
(push `(,(lambda () (and (f-ext? buffer-file-name "h") (push (cons (lambda () (and (f-ext? buffer-file-name "h")
(re-search-forward "@\\<interface\\>" magic-mode-regexp-match-limit t))) (re-search-forward "@\\<interface\\>" magic-mode-regexp-match-limit t)))
. objc-mode) 'objc-mode)
magic-mode-alist) magic-mode-alist)
:config :config
@ -55,7 +55,7 @@
(flycheck-irony-setup) (flycheck-irony-setup)
;; some c-mode dervied modes wrongfully trigger these hooks (like php-mode) ;; some c-mode dervied modes wrongfully trigger these hooks (like php-mode)
(add-hook! (c-mode c++-mode ojbc-mode) (add-hook! (c-mode c++-mode objc-mode)
(when (memq major-mode '(c-mode c++-mode objc-mode)) (when (memq major-mode '(c-mode c++-mode objc-mode))
(flycheck-mode +1) (flycheck-mode +1)
(irony-mode +1) (irony-mode +1)

View file

@ -6,7 +6,6 @@
:init :init
(add-hook! go-mode '(emr-initialize flycheck-mode go-eldoc-setup)) (add-hook! go-mode '(emr-initialize flycheck-mode go-eldoc-setup))
(add-hook! go-mode (add-hook 'before-save-hook 'gofmt-before-save)) (add-hook! go-mode (add-hook 'before-save-hook 'gofmt-before-save))
:config :config
(def-builder! go-mode "go build") (def-builder! go-mode "go build")
(def-company-backend! go-mode (go yasnippet)) (def-company-backend! go-mode (go yasnippet))
@ -15,7 +14,7 @@
:n "gd" 'godef-jump :n "gd" 'godef-jump
:n "gD" 'godef-describe :n "gD" 'godef-describe
(:localleader (:localleader
:n "p" 'helm-go-package :n "p" 'helm-go-package
:n "tr" 'narf:go-test-run-all :n "tr" 'narf:go-test-run-all
:n "ta" 'narf:go-test-run-all :n "ta" 'narf:go-test-run-all
:n "ts" 'narf:go-test-run-package)) :n "ts" 'narf:go-test-run-package))