From c7db4e009624115e3cdc0b0f1b3a1653f5b0177d Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 15 Oct 2015 14:01:53 -0400 Subject: [PATCH] 0.4 bump; refactor + new plugins + level up emacsfu --- Cask | 13 +-- core/core-editor.el | 28 +----- core/core-evil.el | 58 +++++++++---- core/core-flycheck.el | 3 +- core/core-ui.el | 192 ++++++++++++++++++++++++------------------ core/core-vars.el | 3 - core/core.el | 48 ++++++++--- core/lib/defuns-ui.el | 2 +- init.el | 108 ++++++++++++------------ modules/module-cc.el | 8 +- modules/module-js.el | 2 +- modules/module-lb6.el | 2 +- 12 files changed, 259 insertions(+), 208 deletions(-) diff --git a/Cask b/Cask index 47f7e7146..75c52bf97 100644 --- a/Cask +++ b/Cask @@ -8,7 +8,6 @@ (depends-on "s") (depends-on "f") (depends-on "use-package") -(depends-on "popwin") (depends-on "help-fns+") (depends-on "esup") @@ -18,14 +17,19 @@ (depends-on "applescript-mode") ;; 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 "volatile-highlights") +(depends-on "nlinum") (depends-on "spaceline" :git "https://github.com/TheBB/spaceline") -(depends-on "yascroll") ;; Evil --- core/core-evil.el (depends-on "evil") (depends-on "evil-anzu") +(depends-on "evil-args") (depends-on "evil-commentary") (depends-on "evil-exchange") (depends-on "evil-iedit-state") @@ -48,9 +52,6 @@ (depends-on "expand-region") (depends-on "fancy-narrow") (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 "smart-forward") (depends-on "smartparens") diff --git a/core/core-editor.el b/core/core-editor.el index 86f3ee067..7a2bca8b4 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -107,6 +107,8 @@ enable multiple minor modes for the same regexp.") :defer t :diminish undo-tree-mode :config + (defalias 'redo #'undo-tree-redo) + (defalias 'undo #'undo-tree-undo) ;; 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) ;; (shut-up! ad-do-it)) @@ -138,32 +140,6 @@ enable multiple minor modes for the same regexp.") (use-package 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 smart-forward :commands (smart-up smart-down smart-left smart-right)) diff --git a/core/core-evil.el b/core/core-evil.el index 7376a06c2..ff15766cd 100644 --- a/core/core-evil.el +++ b/core/core-evil.el @@ -3,21 +3,27 @@ (use-package evil :init - ;; Speed up show-paren outside of normal mode (where my motions are minimal) - (add-hook! evil-normal-state-entry (setq show-paren-delay 0.075)) - (add-hook! evil-normal-state-exit (setq show-paren-delay 0)) - ;; Disable highlights on insert-mode - (add-hook! evil-insert-state-entry 'evil-ex-nohighlight) - ;; Prevents "matches )" messages in minibuffer - (add-hook! evil-insert-state-entry (setq-default blink-matching-paren t)) - (add-hook! evil-insert-state-exit (setq-default blink-matching-paren nil)) + ;; highlight matching delimiters where it's important + (defun show-paren-mode-off () (show-paren-mode -1)) + (add-hook! evil-insert-state-entry 'show-paren-mode) + (add-hook! evil-insert-state-exit 'show-paren-mode-off) + (add-hook! evil-visual-state-entry 'show-paren-mode) + (add-hook! evil-visual-state-exit 'show-paren-mode-off) + (add-hook! evil-motion-state-entry 'show-paren-mode) + (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 (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 - (setq evil-magic t - evil-want-C-u-scroll t ; enable C-u for scrolling + (setq evil-magic t + evil-want-C-u-scroll t ; enable C-u for scrolling 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-ex-search-vim-style-regexp t evil-ex-interactive-search-highlight 'selected-window @@ -67,7 +73,15 @@ "C-u" 'evil-delete-whole-line))) ;; 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 :diminish evil-commentary-mode @@ -115,9 +129,12 @@ evil-jumper-auto-save-interval 3600)) (use-package evil-matchit - :defer 1 - :commands (evilmi-jump-items global-evil-matchit-mode) - :config (global-evil-matchit-mode 1)) + :commands (evilmi-jump-items evilmi-text-object global-evil-matchit-mode) + :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 :defer 1 @@ -153,15 +170,24 @@ (use-package evil-snipe :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 (setq-default evil-snipe-smart-case t evil-snipe-repeat-keys nil ; using evil-space to repeat 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-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 (evil-snipe-mode 1) (evil-snipe-override-mode 1)) diff --git a/core/core-flycheck.el b/core/core-flycheck.el index 5c29a405b..3ed8c9dc2 100644 --- a/core/core-flycheck.el +++ b/core/core-flycheck.el @@ -2,8 +2,7 @@ ;; Related to: lib/defuns-flycheck.el (use-package flycheck - :functions (flycheck-buffer) - :commands (flycheck-mode flycheck-list-errors) + :commands (flycheck-mode flycheck-list-errors flycheck-buffer) :init (setq flycheck-indication-mode nil ;; Removed checks on idle/change for snappiness diff --git a/core/core-ui.el b/core/core-ui.el index 252922163..f889bd09d 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -2,13 +2,12 @@ ;; see lib/ui-defuns.el (when window-system - (fringe-mode '(2 . 3)) (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 (setq show-paren-delay 0.075) -(show-paren-mode 1) (global-hl-line-mode 1) ; do highlight line (blink-cursor-mode 1) ; do blink cursor @@ -20,7 +19,6 @@ (setq-default blink-matching-paren nil - line-spacing 1 ;; Multiple cursors across buffers cause a strange redraw delay for ;; some things, like auto-complete or evil-mode's cursor color ;; switching. @@ -33,56 +31,62 @@ redisplay-dont-pause t indicate-buffer-boundaries 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 :config + (setq popwin:popup-window-height 25) (mapc (lambda (rule) (push rule popwin:special-display-config)) '(("*quickrun*" :position bottom :height 15) ("*scratch*" :position bottom :height 20 :stick t :dedicated 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) ("*eshell*" :position left :width 80 :stick t :dedicated t) ("*Apropos*" :position bottom :height 40 :stick t :dedicated t) ("*Backtrace*" :position bottom :height 15 :stick t))) (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 :commands fci-mode :init @@ -91,6 +95,23 @@ :config (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 :preface (defvar narf--hl-nlinum-overlay nil) @@ -152,7 +173,7 @@ (use-package spaceline-segments :config (setq-default - powerline-default-separator 'wave + powerline-default-separator nil powerline-height 18) ;; Modeline cache @@ -171,32 +192,34 @@ (if (powerline-selected-window-active) 'mode-line-buffer-file 'mode-line-inactive)))) - (concat (if buffer-file-name - (concat (propertize - (let* ((max-length (/ (window-width) 2)) - (project-path (let ((p (narf/project-root))) - (if (string-match "/+\\'" p) - (replace-match "" t t p) - p))) - (path (f-dirname (f-relative buffer-file-truename (f-dirname project-path)))) - (path-len (length path))) - (if (> path-len max-length) - (concat "…" (replace-regexp-in-string - "^.*?/" "/" - (substring path (- path-len max-length) path-len))) - path)) - 'face (if (powerline-selected-window-active) - 'mode-line-buffer-dir - 'mode-line-inactive) - ) - buffer - (if (and buffer-file-name (buffer-modified-p)) - (propertize "%+" 'face 'mode-line-is-modified))) - buffer) - " ")) - ;; Causes right side of this segment to be square - :face line-face - :tight-right t) + (if buffer-file-name + (concat (propertize + (or narf--spaceline-file-path + (setq narf--spaceline-file-path + (let* ((max-length (/ (window-width) 2)) + (project-path (let ((p (narf/project-root))) + (if (string-match "/+\\'" p) + (replace-match "" t t p) + p))) + (path (f-dirname (f-relative buffer-file-truename (f-dirname project-path)))) + (path-len (length path))) + (if (> path-len max-length) + (concat "…" (replace-regexp-in-string + "^.*?/" "/" + (substring path (- path-len max-length) path-len))) + path)))) + 'face (if (powerline-selected-window-active) + 'mode-line-buffer-dir + 'mode-line-inactive)) + buffer + (when buffer-file-name + (propertize + (concat + (when (buffer-modified-p) "[+]") + (when buffer-read-only "[RO]") + (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 "The project name." @@ -210,7 +233,8 @@ (if (string-match "\\(dos\\|unix\\|mac\\)" buf-coding) (match-string 1 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 "A more vim-like buffer position." @@ -226,7 +250,6 @@ (format " %s %s%s " (char-to-string #xe0a0) vc (case (vc-state buffer-file-name) ('edited "+") ('conflict "!!!") (t ""))))) :when (and active vc-mode) - :face other-face :tight t) ;; Display version string @@ -247,33 +270,38 @@ (powerline-hud highlight-face default-face 1) :tight t) - (spaceline-define-segment narf-line-column - "The current line and column numbers." - "%l/%c") - - (spaceline-define-segment narf-evil-state - "The current evil state. Requires `evil-mode' to be enabled." - (concat (substring (evil-state-property evil-state :tag t) 2 3) " ") - :when (and active (bound-and-true-p evil-local-mode)) - :tight-right t) + (spaceline-define-segment narf-anzu + "Show the current match number and the total number of matches. Requires anzu +to be enabled." + (let ((here anzu--current-position) + (total anzu--total-matched)) + (when anzu--state + (cl-case anzu--state + (search (format "%s/%d%s" + (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 (spaceline-install ;; Left side - '((narf-buffer-path remote-host) + '((narf-anzu :face highlight-face) + (narf-buffer-path remote-host) narf-vc narf-buffer-project-name ((flycheck-error flycheck-warning flycheck-info) :when active)) ;; Right side - '(selection-info - anzu + '((selection-info :face highlight-face) narf-env-version narf-buffer-encoding-abbrev ((" " :tight t) - major-mode (minor-modes :separator " ") + major-mode (minor-modes :tight t :separator " ") process :when active) (global :when active) - (narf-line-column narf-buffer-position) + ("%l/%c" narf-buffer-position) + narf-hud ))) (provide 'core-ui) diff --git a/core/core-vars.el b/core/core-vars.el index de3ec3d2e..f7781b308 100644 --- a/core/core-vars.el +++ b/core/core-vars.el @@ -43,8 +43,5 @@ gets killed.") "A list of files that count as 'project files', which determine whether a 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) ;;; core-vars.el ends here diff --git a/core/core.el b/core/core.el index e47bb40a1..f6db2cb15 100644 --- a/core/core.el +++ b/core/core.el @@ -86,21 +86,41 @@ (make-directory path t))))) ;; Save history across sessions -(require 'savehist) -(setq savehist-file (concat narf-temp-dir "savehist") - savehist-additional-variables - '(kill-ring global-mark-ring search-ring regexp-search-ring extended-command-history)) -(savehist-mode 1) +(use-package savehist + :config + (setq savehist-file (concat narf-temp-dir "savehist") + savehist-save-minibuffer-history t + savehist-additional-variables + '(kill-ring search-ring regexp-search-ring)) + (savehist-mode 1) -(require 'recentf) -(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) + ;; text properties severely bloat the history so delete them (courtesy of PythonNut) + (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$" + "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 :defer t diff --git a/core/lib/defuns-ui.el b/core/lib/defuns-ui.el index 9a6e20601..ca21fe13b 100644 --- a/core/lib/defuns-ui.el +++ b/core/lib/defuns-ui.el @@ -20,7 +20,7 @@ ;;;###autoload (defun narf:toggle-big-mode () (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))) ;;;###autoload diff --git a/init.el b/init.el index 0a9163f48..2955eeb82 100644 --- a/init.el +++ b/init.el @@ -2,7 +2,7 @@ ;; ;; Author: Henrik Lissner ;; URL: https://github.com/hlissner/emacs.d -;; Version: 0.3.0 +;; Version: 0.4.0 ;; ;;; Are you pondering what I'm pondering, Pinky? ;; @@ -42,63 +42,65 @@ (defconst narf-debug-mode nil) (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 - (tool-bar-mode -1) ; no toolbar - (menu-bar-mode -1) ; no menubar +(scroll-bar-mode -1) ; no scrollbar +(tool-bar-mode -1) ; no toolbar +(menu-bar-mode -1) ; no menubar - (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)) - (load (concat user-emacs-directory "init-load-path.el")) - (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)) +(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)) +(load (concat user-emacs-directory "init-load-path.el")) +(load-theme (if window-system 'narf-dark 'wombat) t) - core-ui ; draw me like one of your French editors - 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 +(set-frame-parameter nil 'fullscreen 'fullboth) - 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 +(mapc 'require + `(core ; core/core.el + ,(cond (IS-MAC 'core-os-osx) + (IS-LINUX 'core-os-linux) + (IS-WINDOWS 'core-os-win32)) - my-bindings - my-commands - )) + core-ui ; draw me like one of your French editors + 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... diff --git a/modules/module-cc.el b/modules/module-cc.el index 69ba928c9..603d0b29f 100644 --- a/modules/module-cc.el +++ b/modules/module-cc.el @@ -31,7 +31,11 @@ (when IS-MAC (after! flycheck (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 ;; TODO Clang is *really* slow in larger projects, maybe replace it with @@ -41,8 +45,6 @@ (define-company-backend! objc-mode (c-headers xcode))) (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 (defadvice c-lineup-arglist (around c-lineup-arglist-indent-fix activate) diff --git a/modules/module-js.el b/modules/module-js.el index 6817ede18..f56b9ea56 100644 --- a/modules/module-js.el +++ b/modules/module-js.el @@ -65,7 +65,7 @@ (setq mode-name "JS2")) (define-minor-mode nodejs-mode - :lighter " Node" :keymap (make-sparse-keymap) + :lighter " node" :keymap (make-sparse-keymap) (add-yas-minor-mode! 'nodejs-mode)) (associate! nodejs-mode :files ("package.json") :in (js2-mode))) diff --git a/modules/module-lb6.el b/modules/module-lb6.el index 69abf026b..a8eccf8bc 100644 --- a/modules/module-lb6.el +++ b/modules/module-lb6.el @@ -3,7 +3,7 @@ (define-minor-mode lb6-mode "Launchbar development mode." :init-value nil - :lighter "lb6" + :lighter " lb6" :keymap (make-sparse-keymap) (add-yas-minor-mode! 'lb6-mode)) (associate! lb6-mode :match "\\.lb\\(action\\|ext\\)/.*$")