Massive refactor. Refactor all the things
This commit is contained in:
parent
03514fc09d
commit
f234be68a4
56 changed files with 792 additions and 831 deletions
23
Cask
23
Cask
|
@ -29,7 +29,6 @@
|
|||
(depends-on "visual-fill-column")
|
||||
(depends-on "highlight-indentation" :git "https://github.com/localredhead/Highlight-Indentation-for-Emacs")
|
||||
(depends-on "highlight-numbers")
|
||||
(depends-on "imenu-list")
|
||||
(depends-on "rainbow-delimiters")
|
||||
(depends-on "rainbow-mode")
|
||||
(depends-on "nlinum")
|
||||
|
@ -55,6 +54,8 @@
|
|||
(depends-on "evil-escape")
|
||||
|
||||
;; Editor --- core/core-editor.el
|
||||
(depends-on "dumb-jump")
|
||||
(depends-on "imenu-list")
|
||||
(depends-on "ace-window")
|
||||
(depends-on "avy")
|
||||
(depends-on "editorconfig")
|
||||
|
@ -65,11 +66,6 @@
|
|||
(depends-on "rotate-text" :git "https://github.com/debug-ito/rotate-text.el")
|
||||
(depends-on "smart-forward")
|
||||
(depends-on "smartparens")
|
||||
(depends-on "vimrc-mode")
|
||||
(depends-on "json-mode")
|
||||
(depends-on "toml-mode")
|
||||
(depends-on "yaml-mode")
|
||||
(depends-on "dockerfile-mode")
|
||||
|
||||
;; Completion --- core/core-company.el
|
||||
(depends-on "company")
|
||||
|
@ -110,11 +106,9 @@
|
|||
(depends-on "projectile")
|
||||
(depends-on "helm-describe-modes" :git "https://github.com/emacs-helm/helm-describe-modes")
|
||||
|
||||
;; Code evaluation/REPLs -- core/core-eval.el
|
||||
;; Code evaluation/REPLs/debug -- core/core-eval.el
|
||||
(depends-on "quickrun")
|
||||
(depends-on "repl-toggle")
|
||||
|
||||
;; Debugging -- core/core-debug.el
|
||||
(depends-on "realgud")
|
||||
|
||||
;; Sessions --- core/core-sessions.el
|
||||
|
@ -128,6 +122,7 @@
|
|||
(depends-on "company-sourcekit")
|
||||
|
||||
;; C/C++ -- modules/module-cc.el
|
||||
(depends-on "disaster")
|
||||
(depends-on "cmake-mode")
|
||||
(depends-on "glsl-mode")
|
||||
(depends-on "cuda-mode")
|
||||
|
@ -146,6 +141,14 @@
|
|||
(depends-on "omnisharp")
|
||||
(depends-on "shader-mode")
|
||||
|
||||
;; Data -- modules/module-data.el
|
||||
(depends-on "vimrc-mode")
|
||||
(depends-on "json-mode")
|
||||
(depends-on "toml-mode")
|
||||
(depends-on "yaml-mode")
|
||||
(depends-on "dockerfile-mode")
|
||||
(depends-on "company-ansible")
|
||||
|
||||
;; Golang -- modules/module-go.el
|
||||
(depends-on "go-mode")
|
||||
(depends-on "go-eldoc")
|
||||
|
@ -186,6 +189,7 @@
|
|||
(depends-on "php-refactor-mode")
|
||||
(depends-on "php-boris")
|
||||
(depends-on "php-extras")
|
||||
(depends-on "ac-php")
|
||||
(depends-on "hack-mode" :git "https://github.com/beefsack/hack-mode")
|
||||
|
||||
;; Processing -- modules/module-processing.el
|
||||
|
@ -219,7 +223,6 @@
|
|||
(depends-on "markdown-toc")
|
||||
|
||||
;; Web -- modules/module-web.el
|
||||
(depends-on "web-beautify")
|
||||
(depends-on "web-mode")
|
||||
(depends-on "emmet-mode")
|
||||
(depends-on "haml-mode")
|
||||
|
|
53
core/core-company.el
Normal file
53
core/core-company.el
Normal file
|
@ -0,0 +1,53 @@
|
|||
;;; core-company.el
|
||||
|
||||
(use-package company
|
||||
:init
|
||||
(setq company-idle-delay nil
|
||||
company-minimum-prefix-length 2
|
||||
company-tooltip-limit 10
|
||||
company-dabbrev-downcase nil
|
||||
company-dabbrev-ignore-case nil
|
||||
company-dabbrev-code-other-buffers t
|
||||
company-tooltip-align-annotations t
|
||||
company-require-match 'never
|
||||
company-global-modes '(not eshell-mode comint-mode erc-mode message-mode help-mode)
|
||||
company-frontends '(company-pseudo-tooltip-frontend company-echo-metadata-frontend)
|
||||
company-backends '((company-capf company-dabbrev-code) company-dabbrev)
|
||||
|
||||
company-quickhelp-delay nil
|
||||
company-statistics-file (concat narf-temp-dir "/company-stats-cache.el"))
|
||||
|
||||
:config
|
||||
;; Rewrites evil-complete to use company-dabbrev
|
||||
(setq evil-complete-next-func 'narf/company-evil-complete-next
|
||||
evil-complete-previous-func 'narf/company-evil-complete-previous)
|
||||
|
||||
(push 'company-sort-by-occurrence company-transformers)
|
||||
(setq-default company-backends (append '(company-keywords) company-backends))
|
||||
|
||||
(def-company-backend! nxml-mode (nxml yasnippet))
|
||||
|
||||
(define-key company-active-map "\C-w" nil)
|
||||
|
||||
(global-company-mode +1))
|
||||
|
||||
(use-package company-quickhelp
|
||||
:after company
|
||||
:config (company-quickhelp-mode +1))
|
||||
|
||||
(use-package company-statistics
|
||||
:after company
|
||||
:config (company-statistics-mode +1))
|
||||
|
||||
(use-package company-files
|
||||
:commands company-files)
|
||||
|
||||
(use-package company-dict
|
||||
:commands company-dict
|
||||
:config (setq company-dict-dir (concat narf-private-dir "/dict")))
|
||||
|
||||
(use-package company-template
|
||||
:after ac-php-company)
|
||||
|
||||
(provide 'core-company)
|
||||
;;; core-company.el ends here
|
|
@ -1,52 +0,0 @@
|
|||
;;; core-completion.el --- auto completion backend (Company-mode)
|
||||
|
||||
(use-package company
|
||||
:init
|
||||
(setq company-idle-delay nil
|
||||
company-minimum-prefix-length 2
|
||||
company-tooltip-limit 10
|
||||
company-dabbrev-downcase nil
|
||||
company-dabbrev-ignore-case nil
|
||||
company-dabbrev-code-other-buffers t
|
||||
company-tooltip-align-annotations t
|
||||
company-require-match 'never
|
||||
company-global-modes '(not eshell-mode comint-mode erc-mode message-mode help-mode)
|
||||
company-frontends '(company-pseudo-tooltip-frontend
|
||||
company-echo-metadata-frontend)
|
||||
company-backends '((company-capf company-dabbrev-code)
|
||||
company-dabbrev))
|
||||
|
||||
:config
|
||||
;; Rewrites evil-complete to use company-dabbrev
|
||||
(setq evil-complete-next-func 'narf/company-evil-complete-next
|
||||
evil-complete-previous-func 'narf/company-evil-complete-previous)
|
||||
|
||||
(push 'company-sort-by-occurrence company-transformers)
|
||||
(setq-default company-backends (append '(company-keywords) company-backends))
|
||||
|
||||
(define-company-backend! nxml-mode (nxml yasnippet))
|
||||
(define-company-backend! emacs-lisp-mode (elisp yasnippet))
|
||||
|
||||
(define-key company-active-map "\C-w" nil)
|
||||
|
||||
(global-company-mode +1)
|
||||
|
||||
(use-package company-files :commands (company-files))
|
||||
|
||||
;; NOTE: pos-tip.el in Emacs 25+ does not work
|
||||
(use-package company-quickhelp
|
||||
:config
|
||||
(company-quickhelp-mode +1)
|
||||
(setq company-quickhelp-delay nil))
|
||||
|
||||
(use-package company-statistics
|
||||
:config
|
||||
(company-statistics-mode +1)
|
||||
(setq company-statistics-file (concat narf-temp-dir "/company-stats-cache.el"))))
|
||||
|
||||
(use-package company-dict
|
||||
:commands (company-dict)
|
||||
:config (setq company-dict-dir (concat narf-private-dir "/dict")))
|
||||
|
||||
(provide 'core-completion)
|
||||
;;; core-completion.el ends here
|
|
@ -1,35 +0,0 @@
|
|||
;;; core-debug.el
|
||||
|
||||
(after! debug
|
||||
;; For elisp debugging
|
||||
(map! :map debugger-mode-map
|
||||
:n "RET" 'debug-help-follow
|
||||
:n "n" 'debugger-step-through
|
||||
:n "c" 'debugger-continue))
|
||||
|
||||
(use-package realgud
|
||||
:commands (realgud:gdb realgud:trepanjs realgud:bashdb realgud:zshdb)
|
||||
:config
|
||||
(map! :map realgud:shortkey-mode-map
|
||||
:n "j" 'evil-next-line
|
||||
:n "k" 'evil-previous-line
|
||||
:n "h" 'evil-backward-char
|
||||
:n "l" 'evil-forward-char
|
||||
;; FIXME Greedy command buffer always grabs focus
|
||||
:m "n" 'realgud:cmd-next
|
||||
:m "b" 'realgud:cmd-break
|
||||
:m "B" 'realgud:cmd-clear
|
||||
:n "c" 'realgud:cmd-continue)
|
||||
|
||||
;; Temporary Ex commands for the debugger
|
||||
(define-temp-ex-cmd! narf:def-debug-on narf:def-debug-off
|
||||
("n[ext]" . realgud:cmd-next)
|
||||
("s[tep]" . realgud:cmd-step)
|
||||
("b[reak]" . narf:debug-toggle-breakpoint)
|
||||
("c[ontinue]" . realgud:cmd-continue))
|
||||
|
||||
(advice-add 'realgud-cmdbuf-init :after 'narf:def-debug-on)
|
||||
(advice-add 'realgud:cmd-quit :after 'narf:def-debug-off))
|
||||
|
||||
(provide 'core-debug)
|
||||
;;; core-debug.el ends here
|
|
@ -112,10 +112,10 @@ Examples:
|
|||
(t (user-error "associate! invalid rules for mode [%s] (in %s) (match %s) (files %s)"
|
||||
mode in match files))))))
|
||||
|
||||
(defmacro define-project-type! (name lighter &rest body)
|
||||
(defmacro def-project-type! (name lighter &rest body)
|
||||
"Define a minor mode for a specific framework, library or project type. e.g.
|
||||
|
||||
(define-project-type! angularjs \"angjs\"
|
||||
(def-project-type! angularjs \"angjs\"
|
||||
:modes (js2-mode)
|
||||
:files (\"package.json\"))"
|
||||
(declare (indent 2))
|
||||
|
@ -133,7 +133,7 @@ Examples:
|
|||
(pop body))
|
||||
`(progn
|
||||
(define-minor-mode ,mode
|
||||
"Auto-generated by `define-project-type!'"
|
||||
"Auto-generated by `def-project-type!'"
|
||||
:init-value nil
|
||||
:lighter ,(concat " " lighter)
|
||||
:keymap (make-sparse-keymap)
|
||||
|
@ -146,14 +146,14 @@ Examples:
|
|||
(yas-deactivate-extra-mode ',mode)))))))
|
||||
|
||||
(after! company-dict
|
||||
(add-to-list 'company-dict-minor-mode-list ',mode))
|
||||
(push ',mode company-dict-minor-mode-list))
|
||||
|
||||
,(when build
|
||||
(when (listp build)
|
||||
(setq build (car-safe (cdr-safe build))))
|
||||
(let ((cmd (or (car-safe build) build))
|
||||
(file (car-safe (cdr-safe build))))
|
||||
`(define-builder! ,mode ,cmd ,file)))
|
||||
`(def-builder! ,mode ,cmd ,file)))
|
||||
,(when bind
|
||||
`(map! :map ,mode-map ,bind))
|
||||
|
||||
|
@ -255,7 +255,9 @@ Examples:
|
|||
(let ((dir (or dir (narf/project-root))))
|
||||
(with-current-buffer (get-buffer-create "*scratch*")
|
||||
(setq default-directory dir)
|
||||
(setq header-line-format '(:eval (concat " ∴ " (abbreviate-file-name default-directory)))))))
|
||||
(setq header-line-format
|
||||
'(:eval
|
||||
(concat " ∴ " (abbreviate-file-name default-directory)))))))
|
||||
|
||||
|
||||
;;;; Global Defuns ;;;;;;;;;;;;;;;;;;;;;
|
||||
|
|
|
@ -71,6 +71,10 @@
|
|||
recentf-auto-cleanup 600)
|
||||
(recentf-mode 1)
|
||||
|
||||
;; Let editorconfig handle global whitespace settings
|
||||
(require 'editorconfig)
|
||||
(editorconfig-mode +1)
|
||||
|
||||
|
||||
;;
|
||||
;; Automatic minor modes
|
||||
|
@ -105,10 +109,7 @@ enable multiple minor modes for the same regexp.")
|
|||
;; Modes 'n hooks
|
||||
;;
|
||||
|
||||
(associate! emacs-lisp-mode :match "\\(/Cask\\|\\.\\(el\\|gz\\)\\)$")
|
||||
(associate! makefile-gmake-mode :match "/Makefile$")
|
||||
(associate! nxml-mode :match "\\.plist$")
|
||||
(associate! conf-mode :match "/\\.?editorconfig$")
|
||||
|
||||
(add-hook! special-mode (setq truncate-lines nil))
|
||||
(add-hook! change-major-mode-hook
|
||||
|
@ -136,10 +137,10 @@ enable multiple minor modes for the same regexp.")
|
|||
|
||||
;; Smarter electric-indent
|
||||
(electric-indent-mode -1) ; on by default
|
||||
(defvar narf-electric-indent-p nil)
|
||||
(defvar narf-electric-indent-words '())
|
||||
(make-variable-buffer-local 'narf-electric-indent-words)
|
||||
(setq electric-indent-chars '(?\n ?\^?))
|
||||
(defvar narf-electric-indent-p nil)
|
||||
(push (lambda (c)
|
||||
(when (eolp)
|
||||
(save-excursion
|
||||
|
@ -162,43 +163,10 @@ enable multiple minor modes for the same regexp.")
|
|||
(setq winner-boring-buffers narf-ignore-buffers))
|
||||
|
||||
|
||||
;;
|
||||
;; Extra modes
|
||||
;;
|
||||
|
||||
(use-package vimrc-mode :mode ("/\\.?g?vimrc$" "\\.vim$" "/\\.vim/rc/.+$"))
|
||||
;; Data formats
|
||||
(use-package toml-mode :mode "\\.toml$")
|
||||
|
||||
(use-package yaml-mode :mode "\\.ya?ml$"
|
||||
:config
|
||||
(add-hook! yaml-mode (setq electric-indent-chars '(?\n ?: ?-))))
|
||||
|
||||
(use-package json-mode :mode "\\.js\\(on\\|hintrc\\)$"
|
||||
:config
|
||||
(add-hook! json-mode (setq electric-indent-chars '(?\n ?: ?}))))
|
||||
|
||||
(add-hook! (yaml-mode json-mode) 'electric-indent-local-mode)
|
||||
|
||||
;; Configuration formats
|
||||
(use-package dockerfile-mode :mode "/Dockerfile$"
|
||||
:config
|
||||
(define-docset! dockerfile-mode "docker")
|
||||
(define-builder! dockerfile-mode dockerfile-build-buffer "Dockerfile"))
|
||||
|
||||
|
||||
;;
|
||||
;; Plugins
|
||||
;;
|
||||
|
||||
(use-package editorconfig
|
||||
:config
|
||||
;; Don't affect lisp indentation (only `tab-width')
|
||||
(setq editorconfig-indentation-alist
|
||||
(delq (assq 'emacs-lisp-mode editorconfig-indentation-alist)
|
||||
editorconfig-indentation-alist))
|
||||
(editorconfig-mode +1))
|
||||
|
||||
(use-package ace-window
|
||||
:commands ace-window
|
||||
:config (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)
|
||||
|
@ -217,8 +185,18 @@ enable multiple minor modes for the same regexp.")
|
|||
(use-package expand-region
|
||||
:commands (er/expand-region er/contract-region er/mark-symbol er/mark-word))
|
||||
|
||||
(use-package dumb-jump
|
||||
:commands (dumb-jump-go dumb-jump-quick-look dumb-jump-back)
|
||||
:config
|
||||
(setq dumb-jump-default-project narf-emacs-dir)
|
||||
(dumb-jump-mode +1))
|
||||
|
||||
(use-package goto-last-change :commands goto-last-change)
|
||||
|
||||
(use-package help-fns+ ; Improved help commands
|
||||
:commands (describe-buffer describe-command describe-file
|
||||
describe-keymap describe-option describe-option-of-type))
|
||||
|
||||
(use-package hideshow
|
||||
:commands (hs-minor-mode hs-toggle-hiding hs-already-hidden-p)
|
||||
:config (setq hs-isearch-open t)
|
||||
|
@ -247,6 +225,33 @@ enable multiple minor modes for the same regexp.")
|
|||
(overlay-put ov 'before-string marker-string)
|
||||
(overlay-put ov 'display display-string))))))
|
||||
|
||||
(use-package imenu-list
|
||||
:commands imenu-list-minor-mode
|
||||
:config
|
||||
(setq imenu-list-mode-line-format nil
|
||||
imenu-list-position 'right
|
||||
imenu-list-size 32)
|
||||
|
||||
(map! :map imenu-list-major-mode-map
|
||||
:n [escape] 'narf/imenu-list-quit
|
||||
:n "RET" 'imenu-list-goto-entry
|
||||
:n "SPC" 'imenu-list-display-entry
|
||||
:n [tab] 'hs-toggle-hiding))
|
||||
|
||||
(use-package re-builder
|
||||
:commands (re-builder reb-mode-buffer-p)
|
||||
:init
|
||||
(add-hook 'reb-mode-hook 'narf|reb-cleanup)
|
||||
(evil-set-initial-state 'reb-mode 'insert)
|
||||
:config
|
||||
(setq reb-re-syntax 'string)
|
||||
(map! :map rxt-help-mode-map
|
||||
:n [escape] 'kill-buffer-and-window
|
||||
:map reb-mode-map
|
||||
:n "C-g" 'reb-quit
|
||||
:n [escape] 'reb-quit
|
||||
:n [backtab] 'reb-change-syntax))
|
||||
|
||||
(use-package rotate-text
|
||||
:commands (rotate-text rotate-text-backward)
|
||||
:init
|
||||
|
@ -259,7 +264,7 @@ enable multiple minor modes for the same regexp.")
|
|||
("advice-add" "advice-remove")
|
||||
("add-hook" "add-hook!" "remove-hook"))))
|
||||
:config
|
||||
(add-to-list 'rotate-text-words '("true" "false")))
|
||||
(push '("true" "false") rotate-text-words))
|
||||
|
||||
(use-package smart-forward :commands (smart-up smart-down smart-left smart-right))
|
||||
|
||||
|
@ -295,23 +300,5 @@ enable multiple minor modes for the same regexp.")
|
|||
(sp-with-modes '(xml-mode nxml-mode php-mode)
|
||||
(sp-local-pair "<!--" "-->" :post-handlers '(("| " "SPC")))))
|
||||
|
||||
(use-package help-fns+ ; Improved help commands
|
||||
:commands (describe-buffer describe-command describe-file
|
||||
describe-keymap describe-option describe-option-of-type))
|
||||
|
||||
(use-package re-builder
|
||||
:commands (re-builder reb-mode-buffer-p)
|
||||
:init
|
||||
(add-hook 'reb-mode-hook 'narf|reb-cleanup)
|
||||
(evil-set-initial-state 'reb-mode 'insert)
|
||||
:config
|
||||
(setq reb-re-syntax 'string)
|
||||
(map! :map rxt-help-mode-map
|
||||
:n [escape] 'kill-buffer-and-window
|
||||
:map reb-mode-map
|
||||
:n "C-g" 'reb-quit
|
||||
:n [escape] 'reb-quit
|
||||
:n [backtab] 'reb-change-syntax))
|
||||
|
||||
(provide 'core-editor)
|
||||
;;; core-editor.el ends here
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
;;; core-eval.el
|
||||
|
||||
;; + Running inline code + REPLs (using `quickrun' + `repl-toggle')
|
||||
;; + Almost-universal debugging (with `realgud')
|
||||
;; + Simple code navigation (using `dump-jump' and `imenu-list')
|
||||
;; + A universal tags config (WIP)
|
||||
|
||||
(use-package quickrun
|
||||
:commands (quickrun
|
||||
quickrun-region
|
||||
|
@ -34,5 +39,37 @@
|
|||
:ei "<down>" 'comint-next-input
|
||||
:ei "<up>" 'comint-previous-input))
|
||||
|
||||
;;
|
||||
(after! debug
|
||||
;; For elisp debugging
|
||||
(map! :map debugger-mode-map
|
||||
:n "RET" 'debug-help-follow
|
||||
:n "n" 'debugger-step-through
|
||||
:n "c" 'debugger-continue))
|
||||
|
||||
(use-package realgud
|
||||
:commands (realgud:gdb realgud:trepanjs realgud:bashdb realgud:zshdb)
|
||||
:config
|
||||
(map! :map realgud:shortkey-mode-map
|
||||
:n "j" 'evil-next-line
|
||||
:n "k" 'evil-previous-line
|
||||
:n "h" 'evil-backward-char
|
||||
:n "l" 'evil-forward-char
|
||||
;; FIXME Greedy command buffer always grabs focus
|
||||
:m "n" 'realgud:cmd-next
|
||||
:m "b" 'realgud:cmd-break
|
||||
:m "B" 'realgud:cmd-clear
|
||||
:n "c" 'realgud:cmd-continue)
|
||||
|
||||
;; Temporary Ex commands for the debugger
|
||||
(def-tmp-excmd! narf:def-debug-on narf:def-debug-off
|
||||
("n[ext]" . realgud:cmd-next)
|
||||
("s[tep]" . realgud:cmd-step)
|
||||
("b[reak]" . narf:debug-toggle-breakpoint)
|
||||
("c[ontinue]" . realgud:cmd-continue))
|
||||
|
||||
(advice-add 'realgud-cmdbuf-init :after 'narf:def-debug-on)
|
||||
(advice-add 'realgud:cmd-quit :after 'narf:def-debug-off))
|
||||
|
||||
(provide 'core-eval)
|
||||
;;; core-eval.el ends here
|
||||
|
|
|
@ -13,10 +13,8 @@
|
|||
|
||||
;; Disable highlights on insert-mode
|
||||
(add-hook 'evil-insert-state-entry-hook '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
|
||||
evil-ex-visual-char-range t ; column range for ex commands
|
||||
evil-want-visual-char-semi-exclusive t
|
||||
evil-ex-search-vim-style-regexp t
|
||||
|
@ -24,7 +22,6 @@
|
|||
evil-echo-state nil
|
||||
evil-ex-substitute-global t
|
||||
evil-insert-skip-empty-lines t
|
||||
evil-search-module 'evil-search
|
||||
|
||||
evil-normal-state-tag "N"
|
||||
evil-insert-state-tag "I"
|
||||
|
@ -39,13 +36,15 @@
|
|||
evil-normal-state-cursor 'box
|
||||
evil-emacs-state-cursor '("cyan" box)
|
||||
evil-insert-state-cursor 'bar
|
||||
evil-visual-state-cursor 'hollow)
|
||||
evil-visual-state-cursor 'hollow
|
||||
|
||||
;; NOTE: a bug in emacs 25 breaks undoing in evil. See
|
||||
;; https://bitbucket.org/lyro/evil/issues/594/undo-doesnt-behave-like-vim
|
||||
(setq-default evil-want-fine-undo (if (> emacs-major-version 24) 'fine 'no))
|
||||
evil-want-fine-undo (if (> emacs-major-version 24) 'fine))
|
||||
|
||||
:config
|
||||
(evil-mode 1)
|
||||
(evil-select-search-module 'evil-search-module 'evil-search)
|
||||
|
||||
(map! :map evil-command-window-mode-map :n [escape] 'kill-buffer-and-window)
|
||||
|
||||
|
@ -56,6 +55,7 @@
|
|||
(debugger-mode . normal)
|
||||
(image-mode . normal)
|
||||
(doc-view-mode . normal)
|
||||
(tabulated-list-mode . emacs)
|
||||
(profile-report-mode . emacs)
|
||||
(Info-mode . emacs)
|
||||
(view-mode . emacs)
|
||||
|
@ -82,7 +82,7 @@
|
|||
(with-selected-window w
|
||||
(unless (derived-mode-p 'comint-mode)
|
||||
(narf/popup-close w)))
|
||||
(narf--popup-remove w)))
|
||||
(narf/popup-remove w)))
|
||||
narf-popup-windows)))
|
||||
|
||||
;; Fix harmless (yet disruptive) error reporting w/ hidden buffers caused by
|
||||
|
@ -96,30 +96,30 @@
|
|||
(add-hook! isearch-mode-end (setq echo-keystrokes 0.02))
|
||||
|
||||
;; Repeat motions with SPC/S-SPC
|
||||
(defmacro define-repeat! (command next-func prev-func)
|
||||
(defmacro def-repeat! (command next-func prev-func)
|
||||
`(defadvice ,command
|
||||
(before ,(intern (format "narf-space--%s" (symbol-name command))) activate)
|
||||
(define-key evil-motion-state-map (kbd "SPC") ',next-func)
|
||||
(define-key evil-motion-state-map (kbd "S-SPC") ',prev-func)))
|
||||
|
||||
(after! evil-snipe
|
||||
(define-repeat! evil-snipe-f evil-snipe-repeat evil-snipe-repeat-reverse)
|
||||
(define-repeat! evil-snipe-F evil-snipe-repeat evil-snipe-repeat-reverse)
|
||||
(define-repeat! evil-snipe-t evil-snipe-repeat evil-snipe-repeat-reverse)
|
||||
(define-repeat! evil-snipe-T evil-snipe-repeat evil-snipe-repeat-reverse)
|
||||
(define-repeat! evil-snipe-s evil-snipe-repeat evil-snipe-repeat-reverse)
|
||||
(define-repeat! evil-snipe-S evil-snipe-repeat evil-snipe-repeat-reverse)
|
||||
(define-repeat! evil-snipe-x evil-snipe-repeat evil-snipe-repeat-reverse)
|
||||
(define-repeat! evil-snipe-X evil-snipe-repeat evil-snipe-repeat-reverse))
|
||||
(def-repeat! evil-snipe-f evil-snipe-repeat evil-snipe-repeat-reverse)
|
||||
(def-repeat! evil-snipe-F evil-snipe-repeat evil-snipe-repeat-reverse)
|
||||
(def-repeat! evil-snipe-t evil-snipe-repeat evil-snipe-repeat-reverse)
|
||||
(def-repeat! evil-snipe-T evil-snipe-repeat evil-snipe-repeat-reverse)
|
||||
(def-repeat! evil-snipe-s evil-snipe-repeat evil-snipe-repeat-reverse)
|
||||
(def-repeat! evil-snipe-S evil-snipe-repeat evil-snipe-repeat-reverse)
|
||||
(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
|
||||
(define-repeat! evil-visualstar/begin-search-forward evil-ex-search-next evil-ex-search-previous)
|
||||
(define-repeat! evil-visualstar/begin-search-backward evil-ex-search-previous evil-ex-search-next))
|
||||
(def-repeat! evil-visualstar/begin-search-forward evil-ex-search-next evil-ex-search-previous)
|
||||
(def-repeat! evil-visualstar/begin-search-backward evil-ex-search-previous evil-ex-search-next))
|
||||
|
||||
(define-repeat! evil-ex-search-next evil-ex-search-next evil-ex-search-previous)
|
||||
(define-repeat! evil-ex-search-previous evil-ex-search-next evil-ex-search-previous)
|
||||
(define-repeat! evil-ex-search-forward evil-ex-search-next evil-ex-search-previous)
|
||||
(define-repeat! evil-ex-search-backward 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-forward evil-ex-search-next evil-ex-search-previous)
|
||||
(def-repeat! evil-ex-search-backward evil-ex-search-next evil-ex-search-previous)
|
||||
|
||||
;; A monkey patch to add all of vim's file ex substitution flags to evil-mode.
|
||||
(defun evil-ex-replace-special-filenames (file-name)
|
||||
|
@ -347,18 +347,17 @@
|
|||
:config
|
||||
(global-evil-surround-mode 1)
|
||||
|
||||
;; Escaped surround characters
|
||||
(setq-default evil-surround-pairs-alist
|
||||
(cons '(?\\ . narf/evil-surround-escaped)
|
||||
evil-surround-pairs-alist))
|
||||
|
||||
(add-hook! org-mode
|
||||
(push '(?l . narf/evil-surround-latex) evil-surround-pairs-alist))
|
||||
(add-hook! emacs-lisp-mode
|
||||
(push '(?\` . ("`" . "'")) evil-surround-pairs-alist))
|
||||
(add-hook! python-mode
|
||||
(push '((?d . ("\"\"\"" . "\"\"\"")))
|
||||
evil-surround-pairs-alist))
|
||||
|
||||
;; Escaped surround characters
|
||||
(setq-default evil-surround-pairs-alist
|
||||
(cons '(?\\ . narf/evil-surround-escaped)
|
||||
evil-surround-pairs-alist)))
|
||||
(push '((?d . ("\"\"\"" . "\"\"\""))) evil-surround-pairs-alist)))
|
||||
|
||||
(use-package evil-visualstar
|
||||
:commands (global-evil-visualstar-mode
|
||||
|
@ -372,12 +371,13 @@
|
|||
:config
|
||||
(setq evil-escape-key-sequence "jk"
|
||||
evil-escape-delay 0.25)
|
||||
(evil-escape-mode +1)
|
||||
|
||||
;; evil-escape causes noticable lag in linewise motions in visual mode, so only enable
|
||||
;; it in insert mode. (I only need jk for insert mode anyway)
|
||||
;; evil-escape causes noticable lag in linewise motions in visual mode, so disable it in
|
||||
;; visual mode
|
||||
(defun narf|evil-escape-disable () (evil-escape-mode -1))
|
||||
(add-hook 'evil-insert-state-entry-hook 'evil-escape-mode)
|
||||
(add-hook 'evil-insert-state-exit-hook 'narf|evil-escape-disable))
|
||||
(add-hook 'evil-visual-state-entry-hook 'narf|evil-escape-disable)
|
||||
(add-hook 'evil-visual-state-exit-hook 'evil-escape-mode))
|
||||
|
||||
(provide 'core-evil)
|
||||
;;; core-evil.el ends here
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
;;; core-file-templates.el
|
||||
|
||||
(use-package autoinsert
|
||||
:defer t
|
||||
:after yasnippet
|
||||
:init
|
||||
(setq auto-insert-query nil ; Don't prompt before insertion
|
||||
auto-insert-alist '()) ; Tabula rasa
|
||||
|
|
|
@ -9,15 +9,11 @@
|
|||
flycheck-disabled-checkers '(emacs-lisp emacs-lisp-checkdoc make))
|
||||
|
||||
:config
|
||||
(require 'flycheck-package)
|
||||
(flycheck-package-setup)
|
||||
;; fixes Unknown defun property `interactive-only' error by compiling flycheck
|
||||
(let ((path (locate-library "flycheck")))
|
||||
(unless (f-ext? path "elc")
|
||||
(byte-compile-file path)))
|
||||
|
||||
(require 'flycheck-pos-tip)
|
||||
(setq flycheck-pos-tip-timeout 10
|
||||
flycheck-display-errors-delay 0.5)
|
||||
(flycheck-pos-tip-mode +1)
|
||||
|
||||
(evil-initial-state 'flycheck-error-list-mode 'emacs)
|
||||
(map! :map flycheck-error-list-mode-map
|
||||
:n "C-n" 'flycheck-error-list-next-error
|
||||
:n "C-p" 'flycheck-error-list-previous-error
|
||||
|
@ -48,6 +44,17 @@
|
|||
;; "........")
|
||||
))
|
||||
|
||||
(use-package flycheck-package
|
||||
:after flycheck
|
||||
:config (flycheck-package-setup))
|
||||
|
||||
(use-package flycheck-pos-tip
|
||||
:after flycheck
|
||||
:config
|
||||
(setq flycheck-pos-tip-timeout 10
|
||||
flycheck-display-errors-delay 0.5)
|
||||
(flycheck-pos-tip-mode +1))
|
||||
|
||||
(use-package flyspell :commands flyspell-mode)
|
||||
|
||||
(provide 'core-flycheck)
|
||||
|
|
|
@ -77,10 +77,14 @@
|
|||
;; Hide mode-line in helm windows
|
||||
(advice-add 'helm-display-mode-line :override 'narf*helm-hide-header)
|
||||
|
||||
(after! yasnippet (push 'helm-alive-p yas-dont-activate))
|
||||
(after! yasnippet (push 'helm-alive-p yas-dont-activate)))
|
||||
|
||||
(require 'helm-mode)
|
||||
(helm-mode 1))
|
||||
(use-package helm-mode
|
||||
:after helm
|
||||
:config (helm-mode 1))
|
||||
|
||||
(use-package helm-tags
|
||||
:commands (helm-tags-get-tag-file helm-etags-select))
|
||||
|
||||
(use-package helm-bookmark
|
||||
:commands (helm-bookmarks helm-filtered-bookmarks)
|
||||
|
@ -88,6 +92,7 @@
|
|||
|
||||
(use-package helm-projectile
|
||||
:commands (helm-projectile-find-other-file
|
||||
helm-projectile-switch-project
|
||||
helm-projectile-find-file
|
||||
helm-projectile-find-dir))
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
(interactive)
|
||||
(error "Not yet implemented"))
|
||||
|
||||
(defun define-docset! (&rest _)
|
||||
(defun def-docset! (&rest _)
|
||||
(message "No docset function defined!"))
|
||||
|
||||
(provide 'core-os-linux)
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
(use-package dash-at-point
|
||||
:commands (dash-at-point dash-at-point-with-docset dash-at-point-run-search dash-at-point-guess-docset)
|
||||
:init
|
||||
(defmacro define-docset! (mode docset)
|
||||
(defmacro def-docset! (mode docset)
|
||||
`(add-hook! ,mode (setq-local dash-at-point-docset ,docset))))
|
||||
|
||||
(after! evil
|
||||
|
|
|
@ -79,7 +79,7 @@
|
|||
(local-set-key [escape escape] 'narf/popup-close)
|
||||
(when (or (bound-and-true-p repl-toggle-mode)
|
||||
(derived-mode-p 'tabulated-list-mode)
|
||||
(memq major-mode '(messages-buffer-mode flycheck-error-list-mode-hook)))
|
||||
(memq major-mode '(messages-buffer-mode flycheck-error-list-mode-hook esup-mode)))
|
||||
(let ((map evil-normal-state-local-map))
|
||||
(define-key map [escape] 'narf/popup-close)
|
||||
(define-key map (kbd "ESC") 'narf/popup-close))))
|
||||
|
@ -90,11 +90,6 @@
|
|||
;; Hacks
|
||||
;;
|
||||
|
||||
(after! ert
|
||||
(map! :map ert-results-mode-map
|
||||
[escape] 'quit-window
|
||||
"<escape>" 'quit-window))
|
||||
|
||||
(after! help-mode
|
||||
;; So that help buffer links do not open in the help popup, we need to redefine these
|
||||
;; three button types to use `switch-to-buffer-other-window' rather than
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
|
||||
;;
|
||||
(use-package ido
|
||||
:defines (flx-ido-mode ido-ubiquitous-debug-mode ido-context-switch-command ido-temp-list)
|
||||
:functions (ido-to-end)
|
||||
:init
|
||||
(setq ido-ignore-buffers
|
||||
|
@ -57,8 +56,8 @@
|
|||
(add-hook 'ido-setup-hook 'narf|ido-setup-home-keybind)
|
||||
:config
|
||||
(add-hook! ido-setup
|
||||
(add-to-list 'ido-ignore-files "\\`.DS_Store$")
|
||||
(add-to-list 'ido-ignore-files "Icon\\?$")
|
||||
(push "\\`.DS_Store$" ido-ignore-files)
|
||||
(push "Icon\\?$" ido-ignore-files)
|
||||
(advice-add 'ido-sort-mtime :override 'narf*ido-sort-mtime)
|
||||
|
||||
(require 'ido-vertical-mode)
|
||||
|
@ -83,7 +82,6 @@
|
|||
neotree-dir
|
||||
neotree-find
|
||||
neo-global--window-exists-p)
|
||||
:functions (neo-buffer--unlock-width neo-buffer--lock-width)
|
||||
:init
|
||||
(setq neo-create-file-auto-open t
|
||||
neo-auto-indent-point t
|
||||
|
@ -115,9 +113,6 @@
|
|||
"r" 'neotree-rename-node
|
||||
"R" 'neotree-change-root))
|
||||
|
||||
(after! projectile
|
||||
(setq projectile-switch-project-action 'neotree-projectile-action))
|
||||
|
||||
;; Shorter pwd in neotree
|
||||
(defun narf*neotree-shorten-pwd (node)
|
||||
(list (abbreviate-file-name (car node))))
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
;; I use workgroups to accomplish two things:
|
||||
;; 1. Vim-like tab emulation (type :tabs to see a list of tabs -- maybe I'll add some
|
||||
;; code to make a permanent frame header to display these some day)
|
||||
;; 2. Session persistence
|
||||
;; 2. Session persistence (with :ss and :sl)
|
||||
|
||||
(defvar narf-wg-frames '()
|
||||
"A list of all the frames opened as separate workgroups. See
|
||||
|
@ -17,8 +17,8 @@ automatically renamed to the project name.")
|
|||
:when (display-graphic-p)
|
||||
:init
|
||||
(setq-default
|
||||
wg-session-file (expand-file-name "workgroups/last" narf-temp-dir)
|
||||
wg-workgroup-directory (expand-file-name "workgroups/" narf-temp-dir)
|
||||
wg-session-file (concat narf-temp-dir "/workgroups/last")
|
||||
wg-workgroup-directory (concat narf-temp-dir "/workgroups/")
|
||||
wg-first-wg-name "*untitled*"
|
||||
wg-session-load-on-start nil
|
||||
wg-mode-line-display-on nil
|
||||
|
@ -29,7 +29,7 @@ automatically renamed to the project name.")
|
|||
|
||||
;; NOTE: Some of these make workgroup-restoration unstable
|
||||
wg-restore-mark t
|
||||
wg-restore-frame-position nil
|
||||
wg-restore-frame-position t
|
||||
wg-restore-remote-buffers nil
|
||||
wg-restore-scroll-bars nil
|
||||
wg-restore-fringes nil
|
||||
|
@ -46,15 +46,8 @@ automatically renamed to the project name.")
|
|||
|
||||
(add-hook 'emacs-startup-hook 'workgroups-mode)
|
||||
:config
|
||||
(unless (file-exists-p wg-workgroup-directory)
|
||||
(mkdir wg-workgroup-directory))
|
||||
|
||||
;; Remember the set names in between sessions
|
||||
(add-to-list 'savehist-additional-variables 'narf-wg-names)
|
||||
|
||||
(after! projectile
|
||||
;; Create a new workgroup on switch-project
|
||||
(setq projectile-switch-project-action 'narf/wg-projectile-switch-project))
|
||||
(push 'narf-wg-names savehist-additional-variables)
|
||||
|
||||
;; `wg-mode-line-display-on' wasn't enough
|
||||
(advice-add 'wg-change-modeline :override 'ignore)
|
||||
|
@ -62,6 +55,10 @@ automatically renamed to the project name.")
|
|||
;; Don't remember popup and neotree windows
|
||||
(add-hook 'kill-emacs-hook 'narf|wg-cleanup)
|
||||
|
||||
(after! projectile
|
||||
;; Create a new workgroup on switch-project
|
||||
(setq projectile-switch-project-action 'narf/wg-projectile-switch-project))
|
||||
|
||||
;; This helps abstract some of the underlying functions away, just in case I want to
|
||||
;; switch to a different package in the future, like persp-mode, eyebrowse or wconf.
|
||||
(defalias 'narf/tab-display 'narf/workgroup-display)
|
||||
|
|
|
@ -100,7 +100,7 @@
|
|||
?∨ ?∧ ?¬))))
|
||||
|
||||
;; on by default in Emacs 25; I prefer to enable on a mode-by-mode basis, so disable it
|
||||
(when (and (featurep 'eldoc) (>= emacs-major-version 25))
|
||||
(when (and (> emacs-major-version 24) (featurep 'eldoc))
|
||||
(global-eldoc-mode -1))
|
||||
|
||||
;; line highlighting
|
||||
|
@ -118,8 +118,6 @@
|
|||
(add-hook 'evil-visual-state-exit-hook 'narf|hl-line-on)
|
||||
|
||||
;; Hide modeline in help windows
|
||||
(defun narf|hide-mode-line (&rest _)
|
||||
(setq mode-line-format nil))
|
||||
(add-hook 'help-mode-hook 'narf|hide-mode-line)
|
||||
|
||||
;; Highlight TODO/FIXME/NOTE tags
|
||||
|
@ -151,14 +149,14 @@
|
|||
(use-package highlight-indentation
|
||||
:commands (highlight-indentation-mode highlight-indentation-current-column-mode)
|
||||
:init
|
||||
(add-hook! (web-mode 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)
|
||||
'highlight-indentation-mode)
|
||||
|
||||
(after! editorconfig
|
||||
(defun narf/hl-indent-guess-offset ()
|
||||
(when (featurep 'editorconfig)
|
||||
(string-to-int (gethash 'indent_size (editorconfig-get-properties)))))
|
||||
(advice-add 'highlight-indentation-guess-offset :override 'narf/hl-indent-guess-offset)
|
||||
(string-to-int (gethash 'indent_size (editorconfig-get-properties))))
|
||||
(advice-add 'highlight-indentation-guess-offset :override 'narf/hl-indent-guess-offset))
|
||||
|
||||
;; A long-winded method for ensuring whitespace is maintained (so that
|
||||
;; highlight-indentation-mode can display them consistently)
|
||||
|
@ -173,19 +171,6 @@
|
|||
|
||||
(use-package highlight-numbers :commands (highlight-numbers-mode))
|
||||
|
||||
(use-package imenu-list
|
||||
:commands (imenu-list-minor-mode)
|
||||
:config
|
||||
(setq imenu-list-mode-line-format nil
|
||||
imenu-list-position 'right
|
||||
imenu-list-size 35)
|
||||
|
||||
(map! :map imenu-list-major-mode-map
|
||||
:n [escape] 'narf/imenu-list-quit
|
||||
:n "RET" 'imenu-list-goto-entry
|
||||
:n "SPC" 'imenu-list-display-entry
|
||||
:n [tab] 'hs-toggle-hiding))
|
||||
|
||||
(use-package rainbow-delimiters
|
||||
:commands rainbow-delimiters-mode
|
||||
:init
|
||||
|
@ -335,7 +320,7 @@
|
|||
|
||||
(spaceline-define-segment *env-version
|
||||
"Shows the environment version of a mode (e.g. pyenv for python or rbenv for ruby).
|
||||
See `define-env-command!' to define one for a mode."
|
||||
See `def-env-command!' to define one for a mode."
|
||||
narf--env-version
|
||||
:when narf--env-version
|
||||
:face other-face
|
||||
|
@ -358,7 +343,6 @@ anzu to be enabled."
|
|||
:skip-alternate t
|
||||
:tight t)
|
||||
|
||||
;; TODO mode-line-iedit-face default face
|
||||
(spaceline-define-segment *iedit
|
||||
"Show the number of matches and what match you're on (or after). Requires iedit."
|
||||
(let ((this-oc (iedit-find-current-occurrence-overlay))
|
||||
|
|
|
@ -17,12 +17,6 @@
|
|||
:config
|
||||
(require 'git-gutter-fringe)
|
||||
|
||||
(defalias 'narf/vcs-next-hunk 'git-gutter:next-hunk)
|
||||
(defalias 'narf/vcs-prev-hunk 'git-gutter:previous-hunk)
|
||||
(defalias 'narf/vcs-show-hunk 'git-gutter:popup-hunk)
|
||||
(defalias 'narf/vcs-stage-hunk 'git-gutter:stage-hunk)
|
||||
(defalias 'narf/vcs-revert-hunk 'git-gutter:revert-hunk)
|
||||
|
||||
(define-fringe-bitmap 'git-gutter-fr:added
|
||||
[240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 240]
|
||||
nil nil 'center)
|
||||
|
@ -33,8 +27,16 @@
|
|||
[0 0 0 0 0 0 0 128 192 224 240 248]
|
||||
nil nil 'center)
|
||||
|
||||
;; Refresh git-gutter on ESC in normal mode
|
||||
(advice-add 'evil-force-normal-state :after 'git-gutter)
|
||||
(add-hook 'focus-in-hook 'git-gutter:update-all-windows))
|
||||
|
||||
(add-hook 'focus-in-hook 'git-gutter:update-all-windows)
|
||||
|
||||
(defalias 'narf/vcs-next-hunk 'git-gutter:next-hunk)
|
||||
(defalias 'narf/vcs-prev-hunk 'git-gutter:previous-hunk)
|
||||
(defalias 'narf/vcs-show-hunk 'git-gutter:popup-hunk)
|
||||
(defalias 'narf/vcs-stage-hunk 'git-gutter:stage-hunk)
|
||||
(defalias 'narf/vcs-revert-hunk 'git-gutter:revert-hunk))
|
||||
|
||||
(after! vc-annotate
|
||||
(evil-set-initial-state 'vc-annotate-mode 'normal)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
;;; core-yasnippet.el --- For the lazy typist
|
||||
;;; core-yasnippet.el
|
||||
|
||||
(use-package yasnippet
|
||||
:mode ("emacs\\.d/private/\\(snippets\\|templates\\)/.+$" . snippet-mode)
|
||||
|
|
|
@ -172,11 +172,6 @@ gets killed.")
|
|||
async-wait
|
||||
async-inject-variables))
|
||||
|
||||
(require (cond (IS-MAC 'core-os-osx)
|
||||
(IS-LINUX 'core-os-linux)
|
||||
(IS-WINDOWS 'core-os-win32)))
|
||||
|
||||
|
||||
;;
|
||||
;; We add this to `after-init-hook' to allow errors to stop this advice
|
||||
(add-hook! after-init
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
;;; defuns-popups.el
|
||||
|
||||
(defun narf--popup-remove (window)
|
||||
;;;###autoload
|
||||
(defun narf/popup-remove (window)
|
||||
(setq narf-popup-windows (delete window narf-popup-windows)))
|
||||
|
||||
;;;###autoload
|
||||
|
@ -8,7 +9,7 @@
|
|||
"Whether WINDOW is a shackle popup window or not."
|
||||
(and narf-popup-windows
|
||||
(-any? (lambda (w)
|
||||
(if (window-live-p w) t (narf--popup-remove w) nil))
|
||||
(if (window-live-p w) t (narf/popup-remove w) nil))
|
||||
narf-popup-windows)
|
||||
(if window
|
||||
(-any? (lambda (w) (eq window w)) narf-popup-windows)
|
||||
|
@ -39,7 +40,7 @@
|
|||
((eq major-mode 'messages-buffer-mode)
|
||||
(bury-buffer)
|
||||
(setq dont-kill t)))
|
||||
(narf--popup-remove window)
|
||||
(narf/popup-remove window)
|
||||
(unless dont-kill
|
||||
(let ((kill-buffer-query-functions (delq 'process-kill-buffer-query-function kill-buffer-query-functions)))
|
||||
(kill-buffer (window-buffer window))))
|
||||
|
|
|
@ -20,10 +20,6 @@ determine if a directory is a project."
|
|||
(file-exists-p file)))))
|
||||
found-p))
|
||||
|
||||
;;;###autoload
|
||||
(defun narf/project-name (&optional root)
|
||||
(file-name-nondirectory (directory-file-name (or root (narf/project-root)))))
|
||||
|
||||
;;;###autoload
|
||||
(defalias 'narf/project-p 'projectile-project-p)
|
||||
|
||||
|
|
|
@ -13,9 +13,8 @@
|
|||
|
||||
;;;###autoload (autoload 'narf:build "defuns-quickrun" nil t)
|
||||
(evil-define-command narf:build (arg)
|
||||
"Call a build command in the current directory.
|
||||
If ARG is nil this function calls `recompile', otherwise it calls
|
||||
`compile' passing ARG as build command."
|
||||
"Call a build command in the current directory. If ARG is nil this function calls
|
||||
`recompile', otherwise it calls `compile' passing ARG as build command."
|
||||
(interactive "<sh>")
|
||||
(when (null narf--build-command)
|
||||
(user-error "No build command was set"))
|
||||
|
@ -34,6 +33,7 @@ If ARG is nil this function calls `recompile', otherwise it calls
|
|||
;;;; Code running ;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;###autoload (autoload 'narf:eval-buffer "defuns-quickrun" nil t)
|
||||
(evil-define-command narf:eval-buffer ()
|
||||
"Evaluate the whole buffer."
|
||||
:move-point nil :repeat nil
|
||||
(interactive)
|
||||
(cond ((eq major-mode 'emacs-lisp-mode)
|
||||
|
@ -42,26 +42,27 @@ If ARG is nil this function calls `recompile', otherwise it calls
|
|||
|
||||
;;;###autoload (autoload 'narf:eval-region "defuns-quickrun" nil t)
|
||||
(evil-define-operator narf:eval-region (beg end)
|
||||
"Evaluate a region and, if large enough, prints its output to a popup buffer (if an
|
||||
elisp buffer). Otherwise forward the region to Quickrun."
|
||||
:move-point nil :repeat nil
|
||||
(interactive "<r>")
|
||||
(cond ((eq major-mode 'emacs-lisp-mode)
|
||||
(require 'pp)
|
||||
(let* ((pp-escape-newlines nil)
|
||||
(out (s-trim (pp-to-string (eval (read (buffer-substring-no-properties beg end))))))
|
||||
(out (pp-to-string (eval (read (buffer-substring-no-properties beg end)))))
|
||||
(lines (length (s-lines out))))
|
||||
(if (< lines 5)
|
||||
(princ out t)
|
||||
(let ((buf (get-buffer-create "*eval*")))
|
||||
(with-current-buffer buf
|
||||
(with-current-buffer (get-buffer-create "*eval*")
|
||||
;; (rename-buffer (buffer-name old-buf))
|
||||
(read-only-mode -1)
|
||||
(emacs-lisp-mode)
|
||||
(setq-local scroll-margin 0)
|
||||
(emacs-lisp-mode)
|
||||
(erase-buffer)
|
||||
(insert out)
|
||||
(goto-char (point-min))
|
||||
(read-only-mode 1)
|
||||
(narf|hide-mode-line)
|
||||
(narf/popup-buffer buf))))))
|
||||
(goto-char (point-min))
|
||||
(narf/popup-buffer (current-buffer))))))
|
||||
(t (quickrun-region beg end))))
|
||||
|
||||
;;;###autoload (autoload 'narf:eval-region-and-replace "defuns-quickrun" nil t)
|
||||
|
|
|
@ -62,8 +62,7 @@ end file."
|
|||
(start (or start (point-min))))
|
||||
(goto-char start)
|
||||
(while (and (re-search-forward "^$" end-marker t) (not (>= (point) end-marker)))
|
||||
(let (line-start line-end
|
||||
next-start next-end)
|
||||
(let (line-start line-end next-start next-end)
|
||||
(save-excursion
|
||||
;; Check previous line indent
|
||||
(forward-line -1)
|
||||
|
@ -79,7 +78,7 @@ end file."
|
|||
(let* ((line-indent (- line-end line-start))
|
||||
(next-indent (- next-end next-start))
|
||||
(indent (min line-indent next-indent)))
|
||||
(insert (make-string indent ? )))))
|
||||
(insert (make-string (if (zerop indent) 0 (1+ indent)) ? )))))
|
||||
(forward-line 1)))))
|
||||
(set-buffer-modified-p nil))
|
||||
nil)
|
||||
|
@ -93,5 +92,9 @@ end file."
|
|||
(imenu-list-minor-mode -1))))
|
||||
(narf/get-visible-buffers (narf/get-real-buffers))))
|
||||
|
||||
;;;###autoload
|
||||
(defun narf|hide-mode-line (&rest _)
|
||||
(setq mode-line-format nil))
|
||||
|
||||
(provide 'defuns-ui)
|
||||
;;; defuns-ui.el ends here
|
||||
|
|
|
@ -8,7 +8,11 @@
|
|||
|
||||
;;;###autoload
|
||||
(defun narf/wg-projectile-switch-project ()
|
||||
(narf:workgroup-new nil (file-name-nondirectory (directory-file-name (narf/project-root))) t))
|
||||
(let ((project-root (narf/project-root)))
|
||||
(narf:workgroup-new nil (file-name-nondirectory (directory-file-name project-root)) t)
|
||||
(narf|update-scratch-buffer-cwd project-root)
|
||||
(when (featurep 'neotree)
|
||||
(neotree-projectile-action))))
|
||||
|
||||
;;;###autoload (autoload 'narf:save-session "defuns-workgroup" nil t)
|
||||
(evil-define-command narf:save-session (&optional bang session-name)
|
||||
|
|
|
@ -2,9 +2,11 @@
|
|||
;; for ../core-company.el
|
||||
|
||||
;;;###autoload
|
||||
(defmacro define-company-backend! (hook backends)
|
||||
(defmacro def-company-backend! (hooks backends)
|
||||
"Register a company backend for a mode."
|
||||
(let ((def-name (intern (format "narf--init-company-%s" hook)))
|
||||
(let* ((hooks (if (listp hooks) hooks (list hooks)))
|
||||
(def-name (intern (format "narf--init-company-%s"
|
||||
(s-join "-" (mapcar 'symbol-name hooks)))))
|
||||
(quoted (eq (car-safe backends) 'quote)))
|
||||
`(progn
|
||||
(defun ,def-name ()
|
||||
|
@ -15,7 +17,7 @@
|
|||
(intern (format "company-%s" backend))))
|
||||
(if quoted (cadr backends) backends))))
|
||||
company-backends)))
|
||||
(add-hook ',(intern (format "%s-hook" hook)) ',def-name))))
|
||||
(add-hook! ,hooks ',def-name))))
|
||||
|
||||
(provide 'macros-company)
|
||||
;;; macros-company.el ends here
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
;;; macros-evil.el
|
||||
|
||||
;;;###autoload
|
||||
(defmacro define-text-object! (key start-regex end-regex)
|
||||
(defmacro def-textobj! (key start-regex end-regex)
|
||||
(let ((inner-name (make-symbol "narf--inner-name"))
|
||||
(outer-name (make-symbol "narf--outer-name")))
|
||||
`(progn
|
||||
|
@ -13,7 +13,7 @@
|
|||
(define-key evil-outer-text-objects-map ,key (quote ,outer-name)))))
|
||||
|
||||
;;;###autoload
|
||||
(defmacro define-temp-ex-cmd! (cmd-on cmd-off &rest commands)
|
||||
(defmacro def-tmp-excmd! (cmd-on cmd-off &rest commands)
|
||||
"Creates on-off defuns for a set of ex commands, named CMD-ON and CMD-OFF."
|
||||
(declare (indent 2))
|
||||
`(progn
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
;;; macros-quickrun.el
|
||||
|
||||
;;;###autoload
|
||||
(defmacro define-builder! (mode command &optional build-file)
|
||||
(defmacro def-builder! (mode command &optional build-file)
|
||||
"Register major/minor MODE with build COMMAND. If FILES are provided, do an
|
||||
additional check to make sure they exist in the project root."
|
||||
`(add-hook! ,mode
|
||||
|
@ -10,7 +10,7 @@ additional check to make sure they exist in the project root."
|
|||
(setq narf--build-command '(,command . ,build-file)))))
|
||||
|
||||
;;;###autoload
|
||||
(defmacro define-repl! (mode command)
|
||||
(defmacro def-repl! (mode command)
|
||||
`(push '(,mode . ,command) rtog/mode-repl-alist))
|
||||
|
||||
(provide 'macros-quickrun)
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
;;; defuns-spaceline.el
|
||||
|
||||
;;;###autoload
|
||||
(defmacro define-env-command! (mode command)
|
||||
(defmacro def-env-command! (mode command)
|
||||
"Define a COMMAND for MODE that will set `narf--env-command' when that mode is
|
||||
activated, which should return the version number of the current environment. It is used
|
||||
by `narf|spaceline-env-update' to display a version number in the modeline. For instance:
|
||||
|
||||
(define-env-command! ruby-mode \"ruby --version | cut -d' ' -f2\")
|
||||
(def-env-command! ruby-mode \"ruby --version | cut -d' ' -f2\")
|
||||
|
||||
This will display the ruby version in the modeline in ruby-mode buffers. It is cached the
|
||||
first time."
|
||||
|
|
|
@ -2,15 +2,14 @@
|
|||
;; for ../core-yasnippet.el
|
||||
|
||||
;;;###autoload
|
||||
(defmacro add-yas-minor-mode! (mode)
|
||||
(defmacro def-yas-mode! (mode)
|
||||
"Register minor MODES in yasnippet."
|
||||
`(after! yasnippet
|
||||
(when (boundp 'yas--extra-modes)
|
||||
(add-hook ',(intern (concat (symbol-name (cadr mode)) "-hook"))
|
||||
(lambda ()
|
||||
(add-hook! ,mode
|
||||
(if (symbol-value ,mode)
|
||||
(yas-activate-extra-mode ,mode)
|
||||
(yas-deactivate-extra-mode ,mode)))))))
|
||||
(yas-deactivate-extra-mode ,mode))))))
|
||||
|
||||
(provide 'macros-yasnippet)
|
||||
;;; macros-yasnippet.el ends here
|
||||
|
|
|
@ -25,7 +25,7 @@ csharp:
|
|||
|
||||
js:
|
||||
@echo "Installing js2-mode dependencies"
|
||||
npm -g install web-beautify trepanjs
|
||||
npm -g install trepanjs tern
|
||||
|
||||
sh:
|
||||
@echo "Installing zsh/bash dependencies"
|
||||
|
|
27
init.el
27
init.el
|
@ -46,29 +46,34 @@
|
|||
(defconst narf-default-theme 'narf-dark)
|
||||
(defconst narf-default-font (font-spec :family "Hack" :size 12))
|
||||
|
||||
(narf '(core ; core/core.el
|
||||
(narf `(core ; core/core.el
|
||||
|
||||
;; OS-specific config
|
||||
,(cond (IS-MAC 'core-os-osx)
|
||||
(IS-LINUX 'core-os-linux)
|
||||
(IS-WINDOWS 'core-os-win32))
|
||||
|
||||
;; The heart of NARF
|
||||
core-popup ; taming sudden and inevitable windows
|
||||
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-completion ; for the lazy typist
|
||||
core-company ; for the lazy typist
|
||||
core-yasnippet ; for the lazier typist
|
||||
core-file-templates ; for the laziest typist
|
||||
core-flycheck ; code police; tazing you for every semicolon you forget
|
||||
core-project ; whose project am I in?
|
||||
core-vcs ; remember remember, that commit in November
|
||||
core-helm ; a search engine for life and love
|
||||
core-eval ; run code, run.
|
||||
core-debug ; emacs as a universal debugger
|
||||
core-sessions ; cure Emacs alzheimers + tab emulation
|
||||
core-eval ; run code, run; debugging too
|
||||
|
||||
;; Environments
|
||||
module-apple ; Applescript, Swift, Launchbar, iOS, wallet syphons, etc.
|
||||
module-cc ; C/C++/obj-c madness
|
||||
module-crystal ; ruby at the speed of c
|
||||
module-csharp ; unity, .NET, and mono shenanigans
|
||||
module-data ; config and data formats
|
||||
module-go ; the hipster dialect
|
||||
module-haskell ; a language that's lazier than I am
|
||||
module-java ; the poster child for carpal tunnel syndome
|
||||
|
@ -76,26 +81,26 @@
|
|||
module-julia ; MATLAB, but fast
|
||||
module-lisp ; drowning in parentheses
|
||||
module-lua ; one-based indices? one-based indices.
|
||||
module-org ; for organized fearless leader
|
||||
module-php ; making php less painful to work with
|
||||
module-processing ; pretty prototypes
|
||||
module-python ; beautiful is better than ugly
|
||||
module-ruby ; 1.step do {|i| p "Ruby is #{i&1==0?'love':'life'}"}
|
||||
module-rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
|
||||
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 + latex
|
||||
module-web ; #big-bang::before { content: ""; }
|
||||
|
||||
;; Experimental
|
||||
;;module-eshell ; for inferior OSes *cough*windows
|
||||
|
||||
;; Organizational/Notes
|
||||
;;module-org ; for organized fearless leader
|
||||
;;module-write ; for writing papers and fiction in Emacs
|
||||
|
||||
;; Extra libraries
|
||||
extra-tmux ; closing the rift between GUI & terminal
|
||||
extra-demo ; allow me to demonstrate...
|
||||
extra-ansible ;
|
||||
extra-demo ; allow me to demonstrate...
|
||||
extra-tags ; if you liked it you should've generated a tag for it
|
||||
extra-text ; break in case of word documents from clients
|
||||
extra-tmux ; closing the rift between GUI & terminal
|
||||
extra-write ; for writing papers and fiction in Emacs
|
||||
|
||||
;; Customization
|
||||
my-bindings
|
||||
|
|
|
@ -9,6 +9,19 @@
|
|||
'+
|
||||
'++))))
|
||||
|
||||
;;;###autoload
|
||||
(defun narf/c-lineup-arglist (orig-fun &rest args)
|
||||
"Improve indentation of continued C++11 lambda function opened as argument."
|
||||
(if (and (eq major-mode 'c++-mode)
|
||||
(ignore-errors
|
||||
(save-excursion
|
||||
(goto-char (c-langelem-pos langelem))
|
||||
;; Detect "[...](" or "[...]{". preceded by "," or "(",
|
||||
;; and with unclosed brace.
|
||||
(looking-at ".*[(,][ \t]*\\[[^]]*\\][ \t]*[({][^}]*$"))))
|
||||
0 ; no additional indent
|
||||
(apply orig-fun args)))
|
||||
|
||||
;;;###autoload
|
||||
(defun narf|init-c/c++-settings ()
|
||||
(when (memq major-mode '(c-mode c++-mode objc-mode))
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
;;; extra-ansible.el
|
||||
|
||||
(define-project-type! ansible-mode "ans"
|
||||
(def-project-type! ansible-mode "ans"
|
||||
:modes (yaml-mode)
|
||||
:files ("roles/"))
|
||||
|
||||
(use-package company-ansible
|
||||
:commands (company-ansible)
|
||||
:init (define-company-backend! ansible-mode (ansible)))
|
||||
:init (def-company-backend! ansible-mode (ansible)))
|
||||
|
||||
(provide 'extra-ansible)
|
||||
;;; module-ansible.el ends here
|
||||
|
|
|
@ -3,15 +3,17 @@
|
|||
;; This library offers:
|
||||
;; + impatient-mode: for broadcasting my emacs session
|
||||
;; + big-mode: for enlarged text while screencasting
|
||||
;; + integration with reveal.js for presentations
|
||||
;; + TODO integration with reveal.js for presentations
|
||||
;; + TODO peer programming collab
|
||||
|
||||
(defvar powerline-height)
|
||||
|
||||
;; Big-mode settings
|
||||
(defconst big-mode-font (font-spec :family "Hack" :size 16))
|
||||
(defconst big-mode-line-spacing 0)
|
||||
(defconst big-mode-modeline-height 26)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
(defconst big-mode-modeline-height 30)
|
||||
|
||||
;;
|
||||
(use-package impatient-mode
|
||||
:defer t
|
||||
:commands httpd-start)
|
||||
|
|
10
modules/extra-text.el
Normal file
10
modules/extra-text.el
Normal file
|
@ -0,0 +1,10 @@
|
|||
;;; extra-text.el
|
||||
|
||||
;; TODO
|
||||
(evil-define-operator narf/html-encode (beg end)
|
||||
"HTML encode the selected region."
|
||||
(interactive "<r>")
|
||||
(shell-command-on-region beg end "sort" nil t))
|
||||
|
||||
(provide 'extra-text)
|
||||
;;; extra-text.el ends here
|
|
@ -1,10 +1,8 @@
|
|||
;;; extra-tmux.el
|
||||
|
||||
;; This library offers:
|
||||
;; + TODO An integration/abstraction layer to make it seem like tmux and emacs are one
|
||||
;; program.
|
||||
;; + TODO A way to manage tmux sessions and layouts from emacs; possibly trigger them
|
||||
;; depending on current project.
|
||||
;; + A way of communicating with a tmux instance
|
||||
;; + TODO A way to manage tmuxifier from emacs
|
||||
|
||||
;;;###autoload
|
||||
(defun tmux (command &optional modes)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
;; module-write.el
|
||||
;; extra-write.el
|
||||
|
||||
;; This library offers the following:
|
||||
;; + Write-mode: a mode that turns Emacs into an app for writing notes, papers, or
|
||||
|
@ -14,14 +14,7 @@
|
|||
(defconst write-mode--last-mode-line mode-line-format)
|
||||
(defconst write-mode--last-line-spacing line-spacing)
|
||||
|
||||
;; (defvar write-mode-org-font-lock-keywords
|
||||
;; `(("[-+*] \\[X\\] \\([^$\n\r]+\\)"
|
||||
;; (1 'org-headline-done))
|
||||
;; ("^ *\\([-+]\\|[0-9]+[).]\\)\\( \\)+[^$\n\r]"
|
||||
;; (1 'org-list-bullet))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;;
|
||||
(setq-default visual-fill-column-center-text nil
|
||||
visual-fill-column-width 80)
|
||||
|
||||
|
@ -93,43 +86,6 @@ functionality with buffer-local ones, which can be buggy in a minor-mode."
|
|||
(visual-fill-column--adjust-window))))
|
||||
(apply fn window args))))
|
||||
|
||||
;;; LaTeX
|
||||
(setq TeX-auto-save t)
|
||||
(setq TeX-parse-self t)
|
||||
(setq bibtex-dialect 'biblatex)
|
||||
(setq bibtex-align-at-equal-sign t)
|
||||
(setq bibtex-text-indentation 20)
|
||||
(add-hook! bibtex-mode
|
||||
(local-set-key (kbd "C-c \\") 'bibtex-fill-entry)
|
||||
(setq fill-column 140))
|
||||
(add-hook! latex-mode 'turn-on-auto-fill)
|
||||
(add-hook! LaTeX-mode 'turn-on-auto-fill)
|
||||
|
||||
(use-package reftex
|
||||
:config
|
||||
(add-hook 'latex-mode-hook 'turn-on-reftex)
|
||||
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
|
||||
(setq reftex-plug-into-AUCTeX t
|
||||
reftex-ref-style-default-list '("Cleveref" "Hyperref" "Fancyref")
|
||||
reftex-default-bibliography
|
||||
`(,(expand-file-name "phys.bib" write-mode-biblio-dir))))
|
||||
|
||||
;;; Bibtex
|
||||
;; NOTE: http://bibdesk.sourceforge.net/
|
||||
(use-package helm-bibtex
|
||||
:defer t
|
||||
:config
|
||||
(setq helm-bibtex-bibliography
|
||||
`(,(expand-file-name "phys.bib" write-mode-biblio-dir))
|
||||
|
||||
helm-bibtex-library-path
|
||||
`(,(expand-file-name "phys-pdf" write-mode-biblio-dir))
|
||||
|
||||
helm-bibtex-notes-path (expand-file-name "notes" write-mode-biblio-dir)
|
||||
helm-bibtex-notes-extension ".org"
|
||||
|
||||
helm-bibtex-pdf-open-function
|
||||
(lambda (fpath) (async-start-process "open-pdf" "/usr/bin/open" nil fpath))))
|
||||
|
||||
(provide 'module-write)
|
||||
;;; module-write.el ends here
|
||||
(provide 'extra-write)
|
||||
;;; extra-write.el ends here
|
|
@ -7,7 +7,7 @@
|
|||
;; LaunchBar: https://www.obdev.at/products/launchbar
|
||||
;;
|
||||
|
||||
(define-project-type! lb6 "lb6"
|
||||
(def-project-type! lb6 "lb6"
|
||||
:match "\\.lb\\(action\\|ext\\)/.+$"
|
||||
:build (lambda ()
|
||||
(awhen (f-traverse-upwards (lambda (f) (f-ext? f "lbaction")))
|
||||
|
@ -21,12 +21,14 @@
|
|||
;; TODO Set up emacs task runners for fruitstrap
|
||||
(use-package swift-mode
|
||||
:mode "\\.swift$"
|
||||
:init (add-hook 'swift-mode-hook 'flycheck-mode)
|
||||
:init
|
||||
(def-company-backend! swift-mode (sourcekit yasnippet))
|
||||
(add-hook 'swift-mode-hook 'flycheck-mode)
|
||||
:config
|
||||
(after! flycheck (push 'swift flycheck-checkers))
|
||||
(push 'swift flycheck-checkers))
|
||||
|
||||
(require 'company-sourcekit)
|
||||
(define-company-backend! swift-mode (sourcekit yasnippet)))
|
||||
(use-package company-sourcekit
|
||||
:after swift-mode)
|
||||
|
||||
(provide 'module-apple)
|
||||
;;; module-apple.el ends here
|
||||
|
|
|
@ -1,61 +1,13 @@
|
|||
;;; module-cc.el --- C, C++, and Objective-C
|
||||
|
||||
(use-package cmake-mode
|
||||
:mode "CMakeLists\\.txt$"
|
||||
:config
|
||||
(require 'company-cmake)
|
||||
(define-company-backend! cmake-mode (cmake yasnippet)))
|
||||
|
||||
(use-package glsl-mode :mode ("\\.glsl\\'" "\\.vert\\'" "\\.frag\\'" "\\.geom\\'"))
|
||||
|
||||
(use-package cuda-mode :mode "\\.cuh?$")
|
||||
|
||||
(use-package cc-mode
|
||||
:defines (c-syntactic-context)
|
||||
:functions (c-toggle-electric-state c-toggle-auto-newline
|
||||
c-skip-comments-and-strings c-forward-sws c-end-of-macro
|
||||
c-font-lock-invalid-string csharp-log c-font-lock-declarators
|
||||
c-get-lang-constant c-forward-keyword-clause
|
||||
c-fontify-recorded-types-and-refs c-forward-type imenu--split
|
||||
c-backward-sws c-determine-limit c-beginning-of-decl-1)
|
||||
:commands (c-mode c++-mode objc-mode java-mode)
|
||||
:init
|
||||
(associate! objc-mode :match "\\.mm$")
|
||||
(def-electric! (c-mode c++-mode objc-mode) :chars (?\n ?\}))
|
||||
(def-company-backend! (c-mode c++-mode objc-mode) (irony-c-headers irony))
|
||||
(add-hook! 'c++-mode-hook '(highlight-numbers-mode narf|init-c++-C11-highlights))
|
||||
(add-hook 'c-initialization-hook 'narf|init-c/c++-settings)
|
||||
(add-hook 'c++-mode-hook 'highlight-numbers-mode)
|
||||
(add-hook 'c++-mode-hook 'narf|init-c++-C11-highlights)
|
||||
:config
|
||||
(setq c-tab-always-indent nil
|
||||
c-electric-flag nil)
|
||||
|
||||
(map! :map c-mode-base-map
|
||||
(:localleader :nv ";" 'narf/append-semicolon))
|
||||
|
||||
(define-text-object! "<" "<" ">")
|
||||
(sp-local-pair '(c-mode c++-mode) "<" ">" :when '(narf/sp-point-is-template-p narf/sp-point-after-include-p))
|
||||
(sp-with-modes '(c-mode c++-mode objc-mode java-mode)
|
||||
(sp-local-pair "/*" "*/" :post-handlers '(("||\n[i]" "RET") ("| " "SPC")))
|
||||
;; Doxygen blocks
|
||||
(sp-local-pair "/**" "*/" :post-handlers '(("||\n[i]" "RET") ("||\n[i]" "SPC")))
|
||||
(sp-local-pair "/*!" "*/" :post-handlers '(("||\n[i]" "RET") ("[d-1]< | " "SPC"))))
|
||||
|
||||
(add-hook! (c-mode c++-mode objc-mode)
|
||||
(electric-indent-local-mode +1)
|
||||
(setq electric-indent-chars '(?\n ?})))
|
||||
|
||||
;; C/C++
|
||||
(advice-add 'c-lineup-arglist :around 'narf/c-lineup-arglist)
|
||||
(defun narf/c-lineup-arglist (orig-fun &rest args)
|
||||
"Improve indentation of continued C++11 lambda function opened as argument."
|
||||
(if (and (eq major-mode 'c++-mode)
|
||||
(ignore-errors
|
||||
(save-excursion
|
||||
(goto-char (c-langelem-pos langelem))
|
||||
;; Detect "[...](" or "[...]{". preceded by "," or "(",
|
||||
;; and with unclosed brace.
|
||||
(looking-at ".*[(,][ \t]*\\[[^]]*\\][ \t]*[({][^}]*$"))))
|
||||
0 ; no additional indent
|
||||
(apply orig-fun args)))
|
||||
|
||||
;; C++ header files
|
||||
(push `(,(lambda () (and (f-ext? buffer-file-name "h")
|
||||
|
@ -71,21 +23,34 @@
|
|||
. objc-mode)
|
||||
magic-mode-alist)
|
||||
|
||||
:config
|
||||
(setq c-tab-always-indent nil
|
||||
c-electric-flag nil)
|
||||
|
||||
(map! :map c-mode-base-map (:localleader :nv ";" 'narf/append-semicolon))
|
||||
|
||||
(def-textobj! "<" "<" ">")
|
||||
(sp-with-modes '(c-mode c++-mode objc-mode java-mode)
|
||||
(sp-local-pair "<" ">" :when '(narf/sp-point-is-template-p narf/sp-point-after-include-p))
|
||||
(sp-local-pair "/*" "*/" :post-handlers '(("||\n[i]" "RET") ("| " "SPC")))
|
||||
;; Doxygen blocks
|
||||
(sp-local-pair "/**" "*/" :post-handlers '(("||\n[i]" "RET") ("||\n[i]" "SPC")))
|
||||
(sp-local-pair "/*!" "*/" :post-handlers '(("||\n[i]" "RET") ("[d-1]< | " "SPC"))))
|
||||
|
||||
;; Improve indentation of inline lambdas in C++11
|
||||
(advice-add 'c-lineup-arglist :around 'narf/c-lineup-arglist))
|
||||
|
||||
(use-package irony
|
||||
:after cc-mode
|
||||
:config
|
||||
(setq irony-server-install-prefix (concat narf-temp-dir "/irony/"))
|
||||
(push "-std=c++11" irony-additional-clang-options)
|
||||
|
||||
(require 'irony-eldoc)
|
||||
|
||||
(require 'flycheck-irony)
|
||||
(flycheck-irony-setup)
|
||||
|
||||
(require 'company-irony)
|
||||
(require 'company-irony-c-headers)
|
||||
(define-company-backend! c-mode (irony-c-headers irony))
|
||||
(define-company-backend! c++-mode (irony-c-headers irony))
|
||||
(define-company-backend! objc-mode (irony-c-headers irony))
|
||||
(require 'flycheck-irony)
|
||||
(flycheck-irony-setup)
|
||||
|
||||
;; some c-mode dervied modes wrongfully trigger these hooks (like php-mode)
|
||||
(add-hook! (c-mode c++-mode ojbc-mode)
|
||||
|
@ -93,7 +58,19 @@
|
|||
(flycheck-mode +1)
|
||||
(irony-mode +1)
|
||||
(eldoc-mode +1)
|
||||
(irony-eldoc +1)))))
|
||||
(irony-eldoc +1))))
|
||||
|
||||
(use-package disaster :commands (disaster))
|
||||
|
||||
;;
|
||||
(use-package cmake-mode
|
||||
:mode "CMakeLists\\.txt$"
|
||||
:init (def-company-backend! cmake-mode (cmake yasnippet)))
|
||||
(use-package company-cmake :after cmake-mode)
|
||||
|
||||
(use-package glsl-mode :mode ("\\.glsl\\'" "\\.vert\\'" "\\.frag\\'" "\\.geom\\'"))
|
||||
|
||||
(use-package cuda-mode :mode "\\.cuh?$")
|
||||
|
||||
(provide 'module-cc)
|
||||
;;; module-cc.el ends here
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
;;; module-csharp.el
|
||||
|
||||
(use-package csharp-mode
|
||||
:functions (csharp-log)
|
||||
:mode "\\.cs$"
|
||||
:init (add-hook 'csharp-mode-hook 'flycheck-mode))
|
||||
|
||||
;; unity shaders
|
||||
(use-package shader-mode :mode "\\.shader$")
|
||||
(use-package shader-mode :mode "\\.shader$") ; unity shaders
|
||||
|
||||
(use-package omnisharp
|
||||
:commands (omnisharp-mode)
|
||||
|
@ -15,7 +13,8 @@
|
|||
omnisharp-server-executable-path (concat narf-ext-dir "/OmniSharp.exe"))
|
||||
:when (file-exists-p omnisharp-server-executable-path)
|
||||
:init
|
||||
(add-hook! csharp-mode '(emr-initialize omnisharp-mode))
|
||||
(def-company-backend! csharp-mode (omnisharp))
|
||||
(add-hook! csharp-mode '(turn-on-eldoc-mode emr-initialize omnisharp-mode))
|
||||
:config
|
||||
(map! :map omnisharp-mode-map
|
||||
"gd" 'omnisharp-go-to-definition
|
||||
|
@ -24,9 +23,6 @@
|
|||
"ts" (λ! (omnisharp-unit-test "single"))
|
||||
"ta" (λ! (omnisharp-unit-test "all"))))
|
||||
|
||||
(define-company-backend! csharp-mode (omnisharp))
|
||||
(add-hook! csharp-mode 'turn-on-eldoc-mode)
|
||||
|
||||
;; Map all refactor commands (see emr)
|
||||
(mapc (lambda (x)
|
||||
(let ((command-name (car x))
|
||||
|
|
|
@ -1,17 +1,24 @@
|
|||
;;; module-go.el
|
||||
|
||||
(use-package gorepl-mode :commands (gorepl-run gorepl-run-load-current-file))
|
||||
|
||||
(use-package go-mode
|
||||
:mode "\\.go$"
|
||||
:interpreter "go"
|
||||
:init
|
||||
(add-hook! go-mode '(emr-initialize flycheck-mode))
|
||||
(define-builder! go-mode "go build")
|
||||
(define-repl! go-mode gorepl-run)
|
||||
(def-builder! go-mode "go build")
|
||||
(def-company-backend! go-mode (go yasnippet))
|
||||
(def-repl! go-mode gorepl-run)
|
||||
(add-hook! go-mode '(emr-initialize flycheck-mode go-eldoc-setup))
|
||||
|
||||
:config
|
||||
(after! emr
|
||||
(map! :map go-mode-map
|
||||
:n "gd" 'godef-jump
|
||||
:n "gD" 'godef-describe
|
||||
(:localleader
|
||||
:n "p" 'helm-go-package
|
||||
:n "tr" 'narf:go-test-run-all
|
||||
:n "ta" 'narf:go-test-run-all
|
||||
:n "ts" 'narf:go-test-run-package))
|
||||
|
||||
(mapc (lambda (x)
|
||||
(let ((command-name (car x))
|
||||
(title (cadr x))
|
||||
|
@ -26,23 +33,13 @@
|
|||
'((go-remove-unused-imports "Remove unushed imports" nil)
|
||||
(gofmt "Format code" nil))))
|
||||
|
||||
(after! helm
|
||||
(use-package helm-go-package :defer t))
|
||||
(use-package go-eldoc :after go-mode)
|
||||
|
||||
(require 'go-eldoc)
|
||||
(add-hook 'go-mode-hook 'go-eldoc-setup)
|
||||
(use-package company-go :after go-mode)
|
||||
|
||||
(require 'company-go)
|
||||
(define-company-backend! go-mode (go yasnippet))
|
||||
(use-package gorepl-mode :commands (gorepl-run gorepl-run-load-current-file))
|
||||
|
||||
(map! :map go-mode-map
|
||||
:n "gd" 'godef-jump
|
||||
:n "gD" 'godef-describe
|
||||
(:localleader
|
||||
:n "p" 'helm-go-package
|
||||
:n "tr" 'narf:go-test-run-all
|
||||
:n "ta" 'narf:go-test-run-all
|
||||
:n "ts" 'narf:go-test-run-package)))
|
||||
(use-package helm-go-package :commands helm-go-package)
|
||||
|
||||
(provide 'module-go)
|
||||
;;; module-go.el ends here
|
||||
|
|
|
@ -7,14 +7,13 @@
|
|||
:interpreter (("runghc" . haskell-mode)
|
||||
("runhaskell" . haskell-mode))
|
||||
:init
|
||||
(define-repl! haskell-mode switch-to-haskell)
|
||||
(def-repl! haskell-mode switch-to-haskell)
|
||||
(add-hook! haskell-mode '(interactive-haskell-mode flycheck-mode))
|
||||
:config
|
||||
(push ".hi" completion-ignored-extensions))
|
||||
|
||||
(use-package inf-haskell
|
||||
:commands (inferior-haskell-mode inf-haskell-mode switch-to-haskell)
|
||||
:init (evil-set-initial-state 'inferior-haskell-mode 'emacs)
|
||||
:config
|
||||
(map! :map inf-haskell-mode-map "ESC ESC" 'narf/popup-close))
|
||||
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
;;; module-java.el --- the poster child for carpal tunnel
|
||||
|
||||
(define-docset! java-mode "java,droid,javafx,grails,groovy,playjava,spring,cvj,processing,javadoc")
|
||||
(def-docset! java-mode "java,droid,javafx,grails,groovy,playjava,spring,cvj,processing,javadoc")
|
||||
|
||||
(use-package eclim
|
||||
:functions (eclim--project-dir eclim--project-name)
|
||||
:commands (eclim-mode global-eclim-mode)
|
||||
:init
|
||||
:preface
|
||||
(setq eclim-eclipse-dirs '("/Applications/eclipse")
|
||||
eclim-executable "/Applications/eclipse/eclim")
|
||||
(when (file-exists-p eclim-executable)
|
||||
(add-hook 'java-mode-hook 'eclim-mode))
|
||||
:when (file-exists-p eclim-executable)
|
||||
:init (add-hook 'java-mode-hook 'eclim-mode)
|
||||
:config
|
||||
;; (require 'eclim-ant)
|
||||
;; (require 'eclim-maven)
|
||||
|
@ -20,25 +20,24 @@
|
|||
(setq help-at-pt-timer-delay 0.1)
|
||||
(help-at-pt-set-timer)
|
||||
|
||||
(use-package company-emacs-eclim
|
||||
:functions company-emacs-eclim-setup
|
||||
:config (company-emacs-eclim-setup))
|
||||
|
||||
(map! :map java-mode-map :m "gd" 'eclim-java-find-declaration))
|
||||
|
||||
(use-package company-emacs-eclim
|
||||
:after eclim
|
||||
:config (company-emacs-eclim-setup))
|
||||
|
||||
(use-package android-mode
|
||||
:commands android-mode
|
||||
:init
|
||||
(after! company-dict (add-to-list 'company-dict-minor-mode-list 'android-mode))
|
||||
(def-yas-mode! 'android-mode)
|
||||
(add-hook! (java-mode groovy-mode nxml-mode) 'narf|android-mode-enable-maybe)
|
||||
(add-hook! android-mode (add-yas-minor-mode! 'android-mode)))
|
||||
:config
|
||||
(after! company-dict
|
||||
(push 'android-mode company-dict-minor-mode-list)))
|
||||
|
||||
(use-package groovy-mode
|
||||
:functions (is-groovy-mode)
|
||||
:mode "\\.g\\(radle\\|vy\\|roovy\\)$")
|
||||
(use-package groovy-mode :mode "\\.g\\(radle\\|vy\\|roovy\\)$")
|
||||
|
||||
(use-package scala-mode2
|
||||
:mode ("\\.s\\(cala\\|bt\\)$" . scala-mode))
|
||||
(use-package scala-mode2 :mode ("\\.s\\(cala\\|bt\\)$" . scala-mode))
|
||||
|
||||
(provide 'module-java)
|
||||
;;; module-java.el ends here
|
||||
|
|
|
@ -4,15 +4,11 @@
|
|||
:mode "\\.js$"
|
||||
:interpreter "node"
|
||||
:init
|
||||
(add-hook 'js2-mode-hook '(tern-mode emr-initialize))
|
||||
(define-repl! js2-mode nodejs-repl)
|
||||
(define-docset! js2-mode "js,javascript,nodejs,angularjs,express,jquery,mongoose")
|
||||
(define-company-backend! js2-mode (tern))
|
||||
|
||||
(add-hook! js2-mode
|
||||
(electric-indent-local-mode +1)
|
||||
(setq electric-indent-chars '(?} ?\) ?.)
|
||||
narf-electric-indent-words '("||" "&&")))
|
||||
(def-repl! js2-mode nodejs-repl)
|
||||
(def-docset! js2-mode "js,javascript,nodejs,angularjs,express,jquery,mongoose")
|
||||
(def-company-backend! js2-mode (tern))
|
||||
(def-electric! js2-mode :chars (?\} ?\) ?.) :words ("||" "&&"))
|
||||
(add-hook! js2-mode '(tern-mode emr-initialize))
|
||||
|
||||
:config
|
||||
(setq-default
|
||||
|
@ -25,17 +21,21 @@
|
|||
;; Launchbar API
|
||||
"LaunchBar" "File" "Action" "HTTP" "include" "Lib"))
|
||||
|
||||
(require 'tern)
|
||||
(require 'company-tern)
|
||||
|
||||
;; [pedantry intensifies]
|
||||
(defadvice js2-mode (after js2-mode-rename-modeline activate)
|
||||
(setq mode-name "JS2"))
|
||||
(add-hook! js2-mode (setq mode-name "JS2"))
|
||||
|
||||
(map! :map js2-mode-map (:localleader :nv ";" 'narf/append-semicolon))
|
||||
(map! :map js2-mode-map (:localleader :nv ";" 'narf/append-semicolon)))
|
||||
|
||||
(require 'js2-refactor)
|
||||
(require 'emr)
|
||||
(use-package tern
|
||||
:after js2-mode
|
||||
:commands (tern-mode))
|
||||
|
||||
(use-package company-tern
|
||||
:after tern)
|
||||
|
||||
(use-package js2-refactor
|
||||
:after js2-mode
|
||||
:config
|
||||
(mapc (lambda (x)
|
||||
(let ((command-name (car x))
|
||||
(title (cadr x))
|
||||
|
@ -75,6 +75,9 @@
|
|||
(forward-slurp "forward slurp" nil)
|
||||
(forward-barf "forward barf" nil))))
|
||||
|
||||
(use-package nodejs-repl :commands (nodejs-repl))
|
||||
|
||||
;;
|
||||
(use-package jsx-mode :mode "\\.jsx$")
|
||||
|
||||
(use-package unityjs-mode
|
||||
|
@ -85,25 +88,21 @@
|
|||
:mode "\\.coffee$"
|
||||
:config (setq-default coffee-indent-like-python-mode t))
|
||||
|
||||
(use-package nodejs-repl
|
||||
:commands (nodejs-repl)
|
||||
:config (evil-set-initial-state 'nodejs-repl-mode 'emacs))
|
||||
|
||||
;;
|
||||
(define-project-type! nodejs "node"
|
||||
(def-project-type! nodejs "node"
|
||||
:modes (web-mode js-mode js2-mode json-mode coffee-mode scss-mode sass-mode less-css-mode)
|
||||
:files ("package.json"))
|
||||
|
||||
(define-project-type! angularjs "angular"
|
||||
(def-project-type! angularjs "angular"
|
||||
:modes (web-mode js-mode js2-mode json-mode coffee-mode scss-mode sass-mode less-css-mode)
|
||||
:files ("public/libraries/angular/"))
|
||||
|
||||
(define-project-type! electron "electron"
|
||||
(def-project-type! electron "electron"
|
||||
:modes (nodejs-project-mode)
|
||||
:files ("app/index.html" "app/main.js"))
|
||||
;; TODO electron-compile support
|
||||
|
||||
(define-project-type! expressjs "express"
|
||||
(def-project-type! expressjs "express"
|
||||
:modes (nodejs-project-mode)
|
||||
:files ("node_modules/express/"))
|
||||
|
||||
|
|
|
@ -3,10 +3,7 @@
|
|||
(use-package julia-mode
|
||||
:mode "\\.jl$"
|
||||
:interpreter "julia"
|
||||
:init
|
||||
(define-repl! julia-mode narf/julia-repl)
|
||||
(evil-set-initial-state 'inferior-julia-mode 'emacs)
|
||||
(push '(julia-mode julia-indent-offset) editorconfig-indentation-alist))
|
||||
:init (def-repl! julia-mode narf/julia-repl))
|
||||
|
||||
(provide 'module-julia)
|
||||
;;; module-julia.el ends here
|
||||
|
|
|
@ -1,18 +1,30 @@
|
|||
;;; module-lisp --- all things lisp
|
||||
|
||||
(add-hook! emacs-lisp-mode
|
||||
'(turn-on-eldoc-mode flycheck-mode highlight-numbers-mode highlight-quoted-mode))
|
||||
|
||||
;; Pop-up REPL
|
||||
(define-repl! emacs-lisp-mode narf/elisp-inf-ielm)
|
||||
|
||||
(use-package highlight-quoted :commands (highlight-quoted-mode))
|
||||
|
||||
;; 'Emacs Lisp' is too long [pedantry intensifies]
|
||||
(defadvice emacs-lisp-mode (after emacs-lisp-mode-rename-modeline activate)
|
||||
(setq mode-name "Elisp"))
|
||||
(associate! emacs-lisp-mode :match "\\(/Cask\\|\\.\\(el\\|gz\\)\\)$")
|
||||
(def-company-backend! emacs-lisp-mode (elisp yasnippet))
|
||||
(def-repl! emacs-lisp-mode narf/elisp-inf-ielm)
|
||||
|
||||
(add-hook! emacs-lisp-mode
|
||||
'(turn-on-eldoc-mode flycheck-mode highlight-numbers-mode))
|
||||
|
||||
;; Real go-to-definition for elisp
|
||||
(map! :map emacs-lisp-mode-map :m "gd" 'narf/elisp-find-function-at-pt)
|
||||
|
||||
(use-package highlight-quoted
|
||||
:commands (highlight-quoted-mode)
|
||||
:init (add-hook 'emacs-lisp-mode-hook 'highlight-quoted-mode))
|
||||
|
||||
(use-package slime :defer t
|
||||
:config (setq inferior-lisp-program "clisp"))
|
||||
|
||||
;; Don't affect lisp indentation (only `tab-width')
|
||||
(setq editorconfig-indentation-alist
|
||||
(delq (assq 'emacs-lisp-mode editorconfig-indentation-alist)
|
||||
editorconfig-indentation-alist))
|
||||
|
||||
(add-hook! emacs-lisp-mode
|
||||
(setq mode-name "Elisp") ; [pedantry intensifies]
|
||||
|
||||
(add-hook 'before-save-hook 'delete-trailing-whitespace nil t)
|
||||
(add-hook 'after-save-hook 'narf/elisp-auto-compile nil t)
|
||||
|
||||
|
@ -56,16 +68,18 @@
|
|||
'emacs-lisp-mode `(("(\\(lambda\\)"
|
||||
(1 (narf/show-as ?λ)))
|
||||
;; Highlight narf macros (macros are fontified in emacs 25+)
|
||||
(,(concat
|
||||
"(\\(def-"
|
||||
(regexp-opt '("electric" "project-type" "company-backend"
|
||||
"builder" "repl" "textobj" "tmp-excmd"
|
||||
"repeat" "yas-mode" "env-command" "docset"))
|
||||
"!\\)")
|
||||
(1 font-lock-keyword-face append))
|
||||
(,(concat
|
||||
"(\\("
|
||||
(regexp-opt '("λ" "in" "map" "after" "exmap" "shut-up" "add-hook"
|
||||
"associate" "open-with" "define-repl"
|
||||
"define-builder" "narf-space-setup"
|
||||
"define-env-command" "define-text-object"
|
||||
"add-yas-minor-mode" "define-docset"
|
||||
"define-org-link" "define-company-backend"
|
||||
"define-org-section" "define-temp-ex-cmd"
|
||||
"define-project-type"))
|
||||
(regexp-opt '("λ" "in" "map" "after" "shut-up" "add-hook"
|
||||
"associate" "open-with" "define-org-link"
|
||||
"define-org-section"))
|
||||
"!\\)")
|
||||
(1 font-lock-keyword-face append))
|
||||
;; Ert
|
||||
|
@ -77,19 +91,14 @@
|
|||
(2 font-lock-function-name-face))))
|
||||
|
||||
;;
|
||||
(use-package slime :defer t
|
||||
:config (setq inferior-lisp-program "clisp"))
|
||||
|
||||
;; Real go-to-definition for elisp
|
||||
(map! :map emacs-lisp-mode-map :m "gd" 'narf/elisp-find-function-at-pt)
|
||||
|
||||
(define-project-type! emacs-ert "ert"
|
||||
(def-project-type! emacs-ert "ert"
|
||||
:modes (emacs-lisp-mode)
|
||||
:match "/test/.+-test\\.el$"
|
||||
:bind (:localleader
|
||||
:n "tr" 'narf/ert-rerun-test
|
||||
:n "ta" 'narf/ert-run-all-tests
|
||||
:n "ts" 'narf/ert-run-test))
|
||||
:n "ts" 'narf/ert-run-test)
|
||||
(add-hook 'ert-results-mode-hook 'narf|hide-mode-line))
|
||||
|
||||
(provide 'module-lisp)
|
||||
;;; module-elisp.el ends here
|
||||
|
|
|
@ -4,12 +4,11 @@
|
|||
:mode "\\.lua$"
|
||||
:interpreter "lua"
|
||||
:init
|
||||
(define-repl! lua-mode narf/inf-lua)
|
||||
(define-company-backend! lua-mode (yasnippet))
|
||||
(def-company-backend! lua-mode (yasnippet))
|
||||
(def-electric! lua-mode :words ("else" "end"))
|
||||
(def-repl! lua-mode narf/inf-lua)
|
||||
(add-hook 'lua-mode-hook 'flycheck-mode)
|
||||
(add-hook! lua-mode
|
||||
(electric-indent-local-mode +1)
|
||||
(setq narf-electric-indent-words '("else" "end")))
|
||||
|
||||
:config
|
||||
(sp-with-modes '(lua-mode)
|
||||
;; disable defaults
|
||||
|
@ -28,12 +27,12 @@
|
|||
(sp-local-pair "function " " end" :unless '(sp-point-after-bol-p))))
|
||||
|
||||
;;
|
||||
(define-project-type! love "♥"
|
||||
(def-project-type! love "♥"
|
||||
:modes (lua-mode markdown-mode json-mode)
|
||||
:files ("main.lua" "conf.lua")
|
||||
:build ("open -a love.app '%s'" "main.lua"))
|
||||
|
||||
(define-project-type! hammerspoon "hammer"
|
||||
(def-project-type! hammerspoon "hammer"
|
||||
:modes (lua-mode markdown-mode)
|
||||
:match "/\\.?hammerspoon/.+\\.lua$"
|
||||
:build "open hammerspoon://reload")
|
||||
|
|
|
@ -2,26 +2,42 @@
|
|||
|
||||
(use-package hack-mode
|
||||
:mode "\\.hh$"
|
||||
:config (define-company-backend! hack-mode (capf)))
|
||||
:init (def-company-backend! hack-mode (capf)))
|
||||
|
||||
(use-package php-mode
|
||||
:mode ("\\.php[s345]?$" "\\.inc$" )
|
||||
:interpreter "php"
|
||||
:init
|
||||
(define-docset! php-mode "php,laravel")
|
||||
(define-company-backend! php-mode '(php-extras-company))
|
||||
|
||||
(def-repl! php-mode php-boris)
|
||||
(def-docset! php-mode "php,laravel")
|
||||
(def-company-backend! php-mode '(company-ac-php-backend php-extras-company))
|
||||
(add-hook 'php-mode-hook 'flycheck-mode)
|
||||
(setq php-template-compatibility nil
|
||||
php-extras-eldoc-functions-file (concat narf-temp-dir "/php-extras-eldoc-functions"))
|
||||
:config
|
||||
(require 'php-extras)
|
||||
(defun php-extras-company-setup ()) ;; company will set up itself
|
||||
|
||||
:config
|
||||
(map! :map php-mode-map (:localleader :nv ";" 'narf/append-semicolon))
|
||||
|
||||
(sp-with-modes '(php-mode)
|
||||
(sp-local-pair "/*" "*/" :post-handlers '(("||\n[i]" "RET") ("| " "SPC")))
|
||||
(sp-local-pair "/**" "*/" :post-handlers '(("||\n[i]" "RET") ("||\n[i]" "SPC")))
|
||||
(sp-local-pair "<? " " ?>")
|
||||
(sp-local-pair "<?php " " ?>")
|
||||
(sp-local-pair "<?=" " ?>")
|
||||
(sp-local-pair "<?" "?>" :when '(("RET")) :post-handlers '("||\n[i]"))
|
||||
(sp-local-pair "<?php" "?>" :when '(("RET")) :post-handlers '("||\n[i]"))))
|
||||
|
||||
(use-package ac-php-company
|
||||
:after php-mode
|
||||
:config
|
||||
(map! :map php-mode-map
|
||||
(:localleader :nv ";" 'narf/append-semicolon)
|
||||
:n "gd" 'ac-php-find-symbol-at-point
|
||||
:n "gD" 'ac-php-location-stack-back)
|
||||
:n "gD" 'ac-php-location-stack-back))
|
||||
|
||||
(use-package php-extras
|
||||
:after php-mode
|
||||
:config
|
||||
(defun php-extras-company-setup ()) ;; company will set up itself
|
||||
|
||||
;; Generate php-extras documentation and completion asynchronously
|
||||
(unless (file-exists-p (concat php-extras-eldoc-functions-file ".el"))
|
||||
|
@ -31,18 +47,10 @@
|
|||
(php-extras-generate-eldoc-1 t))
|
||||
(lambda (_)
|
||||
(load (concat php-extras-eldoc-functions-file ".el"))
|
||||
(message "PHP eldoc updated!"))))
|
||||
|
||||
(sp-with-modes '(php-mode)
|
||||
(sp-local-pair "/*" "*/" :post-handlers '(("||\n[i]" "RET") ("| " "SPC")))
|
||||
(sp-local-pair "/**" "*/" :post-handlers '(("||\n[i]" "RET") ("||\n[i]" "SPC")))
|
||||
(sp-local-pair "<? " " ?>")
|
||||
(sp-local-pair "<?php " " ?>")
|
||||
(sp-local-pair "<?=" " ?>")
|
||||
(sp-local-pair "<?" "?>" :when '(("RET")) :post-handlers '("||\n[i]"))
|
||||
(sp-local-pair "<?php" "?>" :when '(("RET")) :post-handlers '("||\n[i]")))
|
||||
(message "PHP eldoc updated!")))))
|
||||
|
||||
(use-package php-refactor-mode
|
||||
:after php-mode
|
||||
:init (add-hook! php-mode '(turn-on-eldoc-mode emr-initialize php-refactor-mode))
|
||||
:config
|
||||
(mapc (lambda (x)
|
||||
|
@ -59,15 +67,12 @@
|
|||
'((convert-local-to-instance-variable "convert local var to instance var" nil)
|
||||
(optimize-use "optimize FQNs in file" nil)
|
||||
(extract-method "extract method" t)
|
||||
(rename-local-variable "rename local variable" nil)))))
|
||||
(rename-local-variable "rename local variable" nil))))
|
||||
|
||||
;; PHP Repl
|
||||
(use-package php-boris :defer t
|
||||
:init (define-repl! php-mode php-boris)
|
||||
:config (evil-set-initial-state 'php-boris-mode 'emacs))
|
||||
(use-package php-boris :commands php-boris) ; PHP REPL
|
||||
|
||||
;;
|
||||
(define-project-type! laravel "laravel"
|
||||
(def-project-type! laravel "laravel"
|
||||
:modes (php-mode yaml-mode web-mode nxml-mode js2-mode scss-mode)
|
||||
:files ("artisan" "server.php"))
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
:commands (processing-mode processing-find-sketch)
|
||||
:mode "\\.pde$"
|
||||
:init
|
||||
(define-builder! processing-mode processing-sketch-build)
|
||||
(def-builder! processing-mode processing-sketch-build)
|
||||
(add-hook 'processing-compilation-mode-hook 'narf|hide-mode-line)
|
||||
|
||||
:config
|
||||
|
@ -14,14 +14,6 @@
|
|||
processing-sketchbook-dir "~/Dropbox/work/pde"
|
||||
processing-output-dir "/tmp")
|
||||
|
||||
(after! quickrun
|
||||
(quickrun-add-command
|
||||
"processing" `((:command . ,processing-location)
|
||||
(:exec . (lambda () (format "--sketch=%s --output=%s --force --run"
|
||||
(narf/project-root) processing-output-dir)))
|
||||
(:description . "Run Processing sketch"))
|
||||
:mode 'processing-mode))
|
||||
|
||||
(map! :map processing-mode-map
|
||||
:nv "M-r" 'processing-sketch-run
|
||||
:m "gd" 'processing-find-in-reference
|
||||
|
@ -32,6 +24,14 @@
|
|||
"e" 'processing-open-examples
|
||||
"o" 'processing-open-sketchbook))
|
||||
|
||||
(after! quickrun
|
||||
(quickrun-add-command
|
||||
"processing" `((:command . ,processing-location)
|
||||
(:exec . (lambda () (format "--sketch=%s --output=%s --force --run"
|
||||
(narf/project-root) processing-output-dir)))
|
||||
(:description . "Run Processing sketch"))
|
||||
:mode 'processing-mode))
|
||||
|
||||
(add-hook! processing-mode
|
||||
(setq-local company-backends '((company-keywords
|
||||
:with
|
||||
|
|
|
@ -17,15 +17,17 @@
|
|||
python-shell-completion-string-code
|
||||
"';'.join(get_ipython().Completer.all_completions('''%s'''))\n")
|
||||
|
||||
(define-docset! python-mode "py,py3,python")
|
||||
(define-env-command! python-mode "python --version 2>&1 | cut -d' ' -f2")
|
||||
(define-repl! python-mode narf/inf-python)
|
||||
(add-hook! python-mode '(emr-initialize narf|flycheck-enable-maybe))
|
||||
(def-company-backend! python-mode (anaconda))
|
||||
(def-docset! python-mode "py,py3,python")
|
||||
(def-env-command! python-mode "python --version 2>&1 | cut -d' ' -f2")
|
||||
(def-repl! python-mode narf/inf-python)
|
||||
(add-hook 'python-mode-hook 'flycheck-mode)
|
||||
|
||||
:config
|
||||
(define-key python-mode-map (kbd "DEL") nil) ; interferes with smartparens
|
||||
(define-key python-mode-map (kbd "DEL") nil)) ; interferes with smartparens
|
||||
|
||||
(use-package anaconda-mode
|
||||
:after python
|
||||
:init
|
||||
(add-hook! python-mode '(anaconda-mode anaconda-eldoc-mode eldoc-mode))
|
||||
(setq anaconda-mode-installation-directory (concat narf-temp-dir "/anaconda/")
|
||||
|
@ -35,11 +37,12 @@
|
|||
(map! :map anaconda-mode-map :m "gd" 'anaconda-mode-find-definitions)
|
||||
(map! :map anaconda-nav-mode-map :n [escape] 'anaconda-nav-quit)
|
||||
|
||||
(advice-add 'anaconda-mode-doc-buffer :after 'narf*anaconda-mode-doc-buffer)
|
||||
(advice-add 'anaconda-mode-doc-buffer :after 'narf*anaconda-mode-doc-buffer))
|
||||
|
||||
(require 'company-anaconda)
|
||||
(define-company-backend! python-mode (anaconda))
|
||||
(after! emr
|
||||
(use-package company-anaconda
|
||||
:after anaconda-mode
|
||||
:init (add-hook 'anaconda-mode-hook 'emr-initialize)
|
||||
:config
|
||||
(mapc (lambda (x)
|
||||
(let ((command-name (car x))
|
||||
(title (cadr x))
|
||||
|
@ -54,18 +57,19 @@
|
|||
(find-assignments "find assignments" t)
|
||||
(find-definitions "find definitions" t)
|
||||
(find-file "find assignments" t)
|
||||
(find-references "show usages" nil))))))
|
||||
(find-references "show usages" nil))))
|
||||
|
||||
(use-package pip-requirements
|
||||
:mode ("/requirements.txt$" . pip-requirements-mode)
|
||||
:config (define-company-backend! pip-requirements-mode (capf)))
|
||||
:config (def-company-backend! pip-requirements-mode (capf)))
|
||||
|
||||
(use-package nose
|
||||
:commands nose-mode
|
||||
:preface (defvar nose-mode-map (make-sparse-keymap))
|
||||
:init (associate! nose-mode :match "/test_.+\\.py$" :in (python-mode))
|
||||
:init
|
||||
(associate! nose-mode :match "/test_.+\\.py$" :in (python-mode))
|
||||
(def-yas-mode! 'nose-mode)
|
||||
:config
|
||||
(add-yas-minor-mode! 'nose-mode)
|
||||
(map! :map nose-mode-map
|
||||
(:localleader
|
||||
:n "tr" 'nosetests-again
|
||||
|
|
|
@ -5,39 +5,24 @@
|
|||
"/\\(Gem\\|Cap\\|Vagrant\\|Rake\\)file$")
|
||||
:interpreter "ruby"
|
||||
:init
|
||||
(add-hook 'ruby-mode-hook 'flycheck-mode)
|
||||
(define-docset! ruby-mode "rb,ruby,rubygem")
|
||||
(define-builder! ruby-mode "rake %s" "Rakefile")
|
||||
(define-env-command! ruby-mode "ruby --version | cut -d' ' -f2")
|
||||
(define-company-backend! ruby-mode (dabbrev-code))
|
||||
(def-builder! ruby-mode "rake %s" "Rakefile")
|
||||
(def-company-backend! ruby-mode (dabbrev-code))
|
||||
(def-docset! ruby-mode "rb,ruby,rubygem")
|
||||
(def-env-command! ruby-mode "ruby --version | cut -d' ' -f2")
|
||||
(def-repl! ruby-mode inf-ruby)
|
||||
(def-electric! ruby-mode :words ("else" "end" "elseif"))
|
||||
(add-hook! 'ruby-mode-hook '(flycheck-mode yard-mode))
|
||||
|
||||
:config
|
||||
(setq ruby-deep-indent-paren t) ; Formatting
|
||||
(add-hook! ruby-mode
|
||||
(electric-indent-local-mode +1)
|
||||
(setq narf-electric-indent-words '("else" "end" "elseif")))
|
||||
|
||||
;; Don't interfere with my custom RET behavior
|
||||
(define-key ruby-mode-map [?\n] nil)
|
||||
|
||||
;; Highlight doc comments
|
||||
(use-package yard-mode :init (add-hook 'ruby-mode-hook 'yard-mode))
|
||||
|
||||
;; FIXME: Doesn't work
|
||||
;; (use-package robe
|
||||
;; :commands (robe-mode robe-start ruby-load-file company-robe)
|
||||
;; :init
|
||||
;; (add-hook! ruby-mode
|
||||
;; (narf|ruby-load-file)
|
||||
;; (add-hook 'after-save-hook 'narf|ruby-load-file nil t))
|
||||
;; (define-company-backend! ruby-mode (robe))
|
||||
;; :config
|
||||
;; (require 'company-robe))
|
||||
(define-key ruby-mode-map [?\n] nil))
|
||||
|
||||
(use-package ruby-refactor
|
||||
:after ruby-mode
|
||||
:init (add-hook 'ruby-mode-hook 'emr-initialize)
|
||||
:config
|
||||
(require 'emr)
|
||||
(mapc (lambda (x)
|
||||
(let ((command-name (car x))
|
||||
(title (cadr x))
|
||||
|
@ -55,7 +40,10 @@
|
|||
(refactor-extract-constant "extract constant" t)
|
||||
(refactor-add-parameter "add parameter" nil)
|
||||
(refactor-extract-to-let "extract to let" t)
|
||||
(refactor-convert-post-conditional "convert post conditional" t)))))
|
||||
(refactor-convert-post-conditional "convert post conditional" t))))
|
||||
|
||||
;; Highlight doc comments
|
||||
(use-package yard-mode :commands yard-mode)
|
||||
|
||||
(use-package rspec-mode
|
||||
:mode ("/\\.rspec$" . text-mode)
|
||||
|
@ -80,19 +68,13 @@
|
|||
|
||||
(use-package inf-ruby
|
||||
:commands (inf-ruby inf-ruby-console-auto)
|
||||
:init
|
||||
(define-repl! ruby-mode inf-ruby)
|
||||
(evil-set-initial-state 'inf-ruby-mode 'emacs)
|
||||
:config
|
||||
(require 'company-inf-ruby)
|
||||
(define-company-backend! inf-ruby-mode (inf-ruby)))
|
||||
:init (def-company-backend! inf-ruby-mode (inf-ruby)))
|
||||
|
||||
(use-package company-inf-ruby :after inf-ruby)
|
||||
|
||||
;;
|
||||
(define-project-type! rake "rake"
|
||||
(def-project-type! rake "rake"
|
||||
:files ("Rakefile"))
|
||||
|
||||
(define-project-type! vagrant "vagrant"
|
||||
:files ("Vagrantfile"))
|
||||
|
||||
(provide 'module-ruby)
|
||||
;;; module-ruby.el ends here
|
||||
|
|
|
@ -2,25 +2,25 @@
|
|||
|
||||
(use-package rust-mode
|
||||
:mode "\\.rs$"
|
||||
:config
|
||||
(define-builder! rust-mode "cargo run" "Cargo.toml")
|
||||
(define-builder! toml-mode "cargo run" "Cargo.toml")
|
||||
:init
|
||||
(def-builder! rust-mode "cargo run" "Cargo.toml")
|
||||
(def-builder! toml-mode "cargo run" "Cargo.toml")
|
||||
(add-hook 'rust-mode-hook 'flycheck-mode))
|
||||
|
||||
(require 'flycheck-rust)
|
||||
(add-hook 'rust-mode-hook 'flycheck-mode)
|
||||
(use-package flycheck-rust :after rust-mode)
|
||||
|
||||
(use-package racer
|
||||
:after rust-mode
|
||||
:preface
|
||||
(setq racer-cmd (concat narf-ext-dir "/racer")
|
||||
racer-rust-src-path (concat narf-ext-dir "/rust/src/"))
|
||||
:when (file-exists-p racer-cmd)
|
||||
:init
|
||||
(add-hook! rust-mode '(racer-mode eldoc-mode flycheck-rust-setup))
|
||||
:config
|
||||
(define-company-backend! rust-mode (racer))
|
||||
(map! :map rust-mode-map :m "gd" 'racer-find-definition)
|
||||
|
||||
;; TODO Unit test keybinds
|
||||
|
||||
(add-hook! rust-mode '(racer-mode eldoc-mode flycheck-rust-setup))))
|
||||
(def-company-backend! rust-mode (racer))
|
||||
(map! :map rust-mode-map :m "gd" 'racer-find-definition))
|
||||
|
||||
(provide 'module-rust)
|
||||
;;; module-rust.el ends here
|
||||
|
|
|
@ -3,20 +3,17 @@
|
|||
(associate! sh-mode :match "\\.\\(ba\\|z\\)sh$")
|
||||
(associate! sh-mode :match "/\\.?z\\(sh\\(/.*\\|$\\)\\|profile\\|login\\|logout\\|shrc\\|shenv\\)$")
|
||||
(associate! sh-mode :match "/\\.?bash\\(/.*\\|rc\\|_profile\\)$")
|
||||
(after! sh-script
|
||||
(define-repl! sh-mode narf/inf-shell)
|
||||
(def-electric! sh-mode :words ("else" "elif" "fi" "done"))
|
||||
|
||||
(after! sh-script
|
||||
(def-repl! sh-mode narf/inf-shell)
|
||||
(setq sh-indent-after-continuation 'always)
|
||||
|
||||
(add-hook 'sh-mode-hook 'flycheck-mode)
|
||||
(add-hook 'sh-mode-hook 'narf|sh-extra-font-lock-activate) ; Fontify variables in strings
|
||||
(add-hook! sh-mode (setq mode-name "sh")) ; [pedantry intensifies]
|
||||
(add-hook! sh-mode
|
||||
(electric-indent-local-mode +1)
|
||||
(setq narf-electric-indent-words '("else" "elif" "fi" "done")))
|
||||
|
||||
(require 'company-shell)
|
||||
(setq company-shell-delete-duplicates t)
|
||||
'(flycheck-mode
|
||||
;; Fontify variables in strings
|
||||
narf|sh-extra-font-lock-activate))
|
||||
|
||||
(sp-with-modes '(sh-mode)
|
||||
(sp-local-pair "case" "" :when '(("SPC")) :post-handlers '((:add narf/sp-insert-yasnippet)) :actions '(insert))
|
||||
|
@ -25,5 +22,9 @@
|
|||
(sp-local-pair "elif" "" :when '(("SPC")) :post-handlers '((:add narf/sp-insert-yasnippet)) :actions '(insert))
|
||||
(sp-local-pair "while" "" :when '(("SPC")) :post-handlers '((:add narf/sp-insert-yasnippet)) :actions '(insert))))
|
||||
|
||||
(use-package company-shell
|
||||
:after sh-script
|
||||
:config (setq company-shell-delete-duplicates t))
|
||||
|
||||
(provide 'module-sh)
|
||||
;;; module-sh.el ends here
|
||||
|
|
|
@ -2,8 +2,7 @@
|
|||
|
||||
(use-package markdown-mode
|
||||
:mode ("\\.md$" "/README$")
|
||||
:init
|
||||
(add-hook 'markdown-mode-hook 'turn-on-auto-fill)
|
||||
:init (add-hook 'markdown-mode-hook 'turn-on-auto-fill)
|
||||
:config
|
||||
(map! :map markdown-mode-map
|
||||
"<backspace>" nil
|
||||
|
@ -28,9 +27,45 @@
|
|||
:n "[p" 'markdown-promote
|
||||
:n "]p" 'markdown-demote
|
||||
|
||||
:i "M--" 'markdown-insert-hr)
|
||||
:i "M--" 'markdown-insert-hr))
|
||||
|
||||
(use-package markdown-toc :commands (markdown-toc-generate-toc)))
|
||||
(use-package markdown-toc :after markdown-mode)
|
||||
|
||||
(use-package reftex
|
||||
:config
|
||||
(add-hook 'latex-mode-hook 'turn-on-reftex)
|
||||
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
|
||||
(setq reftex-plug-into-AUCTeX t
|
||||
reftex-ref-style-default-list '("Cleveref" "Hyperref" "Fancyref")
|
||||
reftex-default-bibliography
|
||||
`(,(expand-file-name "phys.bib" write-mode-biblio-dir))))
|
||||
|
||||
(use-package helm-bibtex
|
||||
:defer t
|
||||
:init
|
||||
(setq TeX-auto-save t)
|
||||
(setq TeX-parse-self t)
|
||||
(setq bibtex-dialect 'biblatex)
|
||||
(setq bibtex-align-at-equal-sign t)
|
||||
(setq bibtex-text-indentation 20)
|
||||
(add-hook! bibtex-mode
|
||||
(local-set-key (kbd "C-c \\") 'bibtex-fill-entry)
|
||||
(setq fill-column 140))
|
||||
(add-hook! latex-mode 'turn-on-auto-fill)
|
||||
(add-hook! LaTeX-mode 'turn-on-auto-fill)
|
||||
|
||||
:config
|
||||
(setq helm-bibtex-bibliography
|
||||
`(,(expand-file-name "phys.bib" write-mode-biblio-dir))
|
||||
|
||||
helm-bibtex-library-path
|
||||
`(,(expand-file-name "phys-pdf" write-mode-biblio-dir))
|
||||
|
||||
helm-bibtex-notes-path (expand-file-name "notes" write-mode-biblio-dir)
|
||||
helm-bibtex-notes-extension ".org"
|
||||
|
||||
helm-bibtex-pdf-open-function
|
||||
(lambda (fpath) (async-start-process "open-pdf" "/usr/bin/open" nil fpath))))
|
||||
|
||||
(provide 'module-text)
|
||||
;;; module-text.el ends here
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
;;; module-web.el
|
||||
|
||||
(define-company-backend! sass-mode (css))
|
||||
(define-company-backend! scss-mode (css))
|
||||
(define-docset! scss-mode "sass,bourbon")
|
||||
(def-company-backend! sass-mode (css))
|
||||
(def-company-backend! scss-mode (css))
|
||||
(def-docset! scss-mode "sass,bourbon")
|
||||
(add-hook! (sass-mode scss-mode less-css-mode)
|
||||
'(flycheck-mode narf|hl-line-off hs-minor-mode))
|
||||
|
||||
|
@ -34,9 +34,6 @@
|
|||
:n ";" 'helm-css-scss
|
||||
:n ":" 'helm-css-scss-multi))
|
||||
|
||||
(after! web-beautify
|
||||
(map! :map scss-mode-map :m "gQ" 'web-beautify-css))
|
||||
|
||||
(after! emr
|
||||
(emr-declare-command 'narf/scss-toggle-inline-or-block
|
||||
:title "toggle inline/block"
|
||||
|
@ -44,21 +41,29 @@
|
|||
:predicate (lambda () (not (use-region-p))))))
|
||||
|
||||
(use-package jaded-mode
|
||||
:load-path "/Volumes/hlissner/Dropbox/work/plugins/jaded-mode"
|
||||
:mode "\\.jade$"
|
||||
:config
|
||||
(push '("jade" "html") projectile-other-file-alist)
|
||||
(map! :map jaded-mode-map
|
||||
:i [tab] 'narf/dumb-indent
|
||||
:i [backtab] 'narf/dumb-dedent))
|
||||
|
||||
(use-package web-mode
|
||||
:mode ("\\.\\(p\\)?htm\\(l\\)?$"
|
||||
:mode ("\\.p?html?$"
|
||||
"\\.\\(tpl\\|blade\\)\\(\\.php\\)?$"
|
||||
"\\.erb$"
|
||||
"\\.as[cp]x$"
|
||||
"\\.mustache$"
|
||||
"wp-content/themes/.+/.+\\.php$")
|
||||
:init
|
||||
(add-hook 'web-mode-hook 'turn-off-smartparens-mode)
|
||||
|
||||
:config
|
||||
(setq web-mode-enable-html-entities-fontification t
|
||||
web-mode-enable-current-column-highlight t)
|
||||
(push '("html" "jade") projectile-other-file-alist)
|
||||
|
||||
(map! :map web-mode-map :i "SPC" 'self-insert-command)
|
||||
|
||||
(after! nlinum
|
||||
|
@ -67,12 +72,11 @@
|
|||
|
||||
(map! :map web-mode-map
|
||||
"M-/" 'web-mode-comment-or-uncomment
|
||||
:n "M-r" 'narf/web-refresh-browser
|
||||
|
||||
:n "za" 'web-mode-fold-or-unfold
|
||||
(:localleader :n "t" 'web-mode-element-rename)
|
||||
|
||||
:n "M-r" 'narf/web-refresh-browser
|
||||
|
||||
:nv "]a" 'web-mode-attribute-next
|
||||
:nv "[a" 'web-mode-attribute-previous
|
||||
:nv "]t" 'web-mode-tag-next
|
||||
|
@ -81,15 +85,6 @@
|
|||
:nv "[T" 'web-mode-element-parent))
|
||||
|
||||
;;
|
||||
(use-package web-beautify
|
||||
:commands (web-beautify-js web-beautify-css web-beautify-html)
|
||||
:init
|
||||
(add-hook! (web-mode css-mode scss-mode sass-mode less-css-mode js2-mode)
|
||||
(setenv "jsbeautify_indent_size" (int-to-string tab-width)))
|
||||
(map! (:after web-mode :map web-mode-map :m "gQ" 'web-beautify-html)
|
||||
(:after css-mode :map css-mode-map :m "gQ" 'web-beautify-css)
|
||||
(:after js2-mode :map js2-mode-map :m "gQ" 'web-beautify-js)))
|
||||
|
||||
(use-package emmet-mode
|
||||
:commands (emmet-mode)
|
||||
:init
|
||||
|
@ -103,7 +98,7 @@
|
|||
:i "M-E" 'emmet-expand-line))
|
||||
|
||||
;;
|
||||
(define-project-type! jekyll ":{"
|
||||
(def-project-type! jekyll ":{"
|
||||
:modes (web-mode scss-mode html-mode markdown-mode yaml-mode)
|
||||
:match "/\\(\\(css\\|_\\(layouts\\|posts\\|sass\\)\\)/.+\\|.+.html\\)$"
|
||||
:files ("config.yml" "_layouts/")
|
||||
|
@ -111,7 +106,7 @@
|
|||
(when (eq major-mode 'web-mode)
|
||||
(web-mode-set-engine "django"))))
|
||||
|
||||
(define-project-type! wordpress "wp"
|
||||
(def-project-type! wordpress "wp"
|
||||
:modes (php-mode web-mode css-mode scss-mode sass-mode)
|
||||
:match "/wp-\\(\\(content\\|admin\\|includes\\)/\\)?.+$"
|
||||
:files ("wp-config.php" "wp-content/"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue