Merge branch 'develop' into solidity-mode
This commit is contained in:
commit
a814c833a2
146 changed files with 3283 additions and 2560 deletions
|
@ -2,9 +2,8 @@
|
|||
|
||||
;;;###autoload
|
||||
(defun +impatient-mode/toggle ()
|
||||
"TODO"
|
||||
"Toggle `impatient-mode' in the current buffer."
|
||||
(interactive)
|
||||
(require 'simple-httpd)
|
||||
(unless (process-status "httpd")
|
||||
(httpd-start))
|
||||
(impatient-mode)
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
;;; collab/impatient-mode/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; Show off code as you write it
|
||||
|
||||
(def-package! impatient-mode
|
||||
:commands impatient-mode)
|
|
@ -24,8 +24,7 @@ MODES should be one major-mode symbol or a list of them."
|
|||
;;
|
||||
|
||||
(def-package! company
|
||||
:commands (company-mode global-company-mode company-complete
|
||||
company-complete-common company-manual-begin company-grab-line)
|
||||
:commands (company-complete-common company-manual-begin company-grab-line)
|
||||
:init
|
||||
(setq company-idle-delay nil
|
||||
company-tooltip-limit 14
|
||||
|
@ -48,7 +47,8 @@ MODES should be one major-mode symbol or a list of them."
|
|||
|
||||
(def-package! company
|
||||
:when (featurep! +auto)
|
||||
:defer pre-command-hook
|
||||
:defer 2
|
||||
:after-call pre-command-hook
|
||||
:config (setq company-idle-delay 0.2))
|
||||
|
||||
|
||||
|
@ -73,27 +73,12 @@ MODES should be one major-mode symbol or a list of them."
|
|||
|
||||
|
||||
(def-package! company-dict
|
||||
:commands company-dict
|
||||
:defer t
|
||||
:config
|
||||
(defun +company|enable-project-dicts (mode &rest _)
|
||||
"Enable per-project dictionaries."
|
||||
(if (symbol-value mode)
|
||||
(cl-pushnew mode company-dict-minor-mode-list :test #'eq)
|
||||
(add-to-list 'company-dict-minor-mode-list mode #'eq)
|
||||
(setq company-dict-minor-mode-list (delq mode company-dict-minor-mode-list))))
|
||||
(add-hook 'doom-project-hook #'+company|enable-project-dicts))
|
||||
|
||||
|
||||
;;
|
||||
;; Included with company.el
|
||||
;;
|
||||
|
||||
(autoload 'company-capf "company-capf")
|
||||
(autoload 'company-dabbrev "company-dabbrev")
|
||||
(autoload 'company-dabbrev-code "company-dabbrev-code")
|
||||
(autoload 'company-elisp "company-elisp")
|
||||
(autoload 'company-etags "company-etags")
|
||||
(autoload 'company-files "company-files")
|
||||
(autoload 'company-gtags "company-gtags")
|
||||
(autoload 'company-ispell "company-ispell")
|
||||
(autoload 'company-yasnippet "company-yasnippet")
|
||||
|
||||
|
|
|
@ -11,7 +11,24 @@
|
|||
;;
|
||||
|
||||
(def-package! helm-mode
|
||||
:defer (pre-command-hook . 1)
|
||||
:defer 1
|
||||
:after-call pre-command-hook
|
||||
:init
|
||||
(map! :map global-map
|
||||
[remap apropos] #'helm-apropos
|
||||
[remap bookmark-jump] #'helm-bookmarks
|
||||
[remap bookmark-jump] #'helm-bookmarks
|
||||
[remap execute-extended-command] #'helm-M-x
|
||||
[remap find-file] #'helm-find-files
|
||||
[remap imenu-anywhere] #'helm-imenu-anywhere
|
||||
[remap imenu-anywhere] #'helm-imenu-anywhere
|
||||
[remap imenu] #'helm-semantic-or-imenu
|
||||
[remap noop-show-kill-ring] #'helm-show-kill-ring
|
||||
[remap projectile-find-file] #'helm-projectile-find-file
|
||||
[remap projectile-recentf] #'helm-projectile-recentf
|
||||
[remap projectile-switch-project] #'helm-projectile-switch-project
|
||||
[remap projectile-switch-to-buffer] #'helm-projectile-switch-to-buffer
|
||||
[remap recentf-open-files] #'helm-recentf)
|
||||
:config
|
||||
(helm-mode +1)
|
||||
;; helm is too heavy for find-file-at-point
|
||||
|
@ -40,7 +57,6 @@
|
|||
helm-move-to-line-cycle-in-source t)
|
||||
|
||||
:config
|
||||
(load "helm-autoloads" nil t)
|
||||
(setq projectile-completion-system 'helm)
|
||||
|
||||
(defvar helm-projectile-find-file-map (make-sparse-keymap))
|
||||
|
@ -72,20 +88,7 @@
|
|||
(setq-local cursor-type nil))))
|
||||
(add-hook 'helm-minibuffer-set-up-hook #'+helm*hide-minibuffer-maybe)
|
||||
|
||||
(map! :map global-map
|
||||
[remap apropos] #'helm-apropos
|
||||
[remap find-file] #'helm-find-files
|
||||
[remap recentf-open-files] #'helm-recentf
|
||||
[remap projectile-switch-to-buffer] #'helm-projectile-switch-to-buffer
|
||||
[remap projectile-recentf] #'helm-projectile-recentf
|
||||
[remap projectile-find-file] #'helm-projectile-find-file
|
||||
[remap imenu] #'helm-semantic-or-imenu
|
||||
[remap bookmark-jump] #'helm-bookmarks
|
||||
[remap noop-show-kill-ring] #'helm-show-kill-ring
|
||||
[remap projectile-switch-project] #'helm-projectile-switch-project
|
||||
[remap projectile-find-file] #'helm-projectile-find-file
|
||||
[remap imenu-anywhere] #'helm-imenu-anywhere
|
||||
[remap execute-extended-command] #'helm-M-x))
|
||||
)
|
||||
|
||||
|
||||
(def-package! helm-locate
|
||||
|
@ -94,40 +97,28 @@
|
|||
:config (set-keymap-parent helm-generic-files-map helm-map))
|
||||
|
||||
|
||||
(def-package! helm-bookmark
|
||||
:commands helm-bookmark
|
||||
:config (setq-default helm-bookmark-show-location t))
|
||||
(after! helm-bookmark
|
||||
(setq-default helm-bookmark-show-location t))
|
||||
|
||||
|
||||
(def-package! helm-files
|
||||
:defer t
|
||||
:config
|
||||
(after! helm-files
|
||||
(setq helm-boring-file-regexp-list
|
||||
(append (list "\\.projects$" "\\.DS_Store$")
|
||||
helm-boring-file-regexp-list)))
|
||||
|
||||
|
||||
(def-package! helm-ag
|
||||
:defer t
|
||||
:config
|
||||
(map! :map helm-ag-edit-map [remap quit-window] #'helm-ag--edit-abort))
|
||||
;; `helm-ag'
|
||||
(map! :after helm-ag
|
||||
:map helm-ag-edit-map [remap quit-window] #'helm-ag--edit-abort)
|
||||
|
||||
|
||||
(def-package! helm-css-scss ; https://github.com/ShingoFukuyama/helm-css-scss
|
||||
:commands (helm-css-scss
|
||||
helm-css-scss-multi
|
||||
helm-css-scss-insert-close-comment)
|
||||
:config
|
||||
(after! helm-css-scss ; https://github.com/ShingoFukuyama/helm-css-scss
|
||||
(setq helm-css-scss-split-direction #'split-window-vertically
|
||||
helm-css-scss-split-with-multiple-windows t))
|
||||
|
||||
|
||||
(def-package! helm-for-files
|
||||
:commands (helm-for-files helm-recentf helm-multi-files))
|
||||
|
||||
|
||||
(def-package! helm-swoop ; https://github.com/ShingoFukuyama/helm-swoop
|
||||
:commands (helm-swoop helm-multi-swoop helm-multi-swoop-all)
|
||||
:commands helm-multi-swoop-all
|
||||
:config
|
||||
(setq helm-swoop-use-line-number-face t
|
||||
helm-swoop-candidate-number-limit 200
|
||||
|
@ -135,9 +126,6 @@
|
|||
helm-swoop-pre-input-function (lambda () "")))
|
||||
|
||||
|
||||
(def-package! helm-describe-modes :commands helm-describe-modes)
|
||||
|
||||
|
||||
(def-package! wgrep
|
||||
:commands (wgrep-setup wgrep-change-to-wgrep-mode)
|
||||
:commands wgrep-change-to-wgrep-mode
|
||||
:config (setq wgrep-auto-save-buffer t))
|
||||
|
|
|
@ -116,9 +116,9 @@ If ARG (universal argument), open selection in other-window."
|
|||
"\\):?\\s-*\\(.+\\)")
|
||||
x)
|
||||
(error
|
||||
(message! (red "Error matching task in file: (%s) %s"
|
||||
(error-message-string ex)
|
||||
(car (split-string x ":"))))
|
||||
(print! (red "Error matching task in file: (%s) %s"
|
||||
(error-message-string ex)
|
||||
(car (split-string x ":"))))
|
||||
nil))
|
||||
collect `((type . ,(match-string 3 x))
|
||||
(desc . ,(match-string 4 x))
|
||||
|
@ -202,7 +202,6 @@ search current file. See `+ivy-task-tags' to customize what this searches for."
|
|||
;; File searching
|
||||
;;
|
||||
|
||||
(defvar +ivy--file-last-search nil)
|
||||
(defvar +ivy--file-search-recursion-p t)
|
||||
(defvar +ivy--file-search-all-files-p nil)
|
||||
|
||||
|
@ -220,8 +219,7 @@ search current file. See `+ivy-task-tags' to customize what this searches for."
|
|||
(let ((beg (or (bound-and-true-p evil-visual-beginning) (region-beginning)))
|
||||
(end (or (bound-and-true-p evil-visual-end) (region-end))))
|
||||
(when (> (abs (- end beg)) 1)
|
||||
(rxt-quote-pcre (buffer-substring-no-properties beg end)))))
|
||||
+ivy--file-last-search))
|
||||
(rxt-quote-pcre (buffer-substring-no-properties beg end)))))))
|
||||
(prompt
|
||||
(format "%s%%s %s"
|
||||
(symbol-name engine)
|
||||
|
@ -232,7 +230,6 @@ search current file. See `+ivy-task-tags' to customize what this searches for."
|
|||
(t
|
||||
(file-relative-name directory project-root)))))
|
||||
(default-directory directory))
|
||||
(setq +ivy--file-last-search query)
|
||||
(require 'counsel)
|
||||
(cl-letf (((symbol-function 'counsel-ag-function)
|
||||
(symbol-function '+ivy*counsel-ag-function))
|
||||
|
|
|
@ -24,9 +24,10 @@ immediately runs it on the current candidate (ending the ivy session)."
|
|||
;;
|
||||
|
||||
(def-package! ivy
|
||||
:defer (pre-command-hook . 1)
|
||||
:defer 1
|
||||
:after-call pre-command-hook
|
||||
:config
|
||||
(setq ivy-height 12
|
||||
(setq ivy-height 15
|
||||
ivy-do-completion-in-region nil
|
||||
ivy-wrap t
|
||||
ivy-fixed-height-minibuffer t
|
||||
|
@ -141,7 +142,7 @@ immediately runs it on the current candidate (ending the ivy session)."
|
|||
"C-o" #'+ivy@coo/body
|
||||
"M-o" #'ivy-dispatching-done-hydra)
|
||||
:config
|
||||
(def-hydra! +ivy@coo (:hint nil :color pink)
|
||||
(defhydra +ivy@coo (:hint nil :color pink)
|
||||
"
|
||||
Move ^^^^^^^^^^ | Call ^^^^ | Cancel^^ | Options^^ | Action _w_/_s_/_a_: %s(ivy-action-name)
|
||||
----------^^^^^^^^^^-+--------------^^^^-+-------^^-+--------^^-+---------------------------------
|
||||
|
@ -184,7 +185,7 @@ immediately runs it on the current candidate (ending the ivy session)."
|
|||
|
||||
|
||||
(def-package! wgrep
|
||||
:commands (wgrep-setup wgrep-change-to-wgrep-mode)
|
||||
:commands wgrep-change-to-wgrep-mode
|
||||
:config (setq wgrep-auto-save-buffer t))
|
||||
|
||||
|
||||
|
|
|
@ -197,8 +197,10 @@
|
|||
:desc "Magit status" :n "g" #'magit-status
|
||||
:desc "List gists" :n "G" #'+gist:list
|
||||
:desc "Initialize repo" :n "i" #'magit-init
|
||||
:desc "Browse issues tracker" :n "I" #'+vcs/git-browse-issues
|
||||
:desc "Magit buffer log" :n "l" #'magit-log-buffer-file
|
||||
:desc "List repositories" :n "L" #'magit-list-repositories
|
||||
:desc "Browse remote" :n "o" #'+vcs/git-browse
|
||||
:desc "Magit push popup" :n "p" #'magit-push-popup
|
||||
:desc "Magit pull popup" :n "P" #'magit-pull-popup
|
||||
:desc "Git revert hunk" :n "r" #'git-gutter:revert-hunk
|
||||
|
@ -213,9 +215,11 @@
|
|||
(:desc "help" :prefix "h"
|
||||
:n "h" help-map
|
||||
:desc "Apropos" :n "a" #'apropos
|
||||
:desc "Open Bug Report" :n "b" #'doom/open-bug-report
|
||||
:desc "Describe char" :n "c" #'describe-char
|
||||
:desc "Describe DOOM module" :n "d" #'doom/describe-module
|
||||
:desc "Open Doom manual" :n "D" #'doom/help
|
||||
:desc "Open Doom manual" :n "D" #'doom//open-manual
|
||||
:desc "Open vanilla sandbox" :n "E" #'doom/open-vanilla-sandbox
|
||||
:desc "Describe function" :n "f" #'describe-function
|
||||
:desc "Describe face" :n "F" #'describe-face
|
||||
:desc "Info" :n "i" #'info-lookup-symbol
|
||||
|
@ -233,7 +237,7 @@
|
|||
:desc "Print Doom version" :n "V" #'doom/version
|
||||
:desc "Describe at point" :n "." #'helpful-at-point
|
||||
:desc "What face" :n "'" #'doom/what-face
|
||||
:desc "What minor modes" :n ";" #'doom/what-minor-mode)
|
||||
:desc "What minor modes" :n ";" #'doom/describe-active-minor-mode)
|
||||
|
||||
(:desc "insert" :prefix "i"
|
||||
:desc "From kill-ring" :nv "y" #'counsel-yank-pop
|
||||
|
@ -251,7 +255,7 @@
|
|||
:desc "REPL" :n "r" #'+eval/open-repl
|
||||
:v "r" #'+eval:repl
|
||||
:desc "Neotree" :n "n" #'+neotree/open
|
||||
:desc "Neotree: on this file" :n "N" #'+neotree/find-this-file
|
||||
:desc "Neotree: find file" :n "N" #'+neotree/find-this-file
|
||||
:desc "Imenu sidebar" :nv "i" #'imenu-list-smart-toggle
|
||||
:desc "Terminal" :n "t" #'+term/open-popup-in-project
|
||||
|
||||
|
@ -295,11 +299,13 @@
|
|||
:desc "Browse remote files" :n "." #'ssh-deploy-browse-remote-handler
|
||||
:desc "Detect remote changes" :n ">" #'ssh-deploy-remote-changes-handler))
|
||||
|
||||
(:desc "snippets" :prefix "s"
|
||||
:desc "New snippet" :n "n" #'yas-new-snippet
|
||||
:desc "Insert snippet" :nv "i" #'yas-insert-snippet
|
||||
:desc "Find snippet for mode" :n "s" #'yas-visit-snippet-file
|
||||
:desc "Find snippet" :n "S" #'+default/find-in-snippets)
|
||||
(:when (featurep! :feature snippets)
|
||||
(:desc "snippets" :prefix "s"
|
||||
:desc "New snippet" :n "n" #'yas-new-snippet
|
||||
:desc "Insert snippet" :nv "i" #'yas-insert-snippet
|
||||
:desc "Find snippet" :n "s" #'+default/find-in-snippets
|
||||
:desc "Find snippet for mode" :n "S" #'+default/browse-snippets
|
||||
:desc "Find global snippet" :n "/" #'yas-visit-snippet-file))
|
||||
|
||||
(:desc "toggle" :prefix "t"
|
||||
:desc "Flyspell" :n "s" #'flyspell-mode
|
||||
|
@ -387,11 +393,12 @@
|
|||
[escape] #'company-search-abort))
|
||||
|
||||
;; counsel
|
||||
(:after counsel
|
||||
(:map counsel-ag-map
|
||||
[backtab] #'+ivy/wgrep-occur ; search/replace on results
|
||||
"C-SPC" #'ivy-call-and-recenter ; preview
|
||||
"M-RET" (+ivy-do-action! #'+ivy-git-grep-other-window-action)))
|
||||
(:when (featurep! :completion ivy)
|
||||
(:after counsel
|
||||
(:map counsel-ag-map
|
||||
[backtab] #'+ivy/wgrep-occur ; search/replace on results
|
||||
"C-SPC" #'ivy-call-and-recenter ; preview
|
||||
"M-RET" (+ivy-do-action! #'+ivy-git-grep-other-window-action))))
|
||||
|
||||
;; easymotion
|
||||
:m "gs" #'+default/easymotion ; lazy-load `evil-easymotion'
|
||||
|
@ -766,14 +773,16 @@
|
|||
;; Evil-collection fixes
|
||||
;;
|
||||
|
||||
(when (featurep 'evil-collection)
|
||||
(defun +config|deal-with-evil-collections-bs (_feature keymaps)
|
||||
"Unmap keys that conflict with Doom's defaults."
|
||||
(dolist (map keymaps)
|
||||
(evil-define-key '(normal visual motion) map
|
||||
doom-leader-key nil
|
||||
"C-j" nil "C-k" nil
|
||||
"gd" nil "gf" nil
|
||||
"K" nil
|
||||
"]" nil "[" nil)))
|
||||
(add-hook 'evil-collection-setup-hook #'+config|deal-with-evil-collections-bs))
|
||||
(defun +config|deal-with-evil-collections-bs (_feature keymaps)
|
||||
"Unmap keys that conflict with Doom's defaults."
|
||||
(dolist (map keymaps)
|
||||
(evil-delay `(and (boundp ',map) (keymapp ,map))
|
||||
`(evil-define-key* '(normal visual motion) ,map
|
||||
(kbd doom-leader-key) nil
|
||||
(kbd "C-j") nil (kbd "C-k") nil
|
||||
"gd" nil "gf" nil "K" nil
|
||||
"]" nil "[" nil)
|
||||
'after-load-functions t nil
|
||||
(format "+default-redefine-key-in-%s" map))))
|
||||
|
||||
(add-hook 'evil-collection-setup-hook #'+config|deal-with-evil-collections-bs)
|
||||
|
|
|
@ -36,8 +36,10 @@
|
|||
|
||||
;;;###autoload
|
||||
(defun +default/browse-snippets ()
|
||||
(interactive) (doom-project-browse emacs-snippets-dir))
|
||||
;; NOTE No need for a browse-snippets variant, use `yas-visit-snippet-file'
|
||||
(interactive) (doom-project-browse +snippets-dir))
|
||||
;;;###autoload
|
||||
(defun +default/find-in-snippets ()
|
||||
(interactive) (doom-project-find-file +snippets-dir))
|
||||
|
||||
;;;###autoload
|
||||
(defun +default/find-in-config ()
|
||||
|
|
|
@ -35,6 +35,15 @@
|
|||
(sp-pair "'" nil :unless unless-list)
|
||||
(sp-pair "\"" nil :unless unless-list))
|
||||
|
||||
;; Major-mode specific fixes
|
||||
(sp-local-pair 'ruby-mode "{" "}"
|
||||
:pre-handlers '(:rem sp-ruby-prehandler)
|
||||
:post-handlers '(:rem sp-ruby-posthandler))
|
||||
;; sp's default rules for these modes are obnoxious, so disable them
|
||||
(provide 'smartparens-latex)
|
||||
(provide 'smartparens-elixir)
|
||||
(provide 'smartparens-lua)
|
||||
|
||||
;; Expand {|} => { | }
|
||||
;; Expand {|} => {
|
||||
;; |
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
(def-package! realgud
|
||||
:commands (realgud:gdb realgud:trepanjs realgud:bashdb realgud:zshdb)
|
||||
:config
|
||||
(set! :popup "^\\*\\(?trepanjs:\\(?:g\\|zsh\\|bash\\)db\\)" '((size . 20)))
|
||||
(set! :popup "^\\*\\(?trepanjs:\\(?:g\\|zsh\\|bash\\)db\\)"
|
||||
'((size . 20)))
|
||||
|
||||
;; TODO Temporary Ex commands for the debugger
|
||||
;; (def-tmp-excmd! doom:def-debug-on doom:def-debug-off
|
||||
|
|
|
@ -10,12 +10,7 @@
|
|||
;;
|
||||
|
||||
(def-package! quickrun
|
||||
:commands (quickrun
|
||||
quickrun-region
|
||||
quickrun-with-arg
|
||||
quickrun-shell
|
||||
quickrun-compile-only
|
||||
quickrun-replace-region)
|
||||
:defer t
|
||||
:init
|
||||
(unless (boundp 'display-line-numbers)
|
||||
(add-hook 'quickrun--mode-hook #'nlinum-mode))
|
||||
|
|
|
@ -1,6 +1,21 @@
|
|||
;; feature/evil/autoload/evil.el -*- lexical-binding: t; -*-
|
||||
;;;###if (featurep! :feature evil)
|
||||
|
||||
;;;###autoload
|
||||
(def-setting! :evil-state (modes state)
|
||||
"Set the initialize STATE of MODE using `evil-set-initial-state'."
|
||||
(let ((unquoted-modes (doom-unquote modes)))
|
||||
(if (listp unquoted-modes)
|
||||
`(progn
|
||||
,@(cl-loop for mode in unquoted-modes
|
||||
collect `(evil-set-initial-state ',mode ,state)))
|
||||
`(evil-set-initial-state ,modes ,state))))
|
||||
|
||||
|
||||
;;
|
||||
;; Commands
|
||||
;;
|
||||
|
||||
;;;###autoload
|
||||
(defun +evil/visual-indent ()
|
||||
"vnoremap < <gv"
|
||||
|
@ -80,6 +95,11 @@ evil-window-move-* (e.g. `evil-window-move-far-left')"
|
|||
;;;###autoload
|
||||
(defun +evil/window-move-down () "See `+evil--window-swap'" (interactive) (+evil--window-swap 'down))
|
||||
|
||||
|
||||
;;
|
||||
;; Evil commands/operators
|
||||
;;
|
||||
|
||||
;;;###autoload (autoload '+evil:apply-macro "feature/evil/autoload/evil" nil t)
|
||||
(evil-define-operator +evil:apply-macro (beg end)
|
||||
"Apply macro to each line."
|
||||
|
|
|
@ -3,27 +3,10 @@
|
|||
;; I'm a vimmer at heart. Its modal philosophy suits me better, and this module
|
||||
;; strives to make Emacs a much better vim than vim was.
|
||||
|
||||
(def-setting! :evil-state (modes state)
|
||||
"Set the initialize STATE of MODE using `evil-set-initial-state'."
|
||||
(let ((unquoted-modes (doom-unquote modes)))
|
||||
(if (listp unquoted-modes)
|
||||
`(progn
|
||||
,@(cl-loop for mode in unquoted-modes
|
||||
collect `(evil-set-initial-state ',mode ,state)))
|
||||
`(evil-set-initial-state ,modes ,state))))
|
||||
|
||||
|
||||
;;
|
||||
;; evil-mode
|
||||
;;
|
||||
|
||||
(autoload 'goto-last-change "goto-chg")
|
||||
(autoload 'goto-last-change-reverse "goto-chg")
|
||||
|
||||
|
||||
(def-package! evil-collection
|
||||
:when (featurep! +everywhere)
|
||||
:defer pre-command-hook
|
||||
:defer 1
|
||||
:after-call post-command-hook
|
||||
:preface
|
||||
;; must be set before evil/evil-collcetion is loaded
|
||||
(setq evil-want-integration nil
|
||||
|
@ -61,7 +44,7 @@
|
|||
evil-visual-state-cursor 'hollow)
|
||||
|
||||
:config
|
||||
(add-hook 'doom-init-hook #'evil-mode)
|
||||
(add-hook 'doom-post-init-hook #'evil-mode)
|
||||
(evil-select-search-module 'evil-search-module 'evil-search)
|
||||
|
||||
(set! :popup "^\\*evil-registers" '((size . 0.3)))
|
||||
|
@ -235,7 +218,7 @@
|
|||
evil-escape-excluded-major-modes '(neotree-mode)
|
||||
evil-escape-key-sequence "jk"
|
||||
evil-escape-delay 0.25)
|
||||
(add-hook 'pre-command-hook 'evil-escape-pre-command-hook)
|
||||
(add-hook 'pre-command-hook #'evil-escape-pre-command-hook)
|
||||
(map! :irvo "C-g" #'evil-escape)
|
||||
:config
|
||||
;; no `evil-escape' in minibuffer
|
||||
|
@ -325,7 +308,7 @@ the new algorithm is confusing, like in python or ruby."
|
|||
(def-package! evil-snipe
|
||||
:commands (evil-snipe-mode evil-snipe-override-mode
|
||||
evil-snipe-local-mode evil-snipe-override-local-mode)
|
||||
:defer pre-command-hook
|
||||
:after-call pre-command-hook
|
||||
:init
|
||||
(setq evil-snipe-smart-case t
|
||||
evil-snipe-scope 'line
|
||||
|
@ -385,19 +368,6 @@ the new algorithm is confusing, like in python or ruby."
|
|||
(push ">" evil-args-closers)))
|
||||
|
||||
|
||||
(def-package! evil-indent-plus
|
||||
:commands (evil-indent-plus-i-indent
|
||||
evil-indent-plus-a-indent
|
||||
evil-indent-plus-i-indent-up
|
||||
evil-indent-plus-a-indent-up
|
||||
evil-indent-plus-i-indent-up-down
|
||||
evil-indent-plus-a-indent-up-down))
|
||||
|
||||
|
||||
(def-package! evil-textobj-anyblock
|
||||
:commands (evil-textobj-anyblock-inner-block evil-textobj-anyblock-a-block))
|
||||
|
||||
|
||||
;;
|
||||
;; Multiple cursors compatibility (for the plugins that use it)
|
||||
;;
|
||||
|
|
|
@ -66,8 +66,12 @@ evil is loaded and enabled)."
|
|||
;;;###autoload
|
||||
(defun +file-templates-get-short-path ()
|
||||
"Fetches a short file path for the header in Doom module templates."
|
||||
(when (string-match "/modules/\\(.+\\)$" buffer-file-truename)
|
||||
(match-string 1 buffer-file-truename)))
|
||||
(let ((path (file-truename (or buffer-file-name default-directory))))
|
||||
(cond ((string-match "/modules/\\(.+\\)$" path)
|
||||
(match-string 1 path))
|
||||
((file-in-directory-p path doom-emacs-dir)
|
||||
(file-relative-name path doom-emacs-dir))
|
||||
((abbreviate-file-name path)))))
|
||||
|
||||
|
||||
;;
|
||||
|
|
|
@ -6,142 +6,137 @@
|
|||
(expand-file-name "templates/" (file-name-directory load-file-name))
|
||||
"The path to a directory of yasnippet folders to use for file templates.")
|
||||
|
||||
(defvar +file-templates-alist ()
|
||||
"An alist of file template rules. The CAR of each rule is either a major mode
|
||||
symbol or regexp string. The CDR is a plist. See `doom--set:file-template' for
|
||||
more information.")
|
||||
|
||||
(defvar +file-templates-default-trigger "__"
|
||||
"The default yasnippet trigger key (a string) for file template rules that
|
||||
don't have a :trigger property in `+file-templates-alist'.")
|
||||
|
||||
(defvar +file-templates-alist
|
||||
`(;; General
|
||||
(gitignore-mode)
|
||||
(dockerfile-mode)
|
||||
("/docker-compose\\.yml$" :mode yaml-mode)
|
||||
("/Makefile$" :mode makefile-gmake-mode)
|
||||
;; elisp
|
||||
("/.dir-locals.el$")
|
||||
("/packages\\.el$" :when +file-templates-in-emacs-dirs-p
|
||||
:trigger "__doom-packages"
|
||||
:mode emacs-lisp-mode)
|
||||
("/doctor\\.el$" :when +file-templates-in-emacs-dirs-p
|
||||
:trigger "__doom-doctor"
|
||||
:mode emacs-lisp-mode)
|
||||
("/test/.+\\.el$" :when +file-templates-in-emacs-dirs-p
|
||||
:trigger "__doom-test"
|
||||
:mode emacs-lisp-mode)
|
||||
("\\.el$" :when +file-templates-in-emacs-dirs-p
|
||||
:trigger "__doom-module"
|
||||
:mode emacs-lisp-mode)
|
||||
("-test\\.el$" :mode emacs-ert-mode)
|
||||
(emacs-lisp-mode :trigger "__initfile")
|
||||
(snippet-mode)
|
||||
;; C/C++
|
||||
("/main\\.c\\(?:c\\|pp\\)$" :trigger "__main.cpp" :mode c++-mode)
|
||||
("/win32_\\.c\\(?:c\\|pp\\)$" :trigger "__winmain.cpp" :mode c++-mode)
|
||||
("\\.c\\(?:c\\|pp\\)$" :trigger "__cpp" :mode c++-mode)
|
||||
("\\.h\\(?:h\\|pp\\|xx\\)$" :trigger "__hpp" :mode c++-mode)
|
||||
("\\.h$" :trigger "__h" :mode c-mode)
|
||||
(c-mode :trigger "__c" :mode c-mode)
|
||||
;; go
|
||||
("/main\\.go$" :trigger "__main.go" :mode go-mode :project t)
|
||||
(go-mode :trigger "__.go")
|
||||
;; web-mode
|
||||
("/normalize\\.scss$" :trigger "__normalize.scss" :mode scss-mode)
|
||||
("/master\\.scss$" :trigger "__master.scss" :mode scss-mode)
|
||||
("\\.html$" :trigger "__.html" :mode web-mode)
|
||||
(scss-mode)
|
||||
;; java
|
||||
("/main\\.java$" :trigger "__main" :mode java-mode)
|
||||
("/build\\.gradle$" :trigger "__build.gradle" :mode android-mode)
|
||||
("/src/.+\\.java$" :mode java-mode)
|
||||
;; javascript
|
||||
("/package\\.json$" :trigger "__package.json" :mode json-mode)
|
||||
("/bower\\.json$" :trigger "__bower.json" :mode json-mode)
|
||||
("/gulpfile\\.js$" :trigger "__gulpfile.js" :mode js-mode)
|
||||
("/webpack\\.config\\.js$" :trigger "__webpack.config.js" :mode js-mode)
|
||||
("\\.js\\(?:on\\|hintrc\\)$" :mode json-mode)
|
||||
;; Lua
|
||||
("/main\\.lua$" :trigger "__main.lua" :mode love-mode)
|
||||
("/conf\\.lua$" :trigger "__conf.lua" :mode love-mode)
|
||||
;; Markdown
|
||||
(markdown-mode)
|
||||
;; Org
|
||||
("\\.org$" :trigger "__" :mode org-mode)
|
||||
("/README\\.org$"
|
||||
:when +file-templates-in-emacs-dirs-p
|
||||
:trigger "__doom-readme"
|
||||
:mode org-mode)
|
||||
;; PHP
|
||||
("\\.class\\.php$" :trigger "__.class.php" :mode php-mode)
|
||||
(php-mode)
|
||||
;; Python
|
||||
;; TODO ("tests?/test_.+\\.py$" :trigger "__" :mode nose-mode)
|
||||
;; TODO ("/setup\\.py$" :trigger "__setup.py" :mode python-mode)
|
||||
(python-mode)
|
||||
;; Ruby
|
||||
("/lib/.+\\.rb$" :trigger "__module" :mode ruby-mode :project t)
|
||||
("/spec_helper\\.rb$" :trigger "__helper" :mode rspec-mode :project t)
|
||||
("_spec\\.rb$" :mode rspec-mode :project t)
|
||||
("/\\.rspec$" :trigger "__.rspec" :mode rspec-mode :project t)
|
||||
("\\.gemspec$" :trigger "__.gemspec" :mode ruby-mode :project t)
|
||||
("/Gemfile$" :trigger "__Gemfile" :mode ruby-mode :project t)
|
||||
("/Rakefile$" :trigger "__Rakefile" :mode ruby-mode :project t)
|
||||
(ruby-mode)
|
||||
;; Rust
|
||||
("/Cargo.toml$" :trigger "__Cargo.toml" :mode rust-mode)
|
||||
("/main\\.rs$" :trigger "__main.rs" :mode rust-mode)
|
||||
;; Slim
|
||||
("/\\(?:index\\|main\\)\\.slim$" :mode slim-mode)
|
||||
;; Shell scripts
|
||||
("\\.zunit$" :trigger "__zunit" :mode sh-mode)
|
||||
(fish-mode)
|
||||
(sh-mode))
|
||||
"An alist of file template rules. The CAR of each rule is either a major mode
|
||||
symbol or regexp string. The CDR is a plist. See `doom--set:file-template' for
|
||||
more information.")
|
||||
|
||||
|
||||
;;
|
||||
;; Bootstrap
|
||||
;; Library
|
||||
;;
|
||||
|
||||
(after! yasnippet
|
||||
(add-to-list 'yas-snippet-dirs '+file-templates-dir 'append #'eq))
|
||||
|
||||
(defun +file-template-p (rule)
|
||||
"Return t if RULE applies to the current buffer."
|
||||
(let ((pred (car rule))
|
||||
(plist (cdr rule)))
|
||||
(and (cond ((stringp pred) (string-match-p pred))
|
||||
(and (cond ((and (stringp pred) buffer-file-name) (string-match-p pred buffer-file-name))
|
||||
((symbolp pred) (eq major-mode pred)))
|
||||
(or (not (plist-member plist :when))
|
||||
(funcall (plist-get plist :when) buffer-file-name))
|
||||
rule)))
|
||||
|
||||
(defun +file-templates|init ()
|
||||
"Check if the current buffer is a candidate for file template expansion. It
|
||||
must be non-read-only, empty, and there must be a rule in
|
||||
`+file-templates-alist' that applies to it."
|
||||
(when (and (not buffer-read-only)
|
||||
(bobp) (eobp))
|
||||
(when-let* ((rule (cl-find-if #'+file-template-p +file-templates-alist)))
|
||||
(apply #'+file-templates--expand rule))))
|
||||
|
||||
(add-hook 'find-file-hook #'+file-templates|init)
|
||||
|
||||
|
||||
;;
|
||||
;; File templates
|
||||
;;
|
||||
|
||||
(defun +file-templates-in-emacs-dirs-p (file)
|
||||
"Returns t if FILE is in Doom or your private directory."
|
||||
(or (file-in-directory-p file doom-private-dir)
|
||||
(file-in-directory-p file doom-emacs-dir)))
|
||||
|
||||
(setq +file-templates-alist
|
||||
`(;; General
|
||||
(gitignore-mode)
|
||||
(dockerfile-mode)
|
||||
("/docker-compose\\.yml$" :mode yaml-mode)
|
||||
("/Makefile$" :mode makefile-gmake-mode)
|
||||
;; elisp
|
||||
("/.dir-locals.el$")
|
||||
("/packages\\.el$" :when +file-templates-in-emacs-dirs-p
|
||||
:trigger "__doom-packages"
|
||||
:mode emacs-lisp-mode)
|
||||
("/doctor\\.el$" :when +file-templates-in-emacs-dirs-p
|
||||
:trigger "__doom-doctor"
|
||||
:mode emacs-lisp-mode)
|
||||
("/test/.+\\.el$" :when +file-templates-in-emacs-dirs-p
|
||||
:trigger "__doom-test"
|
||||
:mode emacs-lisp-mode)
|
||||
("\\.el$" :when +file-templates-in-emacs-dirs-p
|
||||
:trigger "__doom-module"
|
||||
:mode emacs-lisp-mode)
|
||||
("-test\\.el$" :mode emacs-ert-mode)
|
||||
(emacs-lisp-mode :trigger "__initfile")
|
||||
(snippet-mode)
|
||||
;; C/C++
|
||||
("/main\\.c\\(?:c\\|pp\\)$" :trigger "__main.cpp" :mode c++-mode)
|
||||
("/win32_\\.c\\(?:c\\|pp\\)$" :trigger "__winmain.cpp" :mode c++-mode)
|
||||
("\\.c\\(?:c\\|pp\\)$" :trigger "__cpp" :mode c++-mode)
|
||||
("\\.h\\(?:h\\|pp\\|xx\\)$" :trigger "__hpp" :mode c++-mode)
|
||||
("\\.h$" :trigger "__h" :mode c-mode)
|
||||
(c-mode :trigger "__c" :mode c-mode)
|
||||
;; go
|
||||
("/main\\.go$" :trigger "__main.go" :mode go-mode :project t)
|
||||
(go-mode :trigger "__.go")
|
||||
;; web-mode
|
||||
("/normalize\\.scss$" :trigger "__normalize.scss" :mode scss-mode)
|
||||
("/master\\.scss$" :trigger "__master.scss" :mode scss-mode)
|
||||
("\\.html$" :trigger "__.html" :mode web-mode)
|
||||
(scss-mode)
|
||||
;; java
|
||||
("/main\\.java$" :trigger "__main" :mode java-mode)
|
||||
("/build\\.gradle$" :trigger "__build.gradle" :mode android-mode)
|
||||
("/src/.+\\.java$" :mode java-mode)
|
||||
;; javascript
|
||||
("/package\\.json$" :trigger "__package.json" :mode json-mode)
|
||||
("/bower\\.json$" :trigger "__bower.json" :mode json-mode)
|
||||
("/gulpfile\\.js$" :trigger "__gulpfile.js" :mode js-mode)
|
||||
("/webpack\\.config\\.js$" :trigger "__webpack.config.js" :mode js-mode)
|
||||
("\\.js\\(?:on\\|hintrc\\)$" :mode json-mode)
|
||||
;; Lua
|
||||
("/main\\.lua$" :trigger "__main.lua" :mode love-mode)
|
||||
("/conf\\.lua$" :trigger "__conf.lua" :mode love-mode)
|
||||
;; Markdown
|
||||
(markdown-mode)
|
||||
;; Org
|
||||
("\\.org$" :trigger "__" :mode org-mode)
|
||||
("/README\\.org$"
|
||||
:when +file-templates-in-emacs-dirs-p
|
||||
:trigger "__doom-readme"
|
||||
:mode org-mode)
|
||||
;; PHP
|
||||
("\\.class\\.php$" :trigger "__.class.php" :mode php-mode)
|
||||
(php-mode)
|
||||
;; Python
|
||||
;; TODO ("tests?/test_.+\\.py$" :trigger "__" :mode nose-mode)
|
||||
;; TODO ("/setup\\.py$" :trigger "__setup.py" :mode python-mode)
|
||||
(python-mode)
|
||||
;; Ruby
|
||||
("/lib/.+\\.rb$" :trigger "__module" :mode ruby-mode :project t)
|
||||
("/spec_helper\\.rb$" :trigger "__helper" :mode rspec-mode :project t)
|
||||
("_spec\\.rb$" :mode rspec-mode :project t)
|
||||
("/\\.rspec$" :trigger "__.rspec" :mode rspec-mode :project t)
|
||||
("\\.gemspec$" :trigger "__.gemspec" :mode ruby-mode :project t)
|
||||
("/Gemfile$" :trigger "__Gemfile" :mode ruby-mode :project t)
|
||||
("/Rakefile$" :trigger "__Rakefile" :mode ruby-mode :project t)
|
||||
(ruby-mode)
|
||||
;; Rust
|
||||
("/Cargo.toml$" :trigger "__Cargo.toml" :mode rust-mode)
|
||||
("/main\\.rs$" :trigger "__main.rs" :mode rust-mode)
|
||||
;; Slim
|
||||
("/\\(?:index\\|main\\)\\.slim$" :mode slim-mode)
|
||||
;; Shell scripts
|
||||
("\\.zunit$" :trigger "__zunit" :mode sh-mode)
|
||||
(fish-mode)
|
||||
(sh-mode)
|
||||
))
|
||||
(defun +file-templates|check ()
|
||||
"Check if the current buffer is a candidate for file template expansion. It
|
||||
must be non-read-only, empty, and there must be a rule in
|
||||
`+file-templates-alist' that applies to it."
|
||||
(when (and (not buffer-read-only)
|
||||
(bobp) (eobp)
|
||||
(not (string-match-p "^ *\\*" (buffer-name))))
|
||||
(when-let* ((rule (cl-find-if #'+file-template-p +file-templates-alist)))
|
||||
(apply #'+file-templates--expand rule))))
|
||||
|
||||
|
||||
;;
|
||||
;; Plugins
|
||||
;; Bootstrap
|
||||
;;
|
||||
|
||||
(defun +file-templates|init ()
|
||||
(after! yasnippet
|
||||
(add-to-list 'yas-snippet-dirs '+file-templates-dir 'append #'eq))
|
||||
(add-hook 'find-file-hook #'+file-templates|check))
|
||||
|
||||
(add-hook 'doom-post-init-hook #'+file-templates|init)
|
||||
|
||||
|
|
|
@ -11,10 +11,9 @@ ${2:A short summary about what this module does.}
|
|||
|
||||
${3:If necessary, include a longer description below it that goes into more detail. This may be as long as you like.
|
||||
|
||||
+ If possible, include a list of features
|
||||
+ Include links to major plugins that the module uses, if applicable
|
||||
+ Use links whenever you can
|
||||
+ Mention dependencies on other modules here}
|
||||
+ If possible, include a brief list of feature highlights here
|
||||
+ Like code completion, syntax checking or available snippets
|
||||
+ Include links to packages & external things where possible
|
||||
|
||||
* Table of Contents :TOC:
|
||||
|
||||
|
@ -25,11 +24,15 @@ This module provides no flags.
|
|||
This module has no prereqisites.
|
||||
|
||||
* Features
|
||||
A list of features, how to use them, and their dependencies.
|
||||
An in-depth list of features, how to use them, and their dependencies.
|
||||
|
||||
* Configuration
|
||||
How to configure this module, including common problems and how to address them.
|
||||
|
||||
* Appendix
|
||||
** Commands
|
||||
+ A list or table of public commands (and their keybinds) and functions that this module exposes.
|
||||
+ A brief description of how to use them
|
||||
** Hacks
|
||||
+ Include a list of ways this module changes default behavior
|
||||
$0
|
11
modules/feature/lookup/autoload/devdocs.el
Normal file
11
modules/feature/lookup/autoload/devdocs.el
Normal file
|
@ -0,0 +1,11 @@
|
|||
;;; feature/lookup/autoload/devdocs.el -*- lexical-binding: t; -*-
|
||||
;;;###if (featurep! +devdocs)
|
||||
|
||||
;;;###autoload
|
||||
(def-setting! :devdocs (modes docset)
|
||||
"Map major MODES (one major-mode symbol or a list of them) to a devdocs
|
||||
DOCSET (a string).
|
||||
|
||||
See `devdocs-alist' for the defaults. "
|
||||
`(dolist (mode ',modes)
|
||||
(push (cons mode ,docset) devdocs-alist)))
|
40
modules/feature/lookup/autoload/docsets.el
Normal file
40
modules/feature/lookup/autoload/docsets.el
Normal file
|
@ -0,0 +1,40 @@
|
|||
;;; feature/lookup/autoload/docsets.el -*- lexical-binding: t; -*-
|
||||
;;;###if (featurep! +docsets)
|
||||
|
||||
;;;###autoload
|
||||
(def-setting! :docset (modes &rest docsets)
|
||||
"Registers a list of DOCSETS (strings) for MODES (either one major mode
|
||||
symbol or a list of them).
|
||||
|
||||
If MODES is a minor mode, you can use :add or :remove as the first element of
|
||||
DOCSETS, to instruct it to append (or remove) those from the docsets already set
|
||||
by a major-mode, if any.
|
||||
|
||||
Used by `+lookup/in-docsets' and `+lookup/documentation'."
|
||||
(let* ((modes (doom-unquote modes))
|
||||
(ivy-p (featurep! :completion ivy))
|
||||
(hook-sym (intern (format "+lookup|%s-docsets--%s"
|
||||
(cond ((eq ',(car docsets) :add) 'add)
|
||||
((eq ',(car docsets) :remove) 'remove)
|
||||
('set))
|
||||
(string-join docsets "-"))))
|
||||
(var-sym (if ivy-p 'counsel-dash-docsets 'helm-dash-docsets)))
|
||||
`(progn
|
||||
(defun ,hook-sym ()
|
||||
(make-variable-buffer-local ',var-sym)
|
||||
,(cond ((eq ',(car docsets) :add)
|
||||
`(setq ,var-sym (append ,var-sym (list ,@(cdr docsets)))))
|
||||
((eq ',(car docsets) :remove)
|
||||
`(setq ,var-sym
|
||||
(cl-loop with to-delete = (list ,@(cdr docsets))
|
||||
for docset in ,var-sym
|
||||
unless (member docset to-delete)
|
||||
collect docset)))
|
||||
(`(setq ,var-sym (list ,@docsets)))))
|
||||
(add-hook! ,modes #',hook-sym))))
|
||||
|
||||
;;;###autoload
|
||||
(autoload 'helm-dash-installed-docsets "helm-dash")
|
||||
|
||||
;;;###autoload
|
||||
(autoload 'helm-dash-docset-installed-p "helm-dash")
|
|
@ -160,6 +160,7 @@ Goes down a list of possible backends:
|
|||
identifier
|
||||
(+lookup--online-provider (not current-prefix-arg))))))
|
||||
|
||||
(defvar ffap-file-finder)
|
||||
;;;###autoload
|
||||
(defun +lookup/file (path)
|
||||
"Figure out PATH from whatever is at point and open it.
|
||||
|
|
|
@ -122,33 +122,29 @@ ones."
|
|||
;;
|
||||
|
||||
(def-package! dumb-jump
|
||||
:commands (dumb-jump-go dumb-jump-quick-look
|
||||
dumb-jump-back dumb-jump-result-follow)
|
||||
:commands dumb-jump-result-follow
|
||||
:config
|
||||
(setq dumb-jump-default-project doom-emacs-dir
|
||||
dumb-jump-aggressive nil
|
||||
dumb-jump-selector
|
||||
(cond ((featurep! :completion ivy) 'ivy)
|
||||
((featurep! :completion helm) 'helm)
|
||||
(t 'popup))))
|
||||
('popup))))
|
||||
|
||||
|
||||
;;
|
||||
;; xref
|
||||
;;
|
||||
|
||||
(def-package! xref
|
||||
:commands (xref-backend-identifier-at-point xref-find-definitions xref-find-references)
|
||||
:config
|
||||
;; By default, `etags--xref-backend' is the default xref backend. No need.
|
||||
;; We'll set these up ourselves in other modules.
|
||||
(setq-default xref-backend-functions '(t))
|
||||
;; By default, `etags--xref-backend' is the default xref backend. No need. We'll
|
||||
;; set these up ourselves in other modules.
|
||||
(setq-default xref-backend-functions '(t))
|
||||
|
||||
;; ...however, it breaks `projectile-find-tag', unless we put it back.
|
||||
(defun +lookup*projectile-find-tag (orig-fn)
|
||||
(let ((xref-backend-functions '(etags--xref-backend t)))
|
||||
(funcall orig-fn)))
|
||||
(advice-add #'projectile-find-tag :around #'+lookup*projectile-find-tag))
|
||||
;; ...however, it breaks `projectile-find-tag', unless we put it back.
|
||||
(defun +lookup*projectile-find-tag (orig-fn)
|
||||
(let ((xref-backend-functions '(etags--xref-backend t)))
|
||||
(funcall orig-fn)))
|
||||
(advice-add #'projectile-find-tag :around #'+lookup*projectile-find-tag)
|
||||
|
||||
|
||||
(def-package! ivy-xref
|
||||
|
@ -168,41 +164,9 @@ ones."
|
|||
;;
|
||||
|
||||
(when (featurep! +docsets)
|
||||
(def-setting! :docset (modes &rest docsets)
|
||||
"Registers a list of DOCSETS (strings) for MODES (either one major mode
|
||||
symbol or a list of them).
|
||||
|
||||
If MODES is a minor mode, you can use :add or :remove as the first element of
|
||||
DOCSETS, to instruct it to append (or remove) those from the docsets already set
|
||||
by a major-mode, if any.
|
||||
|
||||
Used by `+lookup/in-docsets' and `+lookup/documentation'."
|
||||
(let* ((modes (doom-unquote modes))
|
||||
(ivy-p (featurep! :completion ivy))
|
||||
(hook-sym (intern (format "+lookup|%s-docsets--%s"
|
||||
(cond ((eq ',(car docsets) :add) 'add)
|
||||
((eq ',(car docsets) :remove) 'remove)
|
||||
('set))
|
||||
(string-join docsets "-"))))
|
||||
(var-sym (if ivy-p 'counsel-dash-docsets 'helm-dash-docsets)))
|
||||
`(progn
|
||||
(defun ,hook-sym ()
|
||||
(make-variable-buffer-local ',var-sym)
|
||||
,(cond ((eq ',(car docsets) :add)
|
||||
`(setq ,var-sym (append ,var-sym (list ,@(cdr docsets)))))
|
||||
((eq ',(car docsets) :remove)
|
||||
`(setq ,var-sym
|
||||
(cl-loop with to-delete = (list ,@(cdr docsets))
|
||||
for docset in ,var-sym
|
||||
unless (member docset to-delete)
|
||||
collect docset)))
|
||||
(`(setq ,var-sym (list ,@docsets)))))
|
||||
(add-hook! ,modes #',hook-sym))))
|
||||
|
||||
;; Both packages depend on helm-dash
|
||||
(def-package! helm-dash
|
||||
:commands (helm-dash helm-dash-install-docset helm-dash-at-point
|
||||
helm-dash-docset-installed-p helm-dash-installed-docsets)
|
||||
:defer t
|
||||
:init
|
||||
(setq helm-dash-enable-debugging doom-debug-mode
|
||||
helm-dash-browser-func #'eww)
|
||||
|
@ -214,7 +178,7 @@ Used by `+lookup/in-docsets' and `+lookup/documentation'."
|
|||
|
||||
(def-package! counsel-dash
|
||||
:when (featurep! :completion ivy)
|
||||
:commands (counsel-dash counsel-dash-install-docset)
|
||||
:commands counsel-dash-install-docset
|
||||
:config (setq counsel-dash-min-length 2)))
|
||||
|
||||
|
||||
|
@ -223,20 +187,11 @@ Used by `+lookup/in-docsets' and `+lookup/documentation'."
|
|||
;;
|
||||
|
||||
(when (featurep! +devdocs)
|
||||
(def-setting! :devdocs (modes docset)
|
||||
"Map major MODES (one major-mode symbol or a list of them) to a devdocs
|
||||
DOCSET (a string).
|
||||
|
||||
See `devdocs-alist' for the defaults. "
|
||||
`(dolist (mode ',modes)
|
||||
(push (cons mode ,docset) devdocs-alist)))
|
||||
|
||||
(def-package! devdocs-lookup
|
||||
:commands (devdocs-setup devdocs-lookup)
|
||||
:config
|
||||
(setq devdocs-subjects
|
||||
(append '(("SCSS" "scss")
|
||||
("GFM" "markdown")
|
||||
("Typescript" "typescript"))
|
||||
devdocs-subjects))))
|
||||
(after! devdocs-lookup
|
||||
(unless (assoc "SCSS" devdocs-subjects)
|
||||
(setq devdocs-subjects
|
||||
(append '(("SCSS" "scss")
|
||||
("GFM" "markdown")
|
||||
("Typescript" "typescript"))
|
||||
devdocs-subjects)))))
|
||||
|
||||
|
|
|
@ -1,9 +1,16 @@
|
|||
;;; feature/snippets/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(defvar +snippets-dir (expand-file-name "snippets/" doom-private-dir)
|
||||
"Directory where `yasnippet' will search for your private snippets.")
|
||||
|
||||
|
||||
;;
|
||||
;; Plugins
|
||||
;;
|
||||
|
||||
(def-package! yasnippet
|
||||
:commands (yas-minor-mode yas-minor-mode-on yas-expand yas-expand-snippet
|
||||
yas-lookup-snippet yas-insert-snippet yas-new-snippet
|
||||
yas-visit-snippet-file snippet-mode)
|
||||
:commands (yas-minor-mode-on yas-expand yas-expand-snippet yas-lookup-snippet
|
||||
yas-insert-snippet yas-new-snippet yas-visit-snippet-file)
|
||||
:preface
|
||||
(defvar yas-minor-mode-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
|
@ -23,28 +30,25 @@
|
|||
(setq yas-verbosity (if doom-debug-mode 3 0)
|
||||
yas-also-auto-indent-first-line t
|
||||
yas-prompt-functions (delq #'yas-dropdown-prompt yas-prompt-functions)
|
||||
;; Allow nested snippets
|
||||
yas-triggers-in-field t)
|
||||
yas-triggers-in-field t) ; Allow nested snippets
|
||||
|
||||
(cl-pushnew (expand-file-name "snippets/" doom-private-dir) yas-snippet-dirs
|
||||
:test #'string=)
|
||||
(add-to-list 'yas-snippet-dirs '+snippets-dir nil #'eq)
|
||||
|
||||
(defun +snippets|enable-project-modes (mode &rest _)
|
||||
"Enable snippets for project modes."
|
||||
"Automatically enable snippet libraries for project minor modes defined with
|
||||
`def-project-mode!'."
|
||||
(if (symbol-value mode)
|
||||
(yas-activate-extra-mode mode)
|
||||
(yas-deactivate-extra-mode mode)))
|
||||
(add-hook 'doom-project-hook #'+snippets|enable-project-modes)
|
||||
|
||||
;; fix an error caused by smartparens interfering with yasnippet bindings
|
||||
(advice-add #'yas-expand :before #'sp-remove-active-pair-overlay)
|
||||
|
||||
;; Exit snippets on ESC from normal mode
|
||||
(add-hook 'doom-escape-hook #'yas-abort-snippet))
|
||||
(add-hook 'doom-escape-hook #'yas-abort-snippet)
|
||||
|
||||
(after! smartparens
|
||||
;; fix an error caused by smartparens interfering with yasnippet bindings
|
||||
(advice-add #'yas-expand :before #'sp-remove-active-pair-overlay)))
|
||||
|
||||
|
||||
(def-package! auto-yasnippet
|
||||
:commands (aya-create aya-expand aya-open-line aya-persist-snippet)
|
||||
:config
|
||||
(after! auto-yasnippet
|
||||
(setq aya-persist-snippets-dir (concat doom-local-dir "auto-snippets/")))
|
||||
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
;; -*- lexical-binding: t; no-byte-compile: t; -*-
|
||||
;;; feature/snippets/doctor.el
|
||||
|
||||
(require 'yasnippet)
|
||||
(unless (ignore-errors (yas-reload-all)
|
||||
(yas--get-snippet-tables))
|
||||
(warn! "Couldn't find any snippets in any of these directories: %s" yas-snippet-dirs))
|
|
@ -8,7 +8,7 @@ Since spellchecking can be slow in some buffers, this can be disabled with:
|
|||
(setq-hook! 'LaTeX-mode-hook +spellcheck-immediately nil)")
|
||||
|
||||
(def-package! flyspell ; built-in
|
||||
:commands flyspell-mode
|
||||
:defer t
|
||||
:init
|
||||
(add-hook 'flyspell-mode-hook #'+spellcheck|immediately)
|
||||
:config
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; feature/spellcheck/packages.el
|
||||
|
||||
(package! flyspell-correct)
|
||||
(cond ((featurep! :completion ivy)
|
||||
(package! flyspell-correct-ivy))
|
||||
((featurep! :completion helm)
|
||||
(package! flyspell-correct-helm))
|
||||
(t
|
||||
(package! flyspell-correct-popup)))
|
||||
(when (package! flyspell-correct)
|
||||
(cond ((featurep! :completion ivy)
|
||||
(package! flyspell-correct-ivy))
|
||||
((featurep! :completion helm)
|
||||
(package! flyspell-correct-helm))
|
||||
(t
|
||||
(package! flyspell-correct-popup))))
|
||||
|
||||
|
|
|
@ -1,18 +1,11 @@
|
|||
;;; feature/syntax-checker/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; Since Doom doesn't use `package-initialize', pkg-info won't get autoloaded
|
||||
;; when `flycheck-version' needs it, so we need this:
|
||||
(autoload 'pkg-info-version-info "pkg-info")
|
||||
|
||||
(def-package! flycheck
|
||||
:commands (flycheck-mode flycheck-list-errors flycheck-buffer)
|
||||
:commands (flycheck-list-errors flycheck-buffer)
|
||||
:config
|
||||
;; Emacs feels snappier without checks on newline
|
||||
(setq flycheck-check-syntax-automatically '(save idle-change mode-enabled))
|
||||
|
||||
;; Popup
|
||||
(add-hook 'flycheck-mode-hook #'+syntax-checker-popup-mode)
|
||||
|
||||
(after! evil
|
||||
(defun +syntax-checkers|flycheck-buffer ()
|
||||
"Flycheck buffer on ESC in normal mode."
|
||||
|
@ -20,21 +13,16 @@
|
|||
(ignore-errors (flycheck-buffer))
|
||||
nil))
|
||||
(add-hook 'doom-escape-hook #'+syntax-checkers|flycheck-buffer t)
|
||||
(add-hook 'evil-insert-state-exit-hook #'+syntax-checkers|flycheck-buffer)
|
||||
|
||||
;; With the option of flychecking the buffer on escape or leaving insert
|
||||
;; mode, we don't need auto-flychecking on idle-change (which can feel slow,
|
||||
;; esp on computers without SSDs).
|
||||
(delq 'idle-change flycheck-check-syntax-automatically)))
|
||||
(add-hook 'evil-insert-state-exit-hook #'+syntax-checkers|flycheck-buffer)))
|
||||
|
||||
|
||||
(def-package! flycheck-popup-tip
|
||||
:commands (flycheck-popup-tip-show-popup flycheck-popup-tip-delete-popup))
|
||||
:commands (flycheck-popup-tip-show-popup flycheck-popup-tip-delete-popup)
|
||||
:init (add-hook 'flycheck-mode-hook #'+syntax-checker-popup-mode))
|
||||
|
||||
|
||||
(def-package! flycheck-posframe
|
||||
:when EMACS26+
|
||||
:when (featurep! +childframe)
|
||||
:when (and EMACS26+ (featurep! +childframe))
|
||||
:commands flycheck-posframe-show-posframe
|
||||
:config
|
||||
(setq flycheck-posframe-warning-prefix "⚠ "
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
;;; feature/version-control/+git.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; These don't need `def-package!' blocks because they've already been set up by
|
||||
;; `doom-initialize'.
|
||||
(autoload 'gitconfig-mode "gitconfig-mode" nil t)
|
||||
(autoload 'gitignore-mode "gitignore-mode" nil t)
|
||||
|
||||
(when (featurep! :feature evil)
|
||||
(add-hook 'git-commit-mode-hook #'evil-insert-state))
|
||||
|
||||
|
@ -33,7 +28,7 @@
|
|||
(ignore (git-gutter))))
|
||||
(add-hook 'doom-escape-hook #'+version-control|update-git-gutter t))
|
||||
|
||||
(def-hydra! +version-control@git-gutter
|
||||
(defhydra +version-control@git-gutter
|
||||
(:body-pre (git-gutter-mode 1) :hint nil)
|
||||
"
|
||||
╭─────────────────┐
|
||||
|
@ -59,7 +54,7 @@
|
|||
|
||||
|
||||
(def-package! git-timemachine
|
||||
:commands (git-timemachine git-timemachine-toggle)
|
||||
:defer t
|
||||
:config
|
||||
;; Sometimes I forget `git-timemachine' is enabled in a buffer, so instead of
|
||||
;; showing revision details in the minibuffer, show them in
|
||||
|
@ -67,10 +62,6 @@
|
|||
(setq git-timemachine-show-minibuffer-details t)
|
||||
(advice-add #'git-timemachine--show-minibuffer-details :override #'+vcs*update-header-line)
|
||||
|
||||
;; Force evil to rehash keybindings for the current state
|
||||
(add-hook 'git-timemachine-mode-hook #'evil-force-normal-state))
|
||||
|
||||
|
||||
(def-package! git-link
|
||||
:commands (git-link git-link-commit git-link-homepage))
|
||||
|
||||
(after! evil
|
||||
;; Force evil to rehash keybindings for the current state
|
||||
(add-hook 'git-timemachine-mode-hook #'evil-force-normal-state)))
|
||||
|
|
|
@ -28,11 +28,11 @@
|
|||
(defalias #'smerge-diff-upper-lower #'smerge-diff-mine-other)
|
||||
(defalias #'smerge-diff-base-lower #'smerge-diff-base-other)))
|
||||
|
||||
(def-hydra! +hydra-smerge (:hint nil
|
||||
:pre (smerge-mode 1)
|
||||
;; Disable `smerge-mode' when quitting hydra if
|
||||
;; no merge conflicts remain.
|
||||
:post (smerge-auto-leave))
|
||||
(defhydra +hydra-smerge (:hint nil
|
||||
:pre (smerge-mode 1)
|
||||
;; Disable `smerge-mode' when quitting hydra if
|
||||
;; no merge conflicts remain.
|
||||
:post (smerge-auto-leave))
|
||||
"
|
||||
╭────────┐
|
||||
Movement Keep Diff Other │ smerge │
|
||||
|
|
|
@ -211,7 +211,7 @@ current workspace (by name) from session files."
|
|||
(completing-read
|
||||
"Workspace to load: "
|
||||
(persp-list-persp-names-in-file
|
||||
(expand-file-name +workspace-data-file persp-save-dir))))))
|
||||
(expand-file-name +workspaces-data-file persp-save-dir))))))
|
||||
(if (not (+workspace-load name))
|
||||
(+workspace-error (format "Couldn't load workspace %s" name))
|
||||
(+workspace/switch-to name)
|
||||
|
|
|
@ -27,7 +27,7 @@ new project directory.")
|
|||
stored in `persp-save-dir'.")
|
||||
|
||||
(defun +workspaces-restore-last-session (&rest _)
|
||||
(add-hook 'emacs-startup-hook #'+workspace/load-session 'append))
|
||||
(add-hook 'doom-post-init-hook #'+workspace/load-session 'append))
|
||||
(map-put command-switch-alist '"--restore" #'+workspaces-restore-last-session)
|
||||
|
||||
|
||||
|
@ -77,7 +77,7 @@ Uses `+workspaces-main' to determine the name of the main workspace."
|
|||
(display-buffer-in-side-window
|
||||
warnings '((window-height . shrink-window-if-larger-than-buffer))))))))))
|
||||
|
||||
(add-hook 'doom-init-hook #'+workspaces|init t)
|
||||
(add-hook 'doom-post-init-hook #'+workspaces|init t)
|
||||
:config
|
||||
(setq persp-autokill-buffer-on-remove 'kill-weak
|
||||
persp-nil-hidden t
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
;;; feature/workspaces/test/autoload-workspaces.el
|
||||
|
||||
(require! :feature workspaces)
|
||||
(doom|init-custom-hooks)
|
||||
|
||||
(defmacro with-workspace!! (buffer-args &rest body)
|
||||
(declare (indent defun))
|
||||
|
@ -13,7 +14,8 @@
|
|||
(require 'persp-mode)
|
||||
(let (noninteractive)
|
||||
(persp-mode +1))
|
||||
(+workspace-switch +workspaces-main t)
|
||||
(let (persp-before-switch-functions persp-activated-functions)
|
||||
(+workspace-switch +workspaces-main t))
|
||||
(let* (,@buffers)
|
||||
(cl-loop with persp = (get-current-persp)
|
||||
for buf in (list ,@(mapcar #'car buffers))
|
||||
|
|
4
modules/lang/assembly/autoload.el
Normal file
4
modules/lang/assembly/autoload.el
Normal file
|
@ -0,0 +1,4 @@
|
|||
;;; lang/assembly/autoload.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###autoload
|
||||
(map-put auto-mode-alist "\\.hax\\'" 'haxor-mode)
|
|
@ -1,8 +0,0 @@
|
|||
;;; lang/assembly/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(def-package! mips-mode :mode "\\.mips$")
|
||||
|
||||
(def-package! haxor-mode :mode "\\.hax$")
|
||||
|
||||
(def-package! nasm-mode :commands nasm-mode)
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
(interactive)
|
||||
(unless (memq major-mode '(c-mode c++-mode objc-mode))
|
||||
(user-error "Not a C/C++/ObjC buffer"))
|
||||
(unless (doom-project-has! "compile_commands.json")
|
||||
(unless (project-file-exists-p! "compile_commands.json")
|
||||
(user-error "No compile_commands.json file"))
|
||||
;; first rtag
|
||||
(when (and (featurep 'rtags)
|
||||
|
@ -89,13 +89,6 @@ compilation dbs."
|
|||
nconc (list "-I" path)))
|
||||
(doom-project-root)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +cc|init-rtags ()
|
||||
"Start an rtags server in c-mode and c++-mode buffers."
|
||||
(when (and (memq major-mode '(c-mode c++-mode))
|
||||
(rtags-executable-find "rtags"))
|
||||
(rtags-start-process-unless-running)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +cc|cleanup-rtags ()
|
||||
"Kill rtags server(s) if there are no C/C++ buffers open."
|
||||
|
|
|
@ -55,10 +55,10 @@ compilation database is present in the project.")
|
|||
|
||||
:config
|
||||
(set! :electric '(c-mode c++-mode objc-mode java-mode)
|
||||
:chars '(?\n ?\}))
|
||||
:chars '(?\n ?\}))
|
||||
(set! :company-backend
|
||||
'(c-mode c++-mode objc-mode)
|
||||
'(company-irony-c-headers company-irony))
|
||||
'(c-mode c++-mode objc-mode)
|
||||
'(company-irony-c-headers company-irony))
|
||||
|
||||
;;; Style/formatting
|
||||
;; C/C++ style settings
|
||||
|
@ -101,8 +101,8 @@ compilation database is present in the project.")
|
|||
(label . 0))))
|
||||
|
||||
;;; Keybindings
|
||||
;; Completely disable electric keys because it interferes with smartparens and
|
||||
;; custom bindings. We'll do this ourselves.
|
||||
;; Disable electric keys because it interferes with smartparens and custom
|
||||
;; bindings. We'll do it ourselves (mostly).
|
||||
(setq c-tab-always-indent nil
|
||||
c-electric-flag nil)
|
||||
(dolist (key '("#" "}" "/" "*" ";" "," ":" "(" ")" "\177"))
|
||||
|
@ -129,6 +129,7 @@ compilation database is present in the project.")
|
|||
|
||||
|
||||
(def-package! irony
|
||||
:when (featurep! +irony)
|
||||
:commands (irony-install-server irony-mode)
|
||||
:preface
|
||||
(setq irony-server-install-prefix (concat doom-etc-dir "irony-server/"))
|
||||
|
@ -172,23 +173,13 @@ compilation database is present in the project.")
|
|||
;;
|
||||
|
||||
(def-package! cmake-mode
|
||||
:mode "/CMakeLists\\.txt$"
|
||||
:mode "\\.cmake\\$"
|
||||
:defer t
|
||||
:config
|
||||
(set! :company-backend 'cmake-mode '(company-cmake company-yasnippet)))
|
||||
|
||||
(def-package! cuda-mode :mode "\\.cuh?$")
|
||||
(def-package! opencl-mode :mode "\\.cl\\'")
|
||||
|
||||
(def-package! opencl-mode :mode "\\.cl$")
|
||||
|
||||
(def-package! demangle-mode
|
||||
:hook llvm-mode)
|
||||
|
||||
(def-package! glsl-mode
|
||||
:mode "\\.glsl$"
|
||||
:mode "\\.vert$"
|
||||
:mode "\\.frag$"
|
||||
:mode "\\.geom$")
|
||||
(def-package! demangle-mode :hook llvm-mode)
|
||||
|
||||
|
||||
;;
|
||||
|
@ -213,7 +204,12 @@ compilation database is present in the project.")
|
|||
(def-package! rtags
|
||||
:commands rtags-executable-find
|
||||
:init
|
||||
(add-hook! (c-mode c++-mode) #'+cc|init-rtags)
|
||||
(defun +cc|init-rtags ()
|
||||
"Start an rtags server in c-mode and c++-mode buffers."
|
||||
(when (and (memq major-mode '(c-mode c++-mode))
|
||||
(rtags-executable-find "rtags"))
|
||||
(rtags-start-process-unless-running)))
|
||||
(add-hook 'c-mode-common-hook #'+cc|init-rtags)
|
||||
:config
|
||||
(setq rtags-autostart-diagnostics t
|
||||
rtags-use-bookmarks nil
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
(warn! "Couldn't find the rtag client and/or server programs %s. Disabling rtags support" bins)))
|
||||
|
||||
;; irony server
|
||||
(require 'irony)
|
||||
(unless (file-directory-p irony-server-install-prefix)
|
||||
(warn! "Irony server isn't installed. Run M-x irony-install-server"))
|
||||
(when (require 'irony nil t)
|
||||
(unless (file-directory-p irony-server-install-prefix)
|
||||
(warn! "Irony server isn't installed. Run M-x irony-install-server")))
|
||||
|
||||
(when (featurep! :completion company)
|
||||
;; glslangValidator
|
||||
|
|
|
@ -1,13 +1,7 @@
|
|||
;;; lang/clojure/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(def-package! clojure-mode
|
||||
:mode "\\.clj$"
|
||||
:mode "\\.edn$"
|
||||
:mode "\\(?:build\\|profile\\)\\.boot$"
|
||||
:mode ("\\.cljs$" . clojurescript-mode)
|
||||
:mode ("\\.cljc$" . clojurec-mode)
|
||||
:config
|
||||
(add-hook 'clojure-mode #'rainbow-delimiters-mode))
|
||||
;; `clojure-mode'
|
||||
(add-hook 'clojure-mode #'rainbow-delimiters-mode)
|
||||
|
||||
|
||||
(def-package! clj-refactor
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
;;; lang/crystal/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(def-package! crystal-mode
|
||||
:mode "\\.cr$"
|
||||
:interpreter "crystal"
|
||||
:defer t
|
||||
:config
|
||||
(set! :lookup 'crystal-mode
|
||||
:definition #'crystal-def-jump
|
||||
|
@ -19,5 +18,4 @@
|
|||
:config (add-hook 'crystal-mode-hook #'flycheck-mode))
|
||||
|
||||
|
||||
(def-package! inf-crystal
|
||||
:commands (inf-crystal crystal-switch-to-inf))
|
||||
(def-package! inf-crystal :commands crystal-switch-to-inf)
|
||||
|
|
|
@ -1,17 +1,16 @@
|
|||
;;; lang/csharp/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(def-package! csharp-mode :mode "\\.cs$")
|
||||
|
||||
(def-package! shader-mode :mode "\\.shader$") ; unity shaders
|
||||
(add-to-list 'auto-mode-alist '("\\.shader$" . shader-mode)) ; unity shaders
|
||||
|
||||
|
||||
(def-package! omnisharp
|
||||
:after csharp-mode
|
||||
:hook (csharp-mode . omnisharp-mode)
|
||||
:commands omnisharp-install-server
|
||||
:preface
|
||||
(setq omnisharp-auto-complete-want-documentation nil
|
||||
omnisharp-cache-directory (concat doom-cache-dir "omnisharp"))
|
||||
:config
|
||||
(add-hook! csharp-mode #'(flycheck-mode omnisharp-mode))
|
||||
(add-hook 'csharp-mode-hook #'flycheck-mode)
|
||||
|
||||
(defun +csharp|cleanup-omnisharp-server ()
|
||||
"Clean up the omnisharp server once you kill the last csharp-mode buffer."
|
||||
|
|
|
@ -1,47 +1,41 @@
|
|||
;;; lang/data/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(push '("/sxhkdrc" . conf-mode) auto-mode-alist)
|
||||
;; Built in plugins
|
||||
(dolist (spec '(("/sxhkdrc\\'" . conf-mode)
|
||||
("\\.\\(?:hex\\|nes\\)\\'" . hexl-mode)
|
||||
("\\.plist\\'" . nxml-mode)))
|
||||
(map-put auto-mode-alist (car spec) (cdr spec)))
|
||||
|
||||
(set! :company-backend 'nxml-mode '(company-nxml company-yasnippet))
|
||||
|
||||
|
||||
(def-package! dockerfile-mode
|
||||
:mode "/Dockerfile$")
|
||||
;;
|
||||
;; Third-party plugins
|
||||
;;
|
||||
|
||||
;; `csv-mode'
|
||||
(map! :after csv-mode
|
||||
:map csv-mode-map
|
||||
(:localleader
|
||||
:desc "Align fields" :nvm "a" #'csv-align-fields
|
||||
:desc "Unalign fields" :nvm "u" #'csv-unalign-fields
|
||||
:desc "Sort fields" :nvm "s" #'csv-sort-fields
|
||||
:desc "Sort fields (n)" :nvm "S" #'csv-sort-numeric-fields
|
||||
:desc "Kill fields" :nvm "k" #'csv-kill-fields
|
||||
:desc "Transpose fields" :nvm "t" #'csv-transpose))
|
||||
|
||||
(def-package! graphql-mode
|
||||
:mode "\\.g\\(?:raph\\)?ql$")
|
||||
|
||||
|
||||
(def-package! hexl ; For ROM hacking or debugging
|
||||
:mode ("\\.hex$" . hexl-mode)
|
||||
:mode ("\\.nes$" . hexl-mode))
|
||||
|
||||
:mode "\\.gql\\'")
|
||||
|
||||
(def-package! json-mode
|
||||
:mode "\\.js\\(?:on\\|[hl]int\\(rc\\)?\\)$"
|
||||
:mode "\\.js\\(?:on\\|[hl]int\\(rc\\)?\\)\\'"
|
||||
:config
|
||||
(when (featurep! :feature syntax-checker)
|
||||
(add-hook 'json-mode-hook #'flycheck-mode))
|
||||
(set! :electric 'json-mode :chars '(?\n ?: ?{ ?})))
|
||||
|
||||
|
||||
(def-package! nxml-mode
|
||||
:mode "\\.plist$"
|
||||
:config
|
||||
(set! :company-backend 'nxml-mode '(company-nxml company-yasnippet)))
|
||||
|
||||
|
||||
(def-package! toml-mode
|
||||
:mode "\\.toml$")
|
||||
|
||||
|
||||
(def-package! vimrc-mode
|
||||
:mode "/\\.?g?vimrc$"
|
||||
:mode "\\.vimp?$"
|
||||
:mode "\\.?vimperatorrc$")
|
||||
|
||||
|
||||
(def-package! yaml-mode
|
||||
:mode "\\.ya?ml$")
|
||||
:mode "\\.?vimperatorrc\\'")
|
||||
|
||||
|
||||
;;
|
||||
|
|
|
@ -7,4 +7,4 @@
|
|||
(package! toml-mode)
|
||||
(package! vimrc-mode)
|
||||
(package! yaml-mode)
|
||||
|
||||
(package! csv-mode)
|
||||
|
|
|
@ -1,21 +1,18 @@
|
|||
;;; lang/elixir/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(def-package! elixir-mode
|
||||
:mode "\\.exs?\\'"
|
||||
:mode "\\.elixir2\\'"
|
||||
:init
|
||||
;; sp's default elixir rules are obnoxious, so disable them
|
||||
(provide 'smartparens-elixir)
|
||||
:defer t
|
||||
:config
|
||||
;; ...and only complete the basics
|
||||
(sp-with-modes 'elixir-mode
|
||||
(sp-local-pair "do" "end"
|
||||
:when '(("RET" "<evil-ret>"))
|
||||
:unless '(sp-in-comment-p sp-in-string-p)
|
||||
:skip-match 'sp-elixir-skip-def-p
|
||||
:post-handlers '("||\n[i]"))
|
||||
(sp-local-pair "do " " end" :unless '(sp-in-comment-p sp-in-string-p))
|
||||
(sp-local-pair "fn " " end" :unless '(sp-in-comment-p sp-in-string-p))))
|
||||
(after! smartparens
|
||||
(sp-with-modes 'elixir-mode
|
||||
(sp-local-pair "do" "end"
|
||||
:when '(("RET" "<evil-ret>"))
|
||||
:unless '(sp-in-comment-p sp-in-string-p)
|
||||
:skip-match 'sp-elixir-skip-def-p
|
||||
:post-handlers '("||\n[i]"))
|
||||
(sp-local-pair "do " " end" :unless '(sp-in-comment-p sp-in-string-p))
|
||||
(sp-local-pair "fn " " end" :unless '(sp-in-comment-p sp-in-string-p)))))
|
||||
|
||||
|
||||
(def-package! alchemist
|
||||
|
@ -30,13 +27,13 @@
|
|||
|
||||
(def-package! alchemist-company
|
||||
:when (featurep! :completion company)
|
||||
:after elixir-mode
|
||||
:commands alchemist-company
|
||||
:init
|
||||
(set! :company-backend 'elixir-mode '(alchemist-company company-yasnippet))
|
||||
:config
|
||||
;; Alchemist doesn't use hook symbols to add these backends, so we have to use
|
||||
;; the entire closure to get rid of it.
|
||||
(let ((fn (byte-compile (lambda () (add-to-list (make-local-variable 'company-backends) 'alchemist-company)))))
|
||||
(remove-hook 'alchemist-mode-hook fn)
|
||||
(remove-hook 'alchemist-iex-mode-hook fn))
|
||||
|
||||
(set! :company-backend 'elixir-mode '(alchemist-company company-yasnippet)))
|
||||
(remove-hook 'alchemist-iex-mode-hook fn)))
|
||||
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
;;; lang/elm/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(def-package! elm-mode
|
||||
:mode "\\.elm$"
|
||||
:config
|
||||
(load "elm-mode-autoloads" nil t)
|
||||
(add-hook! 'elm-mode-hook #'(flycheck-mode rainbow-delimiters-mode))
|
||||
(set! :company-backend 'elm-mode '(company-elm))
|
||||
(set! :repl 'elm-mode #'run-elm-interactive)
|
||||
(setq elm-format-on-save t))
|
||||
;; `elm-mode'
|
||||
(setq elm-format-on-save t)
|
||||
|
||||
(add-hook! 'elm-mode-hook #'(flycheck-mode rainbow-delimiters-mode))
|
||||
|
||||
(set! :company-backend 'elm-mode 'company-elm)
|
||||
(set! :repl 'elm-mode #'run-elm-interactive)
|
||||
|
||||
|
||||
(def-package! flycheck-elm
|
||||
|
|
|
@ -1,5 +1,13 @@
|
|||
;;; lang/emacs-lisp/autoload.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###autoload
|
||||
(autoload 'overseer-test "overseer" nil t)
|
||||
|
||||
|
||||
;;
|
||||
;; Library
|
||||
;;
|
||||
|
||||
;;;###autoload
|
||||
(defun +emacs-lisp/repl ()
|
||||
"Open the Emacs Lisp REPL (`ielm')."
|
||||
|
|
|
@ -67,27 +67,17 @@
|
|||
;; Plugins
|
||||
;;
|
||||
|
||||
(def-package! auto-compile
|
||||
:commands auto-compile-on-save-mode
|
||||
:config
|
||||
(setq auto-compile-display-buffer nil
|
||||
auto-compile-use-mode-line nil))
|
||||
;; `auto-compile'
|
||||
(setq auto-compile-display-buffer nil
|
||||
auto-compile-use-mode-line nil)
|
||||
|
||||
|
||||
(def-package! highlight-quoted
|
||||
:commands highlight-quoted-mode)
|
||||
;; `slime'
|
||||
(setq inferior-lisp-program "clisp")
|
||||
(after! slime (require 'slime-fuzzy))
|
||||
|
||||
|
||||
(def-package! slime
|
||||
:defer t
|
||||
:config
|
||||
(setq inferior-lisp-program "clisp")
|
||||
(require 'slime-fuzzy))
|
||||
|
||||
|
||||
(def-package! macrostep
|
||||
:commands macrostep-expand
|
||||
:config
|
||||
(after! macrostep
|
||||
(map! :map macrostep-keymap
|
||||
:n "RET" #'macrostep-expand
|
||||
:n "e" #'macrostep-expand
|
||||
|
@ -104,6 +94,7 @@
|
|||
|
||||
:n "q" #'macrostep-collapse-all
|
||||
:n "C" #'macrostep-collapse-all)
|
||||
|
||||
;; `evil-normalize-keymaps' seems to be required for macrostep or it won't
|
||||
;; apply for the very first invocation
|
||||
(add-hook 'macrostep-mode-hook #'evil-normalize-keymaps))
|
||||
|
@ -111,18 +102,14 @@
|
|||
|
||||
(def-package! flycheck-cask
|
||||
:when (featurep! :feature syntax-checker)
|
||||
:commands flycheck-cask-setup
|
||||
:defer t
|
||||
:init
|
||||
(add-hook! 'emacs-lisp-mode-hook
|
||||
(add-hook 'flycheck-mode-hook #'flycheck-cask-setup nil t)))
|
||||
|
||||
|
||||
(def-package! overseer
|
||||
:commands overseer-test)
|
||||
|
||||
|
||||
;;
|
||||
;;
|
||||
;; Project modes
|
||||
;;
|
||||
|
||||
(def-project-mode! +emacs-lisp-ert-mode
|
||||
|
|
|
@ -1,20 +1,19 @@
|
|||
;;; private/erlang/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(def-package! erlang
|
||||
;; customizations
|
||||
:mode "\\.erlang$"
|
||||
;; rebar files
|
||||
:mode "/rebar\\.config\\(?:\\.script\\)?$"
|
||||
;; erlang configs
|
||||
:mode "/\\(?:app\\|sys\\)\\.config$")
|
||||
(dolist (regexp '("\\.erlang$"
|
||||
;; rebar files
|
||||
"/rebar\\.config\\(?:\\.script\\)?$"
|
||||
;; erlang configs
|
||||
"/\\(?:app\\|sys\\)\\.config$"))
|
||||
(map-put auto-mode-alist regexp 'erlang-mode))
|
||||
|
||||
|
||||
(def-package! flycheck-rebar3
|
||||
:when (featurep! :feature syntax-checker)
|
||||
:after erlang
|
||||
:config
|
||||
(flycheck-rebar3-setup))
|
||||
:after flycheck
|
||||
:config (flycheck-rebar3-setup))
|
||||
|
||||
|
||||
;; Completion via Ivy
|
||||
(def-package! ivy-erlang-complete
|
||||
:when (featurep! :completion ivy)
|
||||
:hook (erlang-mode . ivy-erlang-complete-init)
|
||||
|
@ -23,7 +22,6 @@
|
|||
(add-hook 'after-save-hook #'ivy-erlang-complete-reparse nil t)))
|
||||
|
||||
|
||||
;; Completion via Company
|
||||
(def-package! company-erlang
|
||||
:when (featurep! :completion company)
|
||||
:hook (erlang-mode . company-erlang-init))
|
||||
|
|
|
@ -79,6 +79,6 @@
|
|||
:n "cn" #'ess-noweb-next-chunk))))
|
||||
|
||||
|
||||
(def-package! ess-smart-equals
|
||||
:hook ((ess-mode . ess-smart-equals-mode)
|
||||
(inferior-ess-mode . ess-smart-equals-mode)))
|
||||
;; `ess-smart-equals-mode'
|
||||
(add-hook! (ess-mode inferior-ess)
|
||||
#'ess-smart-equals-mode)
|
||||
|
|
|
@ -4,10 +4,7 @@
|
|||
;; Plugins
|
||||
;;
|
||||
|
||||
(def-package! go-mode
|
||||
:mode "\\.go$"
|
||||
:interpreter "go"
|
||||
:config
|
||||
(after! go-mode
|
||||
(set! :env "GOPATH" "GOROOT")
|
||||
(set! :repl 'go-mode #'gorepl-run)
|
||||
(set! :lookup 'go-mode
|
||||
|
@ -15,11 +12,12 @@
|
|||
:references #'go-guru-referrers
|
||||
:documentation #'godoc-at-point)
|
||||
|
||||
(when (executable-find "goimports")
|
||||
(setq gofmt-command "goimports"))
|
||||
(when-let* ((goimports (executable-find "goimports")))
|
||||
(setq gofmt-command goimports))
|
||||
|
||||
(setq gofmt-show-errors nil) ; Leave it to flycheck
|
||||
(add-hook 'go-mode-hook #'flycheck-mode)
|
||||
|
||||
(add-hook! 'go-mode-hook #'(flycheck-mode go-eldoc-setup))
|
||||
(add-hook! go-mode
|
||||
(add-hook 'before-save-hook #'gofmt-before-save nil t))
|
||||
|
||||
|
@ -70,25 +68,13 @@
|
|||
:v "r" #'go-play-region))
|
||||
|
||||
|
||||
(def-package! go-eldoc
|
||||
:hook (go-mode . go-eldoc-setup))
|
||||
|
||||
|
||||
(def-package! go-guru
|
||||
:commands (go-guru-describe go-guru-freevars go-guru-implements go-guru-peers
|
||||
go-guru-referrers go-guru-definition go-guru-pointsto
|
||||
go-guru-callstack go-guru-whicherrs go-guru-callers go-guru-callees
|
||||
go-guru-expand-region))
|
||||
|
||||
|
||||
(def-package! gorepl-mode
|
||||
:commands (gorepl-run gorepl-run-load-current-file))
|
||||
:commands gorepl-run-load-current-file)
|
||||
|
||||
|
||||
(def-package! company-go
|
||||
:when (featurep! :completion company)
|
||||
:init (setq command-go-gocode-command "gocode")
|
||||
:after go-mode
|
||||
:config
|
||||
(setq company-go-show-annotation t)
|
||||
(set! :company-backend 'go-mode '(company-go)))
|
||||
(set! :company-backend 'go-mode 'company-go)
|
||||
(setq company-go-show-annotation t))
|
||||
|
|
|
@ -8,18 +8,7 @@
|
|||
;; Common plugins
|
||||
;;
|
||||
|
||||
(def-package! haskell-mode
|
||||
:mode "\\.hs$"
|
||||
:mode ("\\.ghci$" . ghci-script-mode)
|
||||
:mode ("\\.cabal$" . haskell-cabal-mode)
|
||||
:interpreter (("runghc" . haskell-mode)
|
||||
("runhaskell" . haskell-mode))
|
||||
:config
|
||||
(load "haskell-mode-autoloads" nil t)
|
||||
(after! haskell-mode
|
||||
(set! :repl 'haskell-mode #'switch-to-haskell)
|
||||
(push ".hi" completion-ignored-extensions)
|
||||
|
||||
(autoload 'switch-to-haskell "inf-haskell" nil t)
|
||||
(after! inf-haskell
|
||||
(map! :map inferior-haskell-mode-map "ESC ESC" #'+popup/close)))
|
||||
(add-to-list 'completion-ignored-extensions ".hi"))
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
;;; lang/hy/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(def-package! hy-mode
|
||||
:mode "\\.hy$"
|
||||
:mode "\\.hy\\'"
|
||||
:interpreter "hy"
|
||||
:config
|
||||
(set! :repl 'hy-mode #'hy-shell-start-or-switch-to-shell)
|
||||
(set! :company-backend 'hy-mode '(company-hy)))
|
||||
(set! :company-backend 'hy-mode 'company-hy))
|
||||
|
|
|
@ -24,9 +24,9 @@
|
|||
|
||||
;;;###autoload
|
||||
(defun +java|android-mode-maybe ()
|
||||
(when (doom-project-has! (or "local.properties"
|
||||
"AndroidManifest.xml"
|
||||
"src/main/AndroidManifest.xml"))
|
||||
(when (project-file-exists-p! (or "local.properties"
|
||||
"AndroidManifest.xml"
|
||||
"src/main/AndroidManifest.xml"))
|
||||
(android-mode +1)
|
||||
(doom/set-build-command "./gradlew %s" "build.gradle")))
|
||||
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
(add-hook 'java-mode-hook #'rainbow-delimiters-mode)
|
||||
|
||||
(cond ((featurep! +meghanada) (load! +meghanada))
|
||||
;; TODO lang/java +eclim
|
||||
;; ((featurep! +eclim) (load! +eclim))
|
||||
;; TODO lang/java +lsp (lsp-java?)
|
||||
;; ((featurep! +lsp) (load! +lsp))
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
(add-hook! 'js2-mode-hook #'(flycheck-mode rainbow-delimiters-mode))
|
||||
|
||||
(set! :electric 'js2-mode :chars '(?\} ?\) ?. ?:))
|
||||
(set! :repl 'js2-mode #'+javascript/repl)
|
||||
|
||||
;; Conform switch-case indentation to js2 normal indent
|
||||
(defvaralias 'js-switch-indent-offset 'js2-basic-offset)
|
||||
|
@ -31,19 +32,10 @@
|
|||
|
||||
(map! :map js2-mode-map
|
||||
:localleader
|
||||
:n "S" #'+javascript/skewer-this-buffer))
|
||||
|
||||
|
||||
(def-package! typescript-mode
|
||||
:commands typescript-mode
|
||||
:config
|
||||
(add-hook! 'typescript-mode-hook #'(flycheck-mode rainbow-delimiters-mode))
|
||||
(set! :electric 'typescript-mode
|
||||
:chars '(?\} ?\)) :words '("||" "&&")))
|
||||
:n "S" #'+javascript/skewer-this-buffer))
|
||||
|
||||
|
||||
(def-package! rjsx-mode
|
||||
:commands rjsx-mode
|
||||
:mode "components/.+\\.js$"
|
||||
:init
|
||||
(defun +javascript-jsx-file-p ()
|
||||
|
@ -54,8 +46,7 @@
|
|||
magic-mode-regexp-match-limit t)
|
||||
(progn (goto-char (match-beginning 1))
|
||||
(not (sp-point-in-string-or-comment)))))
|
||||
|
||||
(push '(+javascript-jsx-file-p . rjsx-mode) magic-mode-alist)
|
||||
(map-put magic-mode-alist #'+javascript-jsx-file-p 'rjsx-mode)
|
||||
:config
|
||||
(set! :electric 'rjsx-mode :chars '(?\} ?\) ?. ?>))
|
||||
(add-hook! 'rjsx-mode-hook
|
||||
|
@ -67,14 +58,19 @@
|
|||
;; However, the parser doesn't run immediately, so a fast typist can outrun
|
||||
;; it, causing issues, so force it to parse.
|
||||
(defun +javascript|reparse (n)
|
||||
;; if n != 0, then rjsx-maybe-reparse will be run elsewhere
|
||||
(if (= n 0) (rjsx-maybe-reparse)))
|
||||
;; if n != 1, rjsx-electric-gt calls rjsx-maybe-reparse itself
|
||||
(if (= n 1) (rjsx-maybe-reparse)))
|
||||
(advice-add #'rjsx-electric-gt :before #'+javascript|reparse))
|
||||
|
||||
|
||||
(def-package! coffee-mode
|
||||
:defer t ; file extensions registered by autoloads file
|
||||
:init (setq coffee-indent-like-python-mode t))
|
||||
(after! typescript-mode
|
||||
(add-hook! 'typescript-mode-hook #'(flycheck-mode rainbow-delimiters-mode))
|
||||
(set! :electric 'typescript-mode
|
||||
:chars '(?\} ?\)) :words '("||" "&&")))
|
||||
|
||||
|
||||
;; `coffee-mode'
|
||||
(setq coffee-indent-like-python-mode t)
|
||||
|
||||
|
||||
;;
|
||||
|
@ -86,6 +82,7 @@
|
|||
:hook (typescript-mode . tide-setup)
|
||||
:init
|
||||
(defun +javascript|init-tide-in-web-mode ()
|
||||
"Enable `tide-mode' if in a *.tsx file."
|
||||
(when (string= (file-name-extension (or buffer-file-name "")) "tsx")
|
||||
(tide-setup)))
|
||||
(add-hook 'web-mode-hook #'+javascript|init-tide-in-web-mode)
|
||||
|
@ -156,12 +153,6 @@
|
|||
:init (set! :lookup 'js2-mode :xref-backend #'xref-js2-xref-backend))
|
||||
|
||||
|
||||
(def-package! nodejs-repl
|
||||
:commands nodejs-repl
|
||||
:init
|
||||
(set! :repl 'js2-mode #'+javascript/repl))
|
||||
|
||||
|
||||
(def-package! js2-refactor
|
||||
:commands
|
||||
(js2r-extract-function js2r-extract-method js2r-introduce-parameter
|
||||
|
@ -174,51 +165,38 @@
|
|||
js2r-debug-this js2r-forward-slurp js2r-forward-barf))
|
||||
|
||||
|
||||
(def-package! web-beautify
|
||||
:commands web-beautify-js
|
||||
:init
|
||||
(map! :map* (json-mode js2-mode-map) :n "gQ" #'web-beautify-js))
|
||||
|
||||
|
||||
(def-package! eslintd-fix
|
||||
:commands (eslintd-fix-mode eslintd-fix)
|
||||
:commands eslintd-fix
|
||||
:config
|
||||
(defun +javascript|set-flycheck-executable-to-eslint ()
|
||||
(setq flycheck-javascript-eslint-executable eslintd-fix-executable))
|
||||
(add-hook 'eslintd-fix-mode-hook #'+javascript|set-flycheck-executable-to-eslint))
|
||||
|
||||
|
||||
(def-package! skewer-mode
|
||||
:commands (skewer-mode run-skewer)
|
||||
:config
|
||||
(map! :map skewer-mode-map
|
||||
;; `skewer-mode'
|
||||
(map! (:after skewer-mode
|
||||
:map skewer-mode-map
|
||||
:localleader
|
||||
:n "sE" #'skewer-eval-last-expression
|
||||
:n "se" #'skewer-eval-defun
|
||||
:n "sf" #'skewer-load-buffer))
|
||||
:n "sf" #'skewer-load-buffer)
|
||||
|
||||
|
||||
(def-package! skewer-css ; in skewer-mode
|
||||
:commands skewer-css-mode
|
||||
:config
|
||||
(map! :map skewer-css-mode-map
|
||||
(:after skewer-css
|
||||
:map skewer-css-mode-map
|
||||
:localleader
|
||||
:n "se" #'skewer-css-eval-current-declaration
|
||||
:n "sr" #'skewer-css-eval-current-rule
|
||||
:n "sb" #'skewer-css-eval-buffer
|
||||
:n "sc" #'skewer-css-clear-all))
|
||||
:n "sc" #'skewer-css-clear-all)
|
||||
|
||||
|
||||
(def-package! skewer-html ; in skewer-mode
|
||||
:commands skewer-html-mode
|
||||
:config
|
||||
(map! :map skewer-html-mode-map
|
||||
(:after skewer-html
|
||||
:map skewer-html-mode-map
|
||||
:localleader
|
||||
:n "se" #'skewer-html-eval-tag))
|
||||
|
||||
|
||||
(def-package! skewer-repl
|
||||
:commands skewer-repl)
|
||||
;; `web-beautify'
|
||||
(map! :map* (json-mode-map js2-mode-map) :n "gQ" #'web-beautify-js)
|
||||
|
||||
|
||||
;;
|
||||
|
@ -226,7 +204,7 @@
|
|||
;;
|
||||
|
||||
(def-project-mode! +javascript-screeps-mode
|
||||
:match "/screeps\\(-ai\\)?/.+$"
|
||||
:match "/screeps\\(?:-ai\\)?/.+$"
|
||||
:modes (+javascript-npm-mode)
|
||||
:add-hooks (+javascript|init-screeps-mode)
|
||||
:on-load (load! +screeps))
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
;;; lang/julia/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(use-package julia-mode
|
||||
:mode "\\.jl$"
|
||||
:interpreter "julia"
|
||||
:config
|
||||
(set! :repl 'julia-mode #'+julia/repl)
|
||||
|
|
|
@ -18,21 +18,12 @@
|
|||
"Sets the directory where AUCTeX will search for PDFs associated to BibTeX references."
|
||||
`(setq +latex-bibtex-dir ,dir))
|
||||
|
||||
;; sp's default latex rules are obnoxious, so disable them
|
||||
(provide 'smartparens-latex)
|
||||
|
||||
|
||||
;;
|
||||
;; Plugins
|
||||
;;
|
||||
|
||||
(def-package! tex-site
|
||||
:init
|
||||
;; Manually load the AUCTEX autoloads. This is normally done by
|
||||
;; package-initialize, ... which we do not use.
|
||||
(load "auctex.el" nil t t)
|
||||
(load "auctex-autoloads.el" nil t t)
|
||||
:config
|
||||
(after! tex-site
|
||||
;; Set some varibles to fontify common LaTeX commands.
|
||||
(load! +fontification)
|
||||
(setq ;; Enable parse on load.
|
||||
|
@ -182,7 +173,6 @@
|
|||
|
||||
(def-package! bibtex
|
||||
:defer t
|
||||
:mode ("\\.bib\\'" . bibtex-mode)
|
||||
:config
|
||||
(setq bibtex-dialect 'biblatex
|
||||
bibtex-align-at-equal-sign t
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
;;; lang/ledger/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(def-package! ledger-mode
|
||||
:mode "\\.ledger$"
|
||||
:config (setq ledger-clear-whole-transactions 1))
|
||||
;; `ledger-mode'
|
||||
(setq ledger-clear-whole-transactions 1)
|
||||
|
||||
|
||||
(def-package! evil-ledger
|
||||
|
@ -12,4 +11,5 @@
|
|||
|
||||
(def-package! flycheck-ledger
|
||||
:when (featurep! :feature syntax-checker)
|
||||
:init (add-hook 'ledger-mode-hook #'flycheck-mode))
|
||||
:after ledger-mode
|
||||
:config (add-hook 'ledger-mode-hook #'flycheck-mode))
|
||||
|
|
|
@ -1,18 +1,12 @@
|
|||
;;; lang/lua/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(def-package! lua-mode
|
||||
:mode "\\.lua$"
|
||||
:interpreter "lua"
|
||||
:init
|
||||
;; sp's default lua rules are obnoxious, so disable them. Use snippets
|
||||
;; instead!
|
||||
(provide 'smartparens-lua)
|
||||
:config
|
||||
(after! lua-mode
|
||||
(add-hook 'lua-mode-hook #'flycheck-mode)
|
||||
|
||||
(set! :lookup 'lua-mode :documentation 'lua-search-documentation)
|
||||
(set! :electric 'lua-mode :words '("else" "end"))
|
||||
(set! :repl 'lua-mode #'+lua/repl)
|
||||
(set! :company-backend 'lua-mode '(company-lua company-yasnippet))
|
||||
|
||||
(def-menu! +lua/build-menu
|
||||
"Build/compilation commands for `lua-mode' buffers."
|
||||
|
@ -24,15 +18,8 @@
|
|||
:n "b" #'+lua/build-menu))
|
||||
|
||||
|
||||
(def-package! company-lua
|
||||
:after (:all company lua-mode)
|
||||
:config
|
||||
(set! :company-backend 'lua-mode '(company-lua company-yasnippet)))
|
||||
|
||||
|
||||
(def-package! moonscript
|
||||
:mode ("\\.moon$" . moonscript-mode)
|
||||
:config (defvaralias 'moonscript-indent-offset 'tab-width))
|
||||
(after! moonscript
|
||||
(defvaralias 'moonscript-indent-offset 'tab-width))
|
||||
|
||||
|
||||
;;
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
;;; lang/markdown/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(def-package! markdown-mode
|
||||
:mode "/README$"
|
||||
:mode ("/README\\.md$" . gfm-mode)
|
||||
:mode "\\.m\\(?:d\\|arkdown\\)$"
|
||||
:mode ("/README\\(?:\\.\\(?:markdown\\|md\\)\\)?\\'" . gfm-mode)
|
||||
:init
|
||||
(setq markdown-enable-wiki-links t
|
||||
markdown-enable-math t
|
||||
|
|
|
@ -1,32 +1,20 @@
|
|||
;;; lang/nim/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(def-package! nim-mode
|
||||
:mode "\\.nim\\'"
|
||||
:mode ("\\.nim\\(ble\\|s\\)\\'" . nimscript-mode)
|
||||
:config
|
||||
(load "nim-mode-autoloads" nil t)
|
||||
;; NOTE nim-mode autoloads sets up xref
|
||||
|
||||
(after! nim-mode
|
||||
(defun +nim|init-nimsuggest-mode ()
|
||||
"Conditionally load `nimsuggest-mode', instead of clumsily erroring out if
|
||||
nimsuggest isn't installed."
|
||||
(when (executable-find "nimsuggest")
|
||||
(when (file-executable-p nimsuggest-path)
|
||||
(nimsuggest-mode)))
|
||||
(add-hook 'nim-mode-hook #'+nim|init-nimsuggest-mode)
|
||||
|
||||
(map! :map nim-mode-map
|
||||
:localleader
|
||||
:n "b" #'+nim/build-menu)
|
||||
|
||||
(def-menu! +nim/build-menu
|
||||
"Building commands for `nim-mode' buffers."
|
||||
'(("Build & run" :exec nim-compile))
|
||||
:prompt "Build"))
|
||||
:n "b" #'nim-compile))
|
||||
|
||||
|
||||
(def-package! flycheck-nim
|
||||
:when (featurep! :feature syntax-checker)
|
||||
:after nim-mode
|
||||
:config
|
||||
(add-hook 'nimsuggest-mode-hook #'flycheck-mode))
|
||||
:config (add-hook 'nimsuggest-mode-hook #'flycheck-mode))
|
||||
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
;;; lang/nix/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(def-package! nix-mode
|
||||
:mode "\\.nix$")
|
|
@ -1,9 +1,13 @@
|
|||
;;; lang/ocaml/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(def-package! tuareg
|
||||
:mode ("\\.ml[4ilpy]?$" . tuareg-mode))
|
||||
:mode ("\\.ml[4ilpy]?\\'" . tuareg-mode))
|
||||
|
||||
|
||||
(def-package! merlin
|
||||
:after tuareg
|
||||
:hook (tuareg-mode . merlin-mode))
|
||||
:hook (tuareg-mode . merlin-mode)
|
||||
:config
|
||||
(set! :company-backend 'tuareg-mode 'merlin-compand-backend)
|
||||
(after! company
|
||||
(remove-hook 'company-backends 'merlin-compand-backend)))
|
||||
|
|
|
@ -16,12 +16,8 @@
|
|||
;; Plugins
|
||||
;;
|
||||
|
||||
(def-package! toc-org
|
||||
:commands toc-org-enable
|
||||
:config (setq toc-org-hrefify-default "org"))
|
||||
|
||||
(def-package! org-bullets
|
||||
:commands org-bullets-mode)
|
||||
;; `toc-org'
|
||||
(setq toc-org-hrefify-default "org")
|
||||
|
||||
(def-package! evil-org
|
||||
:when (featurep! :feature evil)
|
||||
|
@ -126,7 +122,13 @@ unfold to point on startup."
|
|||
org-agenda-dim-blocked-tasks nil
|
||||
org-agenda-files (ignore-errors (directory-files +org-dir t "\\.org$" t))
|
||||
org-agenda-inhibit-startup t
|
||||
org-agenda-skip-unavailable-files t))
|
||||
org-agenda-skip-unavailable-files t)
|
||||
;; Move the agenda to show the previous 3 days and the next 7 days for a bit
|
||||
;; better context instead of just the current week which is a bit confusing
|
||||
;; on, for example, a sunday
|
||||
(setq org-agenda-span 10
|
||||
org-agenda-start-on-weekday nil
|
||||
org-agenda-start-day "-3d"))
|
||||
|
||||
(defun +org|setup-ui ()
|
||||
"Configures the UI for `org-mode'."
|
||||
|
@ -278,12 +280,14 @@ between the two."
|
|||
:ni [M-return] (λ! (+org/insert-item 'below))
|
||||
:ni [S-M-return] (λ! (+org/insert-item 'above))
|
||||
;; more org-ish vim motion keys
|
||||
:n "]]" (λ! (org-forward-heading-same-level nil) (org-beginning-of-line))
|
||||
:n "[[" (λ! (org-backward-heading-same-level nil) (org-beginning-of-line))
|
||||
:n "]l" #'org-next-link
|
||||
:n "[l" #'org-previous-link
|
||||
:n "]s" #'org-babel-next-src-block
|
||||
:n "[s" #'org-babel-previous-src-block
|
||||
:m "]]" (λ! (org-forward-heading-same-level nil) (org-beginning-of-line))
|
||||
:m "[[" (λ! (org-backward-heading-same-level nil) (org-beginning-of-line))
|
||||
:m "]h" #'org-next-visible-heading
|
||||
:m "[h" #'org-previous-visible-heading
|
||||
:m "]l" #'org-next-link
|
||||
:m "[l" #'org-previous-link
|
||||
:m "]s" #'org-babel-next-src-block
|
||||
:m "[s" #'org-babel-previous-src-block
|
||||
:m "^" #'evil-org-beginning-of-line
|
||||
:m "0" (λ! (let ((visual-line-mode)) (org-beginning-of-line)))
|
||||
:n "gQ" #'org-fill-paragraph
|
||||
|
@ -348,10 +352,11 @@ between the two."
|
|||
(def-package! org-clock
|
||||
:commands org-clock-save
|
||||
:hook (org-mode . org-clock-load)
|
||||
:config
|
||||
:init
|
||||
(setq org-clock-persist 'history
|
||||
org-clock-persist-file (concat doom-etc-dir "org-clock-save.el"))
|
||||
(add-hook 'kill-emacs-hook 'org-clock-save))
|
||||
:config
|
||||
(add-hook 'kill-emacs-hook #'org-clock-save))
|
||||
|
||||
;;
|
||||
(when (featurep 'org)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
;;; lang/plantuml/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(def-package! plantuml-mode
|
||||
:mode "\\.p\\(?:lant\\)?uml$"
|
||||
:defer t
|
||||
:init
|
||||
(setq plantuml-jar-path (concat doom-etc-dir "plantuml.jar")
|
||||
org-plantuml-jar-path plantuml-jar-path)
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
;;; lang/purescript/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(def-package! purescript-mode
|
||||
:mode "\\.purs$"
|
||||
:config
|
||||
(after! purescript-mode
|
||||
(add-hook! 'purescript-mode-hook
|
||||
#'(flycheck-mode purescript-indentation-mode rainbow-delimiters-mode)))
|
||||
#'(flycheck-mode
|
||||
purescript-indentation-mode
|
||||
rainbow-delimiters-mode)))
|
||||
|
||||
|
||||
;; (def-package! flycheck-purescript
|
||||
;; :after purescript-mode
|
||||
;; :config
|
||||
;; (add-hook 'flycheck-mode-hook #'flycheck-purescript-setup))
|
||||
|
||||
|
||||
(def-package! psc-ide
|
||||
:hook (purescript-mode . psc-ide-mode))
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ is loaded.")
|
|||
;;
|
||||
|
||||
(def-package! python
|
||||
:commands python-mode
|
||||
:defer t
|
||||
:init
|
||||
(setq python-environment-directory doom-cache-dir
|
||||
python-indent-guess-indent-offset-verbose nil
|
||||
|
@ -73,7 +73,6 @@ environment variables."
|
|||
|
||||
|
||||
(def-package! anaconda-mode
|
||||
:after python
|
||||
:hook python-mode
|
||||
:init
|
||||
(setq anaconda-mode-installation-directory (concat doom-etc-dir "anaconda/")
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
;;; lang/rest/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(def-package! restclient
|
||||
:commands restclient-mode
|
||||
:mode ("\\.http$" . restclient-mode)
|
||||
:mode ("\\.http\\'" . restclient-mode)
|
||||
:config
|
||||
(set! :popup "^\\*HTTP Response" '((size . 0.4)) '((quit . other)))
|
||||
(map! :mode restclient-mode
|
||||
|
@ -16,4 +15,4 @@
|
|||
(def-package! company-restclient
|
||||
:when (featurep! :completion company)
|
||||
:after restclient
|
||||
:config (set! :company-backend 'restclient-mode '(company-restclient)))
|
||||
:config (set! :company-backend 'restclient-mode 'company-restclient))
|
||||
|
|
|
@ -12,15 +12,12 @@
|
|||
;;
|
||||
|
||||
(def-package! ruby-mode
|
||||
:mode "\\.rb$"
|
||||
:mode "\\.rake$"
|
||||
:mode "\\.gemspec$"
|
||||
:mode "\\.\\(?:pry\\|irb\\)rc$"
|
||||
:mode "/\\(?:Gem\\|Cap\\|Vagrant\\|Rake\\|Pod\\|Puppet\\|Berks\\)file$"
|
||||
:interpreter "ruby"
|
||||
:mode "\\.\\(?:pry\\|irb\\)rc\\'"
|
||||
:config
|
||||
(set! :company-backend 'ruby-mode '(company-dabbrev-code))
|
||||
(set! :company-backend 'ruby-mode 'company-dabbrev-code)
|
||||
(set! :electric 'ruby-mode :words '("else" "end" "elseif"))
|
||||
(set! :env "RBENV_ROOT")
|
||||
(set! :repl 'ruby-mode #'inf-ruby) ; `inf-ruby'
|
||||
(setq ruby-deep-indent-paren t)
|
||||
;; Don't interfere with my custom RET behavior
|
||||
(define-key ruby-mode-map [?\n] nil)
|
||||
|
@ -74,10 +71,8 @@ environment variables."
|
|||
|
||||
|
||||
(def-package! rspec-mode
|
||||
:mode ("/\\.rspec$" . text-mode)
|
||||
:mode ("/\\.rspec\\'" . text-mode)
|
||||
:init
|
||||
(associate! rspec-mode :match "/\\.rspec$")
|
||||
(associate! rspec-mode :modes (ruby-mode yaml-mode) :files ("/spec/"))
|
||||
(defvar rspec-mode-verifiable-map (make-sparse-keymap))
|
||||
(defvar evilmi-ruby-match-tags
|
||||
'((("unless" "if") ("elsif" "else") "end")
|
||||
|
@ -96,18 +91,12 @@ environment variables."
|
|||
:n "v" #'rspec-verify))
|
||||
|
||||
|
||||
(def-package! inf-ruby
|
||||
:commands (inf-ruby inf-ruby-console-auto)
|
||||
:init (set! :repl 'ruby-mode 'inf-ruby))
|
||||
|
||||
|
||||
(def-package! company-inf-ruby
|
||||
:when (featurep! :completion company)
|
||||
:after inf-ruby
|
||||
:config (set! :company-backend 'inf-ruby-mode '(company-inf-ruby)))
|
||||
:config (set! :company-backend 'inf-ruby-mode 'company-inf-ruby))
|
||||
|
||||
|
||||
(def-package! rake
|
||||
:commands (rake rake-find-task rake-rerun)
|
||||
:config (setq rake-completion-system 'default))
|
||||
;; `rake'
|
||||
(setq rake-completion-system 'default)
|
||||
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
;;; lang/rust/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;
|
||||
;; Plugins
|
||||
;;
|
||||
|
||||
(def-package! rust-mode
|
||||
:mode "\\.rs$"
|
||||
:config
|
||||
(after! rust-mode
|
||||
(set! :env "RUST_SRC_PATH")
|
||||
(set! :docset 'rust-mode "Rust")
|
||||
(setq rust-indent-method-chain t)
|
||||
|
@ -14,6 +8,7 @@
|
|||
(map! :map rust-mode-map
|
||||
:localleader
|
||||
:n "b" #'+rust/build-menu)
|
||||
|
||||
(def-menu! +rust/build-menu
|
||||
"TODO"
|
||||
'(("cargo run" :exec "cargo run --color always")
|
||||
|
@ -40,6 +35,5 @@
|
|||
(def-package! flycheck-rust
|
||||
:when (featurep! :feature syntax-checker)
|
||||
:after rust-mode
|
||||
:hook (flycheck-mode . flycheck-rust-setup)
|
||||
:init (add-hook 'rust-mode-hook #'flycheck-mode))
|
||||
:config (add-hook! 'rust-mode-hook #'(flycheck-mode flycheck-rust-setup)))
|
||||
|
||||
|
|
|
@ -1,26 +1,24 @@
|
|||
;;; lang/scala/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(def-package! scala-mode
|
||||
:mode "\\.s\\(?:cala\\|bt\\)$"
|
||||
:config (setq scala-indent:align-parameters t))
|
||||
(after! scala-mode
|
||||
(setq scala-indent:align-parameters t)
|
||||
(add-to-list 'dtrt-indent-hook-mapping-list '(scala-mode c/c++/java scala-indent:step)))
|
||||
|
||||
|
||||
(def-package! sbt-mode :after scala-mode)
|
||||
|
||||
|
||||
(def-package! ensime
|
||||
:commands (ensime ensime-scala-mode-hook)
|
||||
:hook (scala-mode . ensime-mode)
|
||||
:config
|
||||
(set! :company-backend 'scala-mode '(ensime-company company-yasnippet))
|
||||
|
||||
(after! ensime
|
||||
(setq ensime-startup-snapshot-notification nil
|
||||
ensime-startup-notification nil
|
||||
ensime-eldoc-hints 'all
|
||||
;; let DOOM handle company setup
|
||||
ensime-completion-style nil)
|
||||
|
||||
(set! :company-backend 'scala-mode '(ensime-company company-yasnippet))
|
||||
|
||||
;; Fix void-variable imenu-auto-rescan error caused by `ensime--setup-imenu'
|
||||
;; trying to make imenu variables buffer local before imenu is loaded.
|
||||
(require 'imenu))
|
||||
|
||||
|
||||
(def-package! sbt-mode
|
||||
:after scala-mode
|
||||
:config (set! :repl 'scala-mode #'run-scala))
|
||||
|
|
|
@ -12,21 +12,19 @@
|
|||
;;
|
||||
|
||||
(def-package! sh-script ; built-in
|
||||
:mode ("\\.zsh$" . sh-mode)
|
||||
:mode ("\\.zunit$" . sh-mode)
|
||||
:mode ("/bspwmrc$" . sh-mode)
|
||||
:init
|
||||
(add-hook! sh-mode #'(flycheck-mode highlight-numbers-mode))
|
||||
:mode ("\\.zunit\\'" . sh-mode)
|
||||
:mode ("/bspwmrc\\'" . sh-mode)
|
||||
:config
|
||||
(add-hook! sh-mode #'(flycheck-mode highlight-numbers-mode))
|
||||
(set! :electric 'sh-mode :words '("else" "elif" "fi" "done" "then" "do" "esac" ";;"))
|
||||
(set! :repl 'sh-mode #'+sh/repl)
|
||||
|
||||
(setq sh-indent-after-continuation 'always)
|
||||
|
||||
;; recognize function names with dashes in them
|
||||
(push '((sh . ((nil "^\\s-*function\\s-+\\([[:alpha:]_-][[:alnum:]_-]*\\)\\s-*\\(?:()\\)?" 1)
|
||||
(nil "^\\s-*\\([[:alpha:]_-][[:alnum:]_-]*\\)\\s-*()" 1))))
|
||||
sh-imenu-generic-expression)
|
||||
(map-put sh-imenu-generic-expression
|
||||
'sh '((nil "^\\s-*function\\s-+\\([[:alpha:]_-][[:alnum:]_-]*\\)\\s-*\\(?:()\\)?" 1)
|
||||
(nil "^\\s-*\\([[:alpha:]_-][[:alnum:]_-]*\\)\\s-*()" 1)))
|
||||
|
||||
;; `sh-set-shell' is chatty about setting up indentation rules
|
||||
(advice-add #'sh-set-shell :around #'doom*shut-up)
|
||||
|
@ -52,7 +50,7 @@
|
|||
(string-match-p "\\.zsh\\'" buffer-file-name))
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(looking-at-p "^#!.+zsh[$\\s-]")))
|
||||
(looking-at-p "^#!.+/zsh[$ ]")))
|
||||
(sh-set-shell "zsh")))
|
||||
(add-hook 'sh-mode-hook #'+sh|detect-zsh))
|
||||
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
;;; lang/swift/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; TODO Set up emacs task runners for fruitstrap
|
||||
;; `swift-mode'
|
||||
(set! :repl 'swift-mode #'run-swift)
|
||||
|
||||
(def-package! swift-mode
|
||||
:mode "\\.swift$"
|
||||
:config
|
||||
(add-hook 'swift-mode-hook #'flycheck-mode)
|
||||
(set! :repl 'swift-mode #'swift-mode-run-repl) ; TODO test this
|
||||
(push 'swift flycheck-checkers))
|
||||
|
||||
(def-package! flycheck-swift
|
||||
:when (featurep! :feature syntax-checker)
|
||||
:after swift-mode
|
||||
:init (add-hook 'swift-mode-hook #'flycheck-mode)
|
||||
:config (flycheck-swift-setup))
|
||||
|
||||
|
||||
(def-package! company-sourcekit
|
||||
|
|
|
@ -5,3 +5,6 @@
|
|||
|
||||
(when (featurep! :completion company)
|
||||
(package! company-sourcekit))
|
||||
|
||||
(when (featurep! :feature syntax-checker)
|
||||
(package! flycheck-swift))
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
;;; lang/web/+css.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; css-mode hooks apply to scss and less-css modes
|
||||
(add-hook 'css-mode-hook #'rainbow-delimiters-mode)
|
||||
(add-hook! (css-mode sass-mode stylus-mode)
|
||||
#'(yas-minor-mode-on flycheck-mode highlight-numbers-mode))
|
||||
|
||||
;; An improved newline+continue comment function
|
||||
(setq-hook! css-mode comment-indent-function #'+css/comment-indent-new-line)
|
||||
|
||||
|
@ -13,29 +8,36 @@
|
|||
(sp-local-pair "/*" "*/" :post-handlers '(("||\n[i]" "RET") ("| " "SPC")))))
|
||||
|
||||
(map! :map* (css-mode-map scss-mode-map less-css-mode-map)
|
||||
:n "M-R" #'+css/web-refresh-browser
|
||||
(:localleader
|
||||
:n "rb" #'+css/toggle-inline-or-block))
|
||||
:localleader
|
||||
:n "rb" #'+css/toggle-inline-or-block)
|
||||
|
||||
|
||||
;;
|
||||
;; Packages
|
||||
;;
|
||||
|
||||
;; css-mode hooks apply to scss and less-css modes
|
||||
(add-hook 'css-mode-hook #'rainbow-delimiters-mode)
|
||||
(add-hook! (css-mode sass-mode stylus-mode)
|
||||
#'(yas-minor-mode-on
|
||||
flycheck-mode
|
||||
highlight-numbers-mode
|
||||
rainbow-mode))
|
||||
|
||||
|
||||
(def-package! counsel-css
|
||||
:when (featurep! :completion ivy)
|
||||
:commands (counsel-css counsel-css-imenu-setup)
|
||||
:commands counsel-css
|
||||
:hook (css-mode . counsel-css-imenu-setup)
|
||||
:init
|
||||
(map! :map* (css-mode-map scss-mode-map less-css-mode-map)
|
||||
:localleader :n ";" #'counsel-css))
|
||||
|
||||
|
||||
(def-package! rainbow-mode
|
||||
:hook (css-mode sass-mode))
|
||||
|
||||
|
||||
(after! css-mode ; contains both css-mode & scss-mode
|
||||
(def-package! css-mode ; built-in
|
||||
:defer t
|
||||
:config
|
||||
;; contains both css-mode & scss-mode
|
||||
(set! :docset 'css-mode "CSS")
|
||||
(set! :docset 'scss-mode "Sass")
|
||||
(unless EMACS26+
|
||||
|
@ -45,7 +47,7 @@
|
|||
|
||||
|
||||
(def-package! sass-mode
|
||||
:commands sass-mode
|
||||
:defer t
|
||||
:config
|
||||
(set! :docset 'sass-mode "Sass")
|
||||
(set! :company-backend 'sass-mode 'company-css)
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
:mode "wp-content/themes/.+/.+\\.php$"
|
||||
:mode "templates/.+\\.php$"
|
||||
:config
|
||||
(set! :company-backend 'web-mode '(company-web-html company-yasnippet))
|
||||
(setq web-mode-enable-html-entities-fontification t
|
||||
web-mode-enable-auto-quoting nil)
|
||||
|
||||
|
@ -91,10 +90,7 @@
|
|||
:nv "[T" #'web-mode-element-parent))
|
||||
|
||||
|
||||
(def-package! company-web
|
||||
:when (featurep! :completion company)
|
||||
:after web-mode)
|
||||
|
||||
|
||||
;; `pug-mode'
|
||||
(set! :company-backend 'pug-mode '(company-yasnippet))
|
||||
;;
|
||||
(set! :company-backend 'pug-mode 'company-web-jade)
|
||||
(set! :company-backend 'web-mode 'company-web-html)
|
||||
(set! :company-backend 'slim-mode 'company-web-slim)
|
||||
|
|
8
modules/lang/web/doctor.el
Normal file
8
modules/lang/web/doctor.el
Normal file
|
@ -0,0 +1,8 @@
|
|||
;;; lang/web/doctor.el -*- lexical-binding: t; -*-
|
||||
|
||||
(unless (executable-find "js-beautify")
|
||||
(warn! "Couldn't find js-beautify. Code formatting in JS/CSS/HTML modes will not work."))
|
||||
|
||||
(unless (executable-find "stylelint")
|
||||
(warn! "Couldn't find stylelint. Linting for CSS modes will not work."))
|
||||
|
|
@ -13,9 +13,9 @@
|
|||
(package! haml-mode)
|
||||
(package! pug-mode)
|
||||
(package! slim-mode)
|
||||
(package! web-mode)
|
||||
(when (featurep! :completion company)
|
||||
(package! company-web))
|
||||
(when (package! web-mode)
|
||||
(when (featurep! :completion company)
|
||||
(package! company-web)))
|
||||
|
||||
;; +css.el
|
||||
(package! less-css-mode)
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
;; Handles whitespace (tabs/spaces) settings externally. This way projects can
|
||||
;; specify their own formatting rules.
|
||||
(def-package! editorconfig
|
||||
:hook (doom-init . editorconfig-mode)
|
||||
:defer 2
|
||||
:after-call doom-before-switch-buffer
|
||||
:config
|
||||
;; Register missing indent variables
|
||||
(setq editorconfig-indentation-alist
|
||||
|
@ -49,9 +50,7 @@ extension, try to guess one."
|
|||
;; editorconfig to ignore indentation there. I prefer dynamic indentation
|
||||
;; support built into Emacs.
|
||||
(dolist (mode '(emacs-lisp-mode lisp-mode))
|
||||
(map-delete editorconfig-indentation-alist mode)))
|
||||
|
||||
|
||||
(def-package! editorconfig-conf-mode
|
||||
:mode "\\.?editorconfig$")
|
||||
(map-delete editorconfig-indentation-alist mode))
|
||||
|
||||
;;
|
||||
(editorconfig-mode +1))
|
||||
|
|
|
@ -1,9 +1,29 @@
|
|||
;;; tools/ein/autoload.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###autoload
|
||||
(def-setting! :ein-notebook-dir (dir)
|
||||
"Set the default directory from where to open Jupyter notebooks."
|
||||
`(setq ein:jupyter-default-notebook-directory ,dir))
|
||||
|
||||
|
||||
;;
|
||||
;; Library
|
||||
;;
|
||||
|
||||
(defun +ein--collect-ein-buffer-links ()
|
||||
(let ((end (window-end))
|
||||
points)
|
||||
(save-excursion
|
||||
(goto-char (window-start))
|
||||
(while (re-search-forward "~?/.+\\|\s\\[" end t)
|
||||
(push (+ (match-beginning 0) 1) points))
|
||||
(nreverse points))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +ein/ace-link-ein ()
|
||||
"Ace jump to links in ein notebooklist."
|
||||
(interactive)
|
||||
(require 'avy)
|
||||
(let ((res (avy-with +ein/ace-link-ein
|
||||
(avy--process
|
||||
(+ein--collect-ein-buffer-links)
|
||||
|
@ -13,14 +33,4 @@
|
|||
(goto-char (1+ res))
|
||||
(widget-button-press (point)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +ein--collect-ein-buffer-links ()
|
||||
(interactive)
|
||||
(let ((end (window-end))
|
||||
points)
|
||||
(save-excursion
|
||||
(goto-char (window-start))
|
||||
(while (re-search-forward "~?/.+\\|\s\\[" end t)
|
||||
(push (+ (match-beginning 0) 1) points))
|
||||
(nreverse points))))
|
||||
|
||||
|
|
|
@ -3,49 +3,51 @@
|
|||
(defvar +ein-notebook-dir "~/"
|
||||
"Default directory from where Jupyter notebooks are to be opened.")
|
||||
|
||||
(def-setting! :ein-notebook-dir (dir)
|
||||
"Set the default directory from where to open Jupyter notebooks."
|
||||
`(setq +ein-notebook-dir ,dir))
|
||||
|
||||
;;
|
||||
;; Plugins
|
||||
;;
|
||||
|
||||
(def-package! ein
|
||||
:commands (ein:notebooklist-open ein:notebooklist-login ein:jupyter-server-start)
|
||||
:defer t
|
||||
:init
|
||||
(push (lambda (buf) (string-match-p "^\\*ein: .*" (buffer-name buf)))
|
||||
doom-real-buffer-functions)
|
||||
(set! :popup "\\*ein: .*" :ignore)
|
||||
(set! :popup "\\*ein:tb .*" '((side . bottom) (size . 0.3)) '((quit . t) (transient) (select)))
|
||||
(set! :popup "\\*ein:notebooklist *" '((side . left) (size . 50)) '((select)))
|
||||
;; Ace-link on notebook list buffers
|
||||
(add-hook! 'ein:notebooklist-mode-hook
|
||||
(map! :map ein:notebooklist-mode-map
|
||||
"o" #'+ein/ace-link-ein))
|
||||
;; Ein uses request to store http cookies. Store them in the cache dir.
|
||||
(setq request-storage-directory (concat doom-cache-dir "/request"))
|
||||
(set! :popup "\\*ein:tb .*"
|
||||
'((side . bottom) (size . 0.3))
|
||||
'((quit . t) (transient) (select)))
|
||||
(set! :popup "\\*ein:notebooklist *"
|
||||
'((side . left) (size . 50))
|
||||
'((select)))
|
||||
|
||||
;; Auto complete with company
|
||||
(when (featurep! :completion company)
|
||||
(setq ein:completion-backend 'ein:use-company-backend)
|
||||
(set! :company-backend
|
||||
'(ein:notebook-multilang-mode
|
||||
ein:notebook-python-mode
|
||||
ein:notebook-plain-mode)
|
||||
(set! :company-backend '(ein:notebook-multilang-mode
|
||||
ein:notebook-python-mode
|
||||
ein:notebook-plain-mode)
|
||||
'ein:company-backend))
|
||||
|
||||
:config
|
||||
;; Manually load the autoloads of EIN. This takes time...
|
||||
(load "ein-loaddefs.el" nil t t)
|
||||
(setq
|
||||
;; Slice images into rows so that we can navigate buffers with images more easily
|
||||
ein:slice-image t
|
||||
ein:jupyter-default-notebook-directory +ein-notebook-dir
|
||||
ein:jupyter-default-server-command "jupyter"
|
||||
ein:jupyter-server-args '("--no-browser")
|
||||
ein:notebook-modes
|
||||
'(ein:notebook-multilang-mode ein:notebook-python-mode ein:notebook-plain-mode))
|
||||
;; Avy is required for showing links in the notebook list with ace-link.
|
||||
(require 'avy)
|
||||
(setq ein:jupyter-server-args '("--no-browser")
|
||||
ein:notebook-modes
|
||||
'(ein:notebook-multilang-mode ein:notebook-python-mode ein:notebook-plain-mode)
|
||||
;; Slice images into rows; easier to navigate around images
|
||||
ein:slice-image t)
|
||||
|
||||
(unless ein:jupyter-default-notebook-directory
|
||||
(setq ein:jupyter-default-notebook-directory "~/"))
|
||||
|
||||
(defun +ein-buffer-p (buf)
|
||||
(string-match-p "^\\*ein: .*" (buffer-name buf)))
|
||||
(add-to-list 'doom-real-buffer-functions #'+ein-buffer-p nil #'eq)
|
||||
|
||||
;; Ace-link on notebook list buffers
|
||||
(map! :after ein-notebooklist
|
||||
:map ein:notebooklist-mode-map
|
||||
"o" #'+ein/ace-link-ein)
|
||||
|
||||
;; add hydra
|
||||
(def-hydra! +ein/hydra (:hint t :color red)
|
||||
(defhydra +ein/hydra (:hint t :color red)
|
||||
"
|
||||
Operations on Cells^^^^^^ Other
|
||||
----------------------------^^^^^^ ----------------------------------^^^^
|
||||
|
|
|
@ -8,16 +8,6 @@
|
|||
(defvar-local doom-electric-indent-words '()
|
||||
"TODO")
|
||||
|
||||
(setq-default electric-indent-chars '(?\n ?\^?))
|
||||
|
||||
(defun +electric-indent|char (_c)
|
||||
(when (and (eolp) doom-electric-indent-words)
|
||||
(save-excursion
|
||||
(backward-word)
|
||||
(looking-at-p
|
||||
(concat "\\<" (regexp-opt doom-electric-indent-words))))))
|
||||
(push #'+electric-indent|char electric-indent-functions)
|
||||
|
||||
(def-setting! :electric (modes &rest plist)
|
||||
"Declare :words (list of strings) or :chars (lists of chars) in MODES that
|
||||
trigger electric indentation."
|
||||
|
@ -34,3 +24,15 @@ trigger electric indentation."
|
|||
,@(if words `((setq doom-electric-indent-words ',words))))
|
||||
(add-hook! ,modes #',fn-name))))))
|
||||
|
||||
;;
|
||||
(after! electric
|
||||
(setq-default electric-indent-chars '(?\n ?\^?))
|
||||
|
||||
(defun +electric-indent|char (_c)
|
||||
(when (and (eolp) doom-electric-indent-words)
|
||||
(save-excursion
|
||||
(backward-word)
|
||||
(looking-at-p
|
||||
(concat "\\<" (regexp-opt doom-electric-indent-words))))))
|
||||
(add-to-list 'electric-indent-functions #'+electric-indent|char))
|
||||
|
||||
|
|
|
@ -175,14 +175,14 @@ delete."
|
|||
"Create a new eshell window below the current one."
|
||||
(interactive)
|
||||
(select-window (split-window-vertically))
|
||||
(+eshell/open))
|
||||
(bury-buffer))
|
||||
|
||||
;;;###autoload
|
||||
(defun +eshell/split-right ()
|
||||
"Create a new eshell window to the right of the current one."
|
||||
(interactive)
|
||||
(select-window (split-window-horizontally))
|
||||
(+eshell/open))
|
||||
(bury-buffer))
|
||||
|
||||
;; `make-ring'
|
||||
;; `ring-ref'
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
;;; tools/eshell/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; This is highly experimental. I don't use eshell often, so this may need work.
|
||||
|
||||
;; see:
|
||||
;; + `+eshell/open': open in current buffer
|
||||
;; + `+eshell/open-popup': open in a popup
|
||||
|
@ -9,10 +7,10 @@
|
|||
;; workspaces)
|
||||
|
||||
(def-package! eshell ; built-in
|
||||
:commands eshell-mode
|
||||
:defer t
|
||||
:init
|
||||
(setq eshell-directory-name
|
||||
(let ((dir (concat doom-private-dir "eshell")))
|
||||
(let ((dir (expand-file-name "eshell" doom-private-dir)))
|
||||
(if (file-directory-p dir)
|
||||
dir
|
||||
"~/.eshell"))
|
||||
|
|
|
@ -4,9 +4,7 @@
|
|||
;; errors. If that happens, try `+gist/kill-cache'. You may have to restart
|
||||
;; Emacs.
|
||||
|
||||
(def-package! gist
|
||||
:commands (gist-list gist-region-or-buffer-private gist-region-or-buffer)
|
||||
:config
|
||||
(after! gist
|
||||
(set! :evil-state 'gist-list-mode 'normal)
|
||||
|
||||
(defun +gist*list-render (orig-fn &rest args)
|
||||
|
|
|
@ -1,13 +1,10 @@
|
|||
;;; tools/imenu/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(def-package! imenu-anywhere
|
||||
:commands (ido-imenu-anywhere ivy-imenu-anywhere helm-imenu-anywhere)
|
||||
:config (setq imenu-anywhere-delimiter ": "))
|
||||
;; `imenu-anywhere'
|
||||
(setq imenu-anywhere-delimiter ": ")
|
||||
|
||||
|
||||
(def-package! imenu-list
|
||||
:commands (imenu-list-minor-mode imenu-list-smart-toggle)
|
||||
:config
|
||||
(after! imenu-list
|
||||
(setq imenu-list-idle-update-delay 0.5)
|
||||
|
||||
(set! :popup "^\\*Ilist"
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
(def-package! magit
|
||||
:defer t
|
||||
:init
|
||||
(load "magit-autoloads" nil t)
|
||||
:config
|
||||
(setq magit-completing-read-function
|
||||
(if (featurep! :completion ivy)
|
||||
|
@ -18,13 +16,11 @@
|
|||
(map! :map magit-status-mode-map [remap magit-mode-bury-buffer] #'+magit/quit))
|
||||
|
||||
|
||||
(def-package! magit-blame
|
||||
:commands magit-blame
|
||||
:after git-timemachine)
|
||||
(def-package! magit-blame :after git-timemachine)
|
||||
|
||||
|
||||
(def-package! magithub
|
||||
:commands (magithub-clone magithub-feature-autoinject)
|
||||
:commands magithub-feature-autoinject
|
||||
:after magit
|
||||
:preface
|
||||
(setq magithub-dir (concat doom-etc-dir "magithub/"))
|
||||
|
@ -32,10 +28,13 @@
|
|||
(setq magithub-clone-default-directory "~/"
|
||||
magithub-preferred-remote-method 'clone_url)
|
||||
:config
|
||||
(load "magithub-autoloads" nil t)
|
||||
(magithub-feature-autoinject t))
|
||||
|
||||
|
||||
(def-package! magit-gitflow
|
||||
:hook (magit-mode . turn-on-magit-gitflow))
|
||||
|
||||
|
||||
(def-package! evil-magit
|
||||
:when (featurep! :feature evil)
|
||||
:after magit
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; tools/magit/packages.el
|
||||
|
||||
(package! magit)
|
||||
(package! magithub)
|
||||
(when (featurep! :feature evil)
|
||||
(package! evil-magit))
|
||||
(when (package! magit)
|
||||
(package! magithub)
|
||||
(package! magit-gitflow)
|
||||
(when (featurep! :feature evil)
|
||||
(package! evil-magit)))
|
||||
|
|
|
@ -11,17 +11,18 @@
|
|||
;; Plugins
|
||||
;;
|
||||
|
||||
(def-package! password-store
|
||||
;; `password-store'
|
||||
(setq password-store-password-length 12)
|
||||
|
||||
|
||||
;; `pass'
|
||||
(def-package! pass
|
||||
:defer t
|
||||
:config
|
||||
(setq password-store-password-length 12))
|
||||
|
||||
|
||||
(def-package! pass
|
||||
:commands pass
|
||||
:config
|
||||
(set! :evil-state 'pass-mode 'emacs)
|
||||
(set! :popup "^\\*Password-Store" '((side . left) (size . 0.25)) '((quit)))
|
||||
(set! :popup "^\\*Password-Store"
|
||||
'((side . left) (size . 0.25))
|
||||
'((quit)))
|
||||
(map! :map pass-mode-map
|
||||
"j" #'pass-next-entry
|
||||
"k" #'pass-prev-entry
|
||||
|
@ -30,12 +31,6 @@
|
|||
"C-k" #'pass-next-directory))
|
||||
|
||||
|
||||
(def-package! helm-pass
|
||||
:when (featurep! :completion helm)
|
||||
:commands helm-pass)
|
||||
|
||||
|
||||
;; Is built into Emacs 26+
|
||||
(def-package! auth-source-pass
|
||||
:when (featurep! +auth)
|
||||
:config (auth-source-pass-enable))
|
||||
(when (and EMACS26+ (featurep! +auth))
|
||||
(auth-source-pass-enable))
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
(package! pass)
|
||||
(package! password-store)
|
||||
|
||||
(when (featurep! +auth)
|
||||
(when (and EMACS26+ (featurep! +auth))
|
||||
(package! auth-source-pass))
|
||||
|
||||
(when (featurep! :completion helm)
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
;;; tools/pdf/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(def-package! pdf-tools
|
||||
:mode ("\\.pdf$" . pdf-view-mode)
|
||||
:init (load "pdf-tools-autoloads" nil t)
|
||||
:mode ("\\.pdf\\'" . pdf-view-mode)
|
||||
:config
|
||||
(unless noninteractive
|
||||
(pdf-tools-install))
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
;;; tools/prodigy/autoload.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###autoload
|
||||
(def-setting! :service (&rest plist)
|
||||
"TODO"
|
||||
`(after! prodigy
|
||||
(prodigy-define-service ,@plist)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +prodigy/create ()
|
||||
"Interactively create a new prodigy service."
|
||||
|
@ -32,3 +38,17 @@
|
|||
(file-directory-p (plist-get service :project)))
|
||||
collect service into services
|
||||
finally do (setq prodigy-service services)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +prodigy*services (orig-fn &rest args)
|
||||
"Adds a new :project property to prodigy services, which hides the service
|
||||
unless invoked from the relevant project."
|
||||
(let ((project-root (downcase (doom-project-root)))
|
||||
(services (apply orig-fn args)))
|
||||
(if current-prefix-arg
|
||||
services
|
||||
(cl-remove-if-not (lambda (service)
|
||||
(let ((project (plist-get service :project)))
|
||||
(or (not project)
|
||||
(file-in-directory-p project-root project))))
|
||||
services))))
|
||||
|
|
|
@ -1,38 +1,13 @@
|
|||
;;; tools/prodigy/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(def-setting! :service (&rest plist)
|
||||
"TODO"
|
||||
`(after! prodigy
|
||||
(prodigy-define-service ,@plist)))
|
||||
|
||||
|
||||
;;
|
||||
;; Plugins
|
||||
;;
|
||||
|
||||
(def-package! prodigy
|
||||
:commands (prodigy prodigy-view-mode prodigy-add-filter)
|
||||
:config
|
||||
(after! prodigy
|
||||
(set! :evil-state 'prodigy-mode 'emacs)
|
||||
|
||||
;; Make services, etc persistent between Emacs sessions
|
||||
(doom-cache-persist
|
||||
:prodigy '(prodigy-services prodigy-tags prodigy-filters))
|
||||
|
||||
(defun +prodigy*services (orig-fn &rest args)
|
||||
"Adds a new :project property to prodigy services, which hides the service
|
||||
unless invoked from the relevant project."
|
||||
(let ((project-root (downcase (doom-project-root)))
|
||||
(services (apply orig-fn args)))
|
||||
(if current-prefix-arg
|
||||
services
|
||||
(cl-remove-if-not (lambda (service)
|
||||
(let ((project (plist-get service :project)))
|
||||
(or (not project)
|
||||
(file-in-directory-p project-root project))))
|
||||
services))))
|
||||
(advice-add #'prodigy-services :around #'+prodigy*services)
|
||||
|
||||
;; Keybindings
|
||||
(map! :map prodigy-mode-map "d" #'+prodigy/delete))
|
||||
|
||||
|
|
|
@ -4,13 +4,10 @@
|
|||
;; Plugins
|
||||
;;
|
||||
|
||||
(def-package! rainbow-mode)
|
||||
|
||||
|
||||
(def-package! kurecolor
|
||||
:after rainbow-mode
|
||||
:config
|
||||
(def-hydra! +rgb@kurecolor (:color pink :hint nil)
|
||||
(defhydra +rgb@kurecolor (:color pink :hint nil)
|
||||
"
|
||||
Inc/Dec _w_/_W_ brightness _d_/_D_ saturation _e_/_E_ hue "
|
||||
("w" kurecolor-decrease-brightness-by-step)
|
||||
|
|
17
modules/tools/rotate-text/autoload.el
Normal file
17
modules/tools/rotate-text/autoload.el
Normal file
|
@ -0,0 +1,17 @@
|
|||
;;; tools/rotate-text/autoload.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###autoload
|
||||
(def-setting! :rotate (modes &rest plist)
|
||||
"Declare :symbols, :words or :patterns (all lists of strings) that
|
||||
`rotate-text' will cycle through."
|
||||
(declare (indent 1))
|
||||
(let* ((modes (doom-enlist (doom-unquote modes)))
|
||||
(fn-name (intern (format "doom--rotate-%s" (mapconcat #'symbol-name modes "-")))))
|
||||
`(progn
|
||||
(defun ,fn-name ()
|
||||
(require 'rotate-text)
|
||||
(let ((plist (list ,@plist)))
|
||||
(setq rotate-text-local-symbols (plist-get plist :symbols)
|
||||
rotate-text-local-words (plist-get plist :words)
|
||||
rotate-text-local-patterns (plist-get plist :patterns))))
|
||||
(add-hook! ,modes #',fn-name))))
|
|
@ -1,22 +1,4 @@
|
|||
;;; tools/rotate-text/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(def-package! rotate-text
|
||||
:commands (rotate-text rotate-text-backward)
|
||||
:config
|
||||
(push '("true" "false") rotate-text-words))
|
||||
|
||||
|
||||
(def-setting! :rotate (modes &rest plist)
|
||||
"Declare :symbols, :words or :patterns (all lists of strings) that
|
||||
`rotate-text' will cycle through."
|
||||
(declare (indent 1))
|
||||
(let* ((modes (doom-enlist (doom-unquote modes)))
|
||||
(fn-name (intern (format "doom--rotate-%s" (mapconcat #'symbol-name modes "-")))))
|
||||
`(progn
|
||||
(defun ,fn-name ()
|
||||
(let ((plist (list ,@plist)))
|
||||
(setq rotate-text-local-symbols (plist-get plist :symbols)
|
||||
rotate-text-local-words (plist-get plist :words)
|
||||
rotate-text-local-patterns (plist-get plist :patterns))))
|
||||
(add-hook! ,modes #',fn-name))))
|
||||
|
||||
(after! rotate-text
|
||||
(add-to-list 'rotate-text-words '("true" "false")))
|
||||
|
|
|
@ -1,8 +1,14 @@
|
|||
;;; tools/term/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(def-package! multi-term
|
||||
:commands (multi-term multi-term-next multi-term-prev)
|
||||
:config
|
||||
(setq multi-term-program (getenv "SHELL")
|
||||
multi-term-dedicated-window-height 20
|
||||
multi-term-switch-after-close 'PREVIOUS))
|
||||
;; `multi-term'
|
||||
(setq multi-term-dedicated-window-height 20
|
||||
multi-term-switch-after-close 'PREVIOUS)
|
||||
|
||||
;; `term' (built-in)
|
||||
(after! term
|
||||
(set! :env "SHELL")
|
||||
|
||||
;; Consider term buffers real
|
||||
(defun +term-p (buf)
|
||||
(eq (buffer-local-value 'major-mode buf) 'term-mode))
|
||||
(add-to-list 'doom-real-buffer-functions #'+term-p #'eq))
|
||||
|
|
|
@ -63,7 +63,7 @@ but do not execute them."
|
|||
(interactive "P")
|
||||
(unless +tmux-last-command
|
||||
(user-error "No last command to run"))
|
||||
(apply #'+tmux (car +tmux-last-command) (cdr +tmux-last-command)))
|
||||
(apply #'+tmux +tmux-last-command))
|
||||
|
||||
;;;###autoload
|
||||
(defun +tmux/cd (&optional arg directory)
|
||||
|
|
|
@ -114,16 +114,17 @@ Possible values:
|
|||
|
||||
(defun +doom-dashboard|init ()
|
||||
"Initializes Doom's dashboard."
|
||||
(add-hook 'window-configuration-change-hook #'+doom-dashboard|resize)
|
||||
(add-hook 'window-size-change-functions #'+doom-dashboard|resize)
|
||||
(add-hook 'kill-buffer-query-functions #'+doom-dashboard|reload-on-kill)
|
||||
(add-hook 'doom-after-switch-buffer-hook #'+doom-dashboard|reload-on-kill)
|
||||
(unless (daemonp)
|
||||
(add-hook 'after-make-frame-functions #'+doom-dashboard|make-frame))
|
||||
;; `persp-mode' integration: update `default-directory' when switching
|
||||
(add-hook 'persp-created-functions #'+doom-dashboard|record-project)
|
||||
(add-hook 'persp-activated-functions #'+doom-dashboard|detect-project)
|
||||
(add-hook 'persp-before-switch-functions #'+doom-dashboard|record-project)
|
||||
(unless noninteractive
|
||||
(add-hook 'window-configuration-change-hook #'+doom-dashboard|resize)
|
||||
(add-hook 'window-size-change-functions #'+doom-dashboard|resize)
|
||||
(add-hook 'kill-buffer-query-functions #'+doom-dashboard|reload-on-kill)
|
||||
(add-hook 'doom-after-switch-buffer-hook #'+doom-dashboard|reload-on-kill)
|
||||
(unless (daemonp)
|
||||
(add-hook 'after-make-frame-functions #'+doom-dashboard|make-frame))
|
||||
;; `persp-mode' integration: update `default-directory' when switching
|
||||
(add-hook 'persp-created-functions #'+doom-dashboard|record-project)
|
||||
(add-hook 'persp-activated-functions #'+doom-dashboard|detect-project)
|
||||
(add-hook 'persp-before-switch-functions #'+doom-dashboard|record-project))
|
||||
(+doom-dashboard-reload t))
|
||||
|
||||
(defun +doom-dashboard|reload-on-kill ()
|
||||
|
@ -329,11 +330,11 @@ controlled by `+doom-dashboard-pwd-policy'."
|
|||
"\n\n"))))
|
||||
`(("Homepage" "mark-github"
|
||||
(browse-url "https://github.com/hlissner/doom-emacs"))
|
||||
,(when (and (featurep! :feature workspaces)
|
||||
,(when (and (bound-and-true-p persp-mode)
|
||||
(file-exists-p (expand-file-name persp-auto-save-fname persp-save-dir)))
|
||||
'("Reload last session" "history"
|
||||
(+workspace/load-session)))
|
||||
,(when (featurep! :lang org)
|
||||
,(when (fboundp 'org-agenda-list)
|
||||
'("See agenda for this week" "calendar"
|
||||
(call-interactively #'org-agenda-list)))
|
||||
("Recently opened files" "file-text"
|
||||
|
|
|
@ -4,11 +4,7 @@
|
|||
;; mode-line.
|
||||
|
||||
(def-package! anzu
|
||||
:commands (anzu-mode global-anzu-mode
|
||||
anzu-query-replace anzu-query-replace-regexp
|
||||
anzu-query-replace-at-cursor anzu-replace-at-cursor-thing)
|
||||
:init
|
||||
(add-transient-hook! #'isearch-mode (require 'anzu))
|
||||
:after-call isearch-mode
|
||||
:config
|
||||
(setq anzu-cons-mode-line-p nil
|
||||
anzu-minimum-input-length 1
|
||||
|
@ -35,10 +31,7 @@
|
|||
|
||||
|
||||
(def-package! evil-anzu
|
||||
:defer t
|
||||
:init
|
||||
(add-transient-hook! #'evil-ex-start-search (require 'evil-anzu))
|
||||
(add-transient-hook! #'evil-ex-start-word-search (require 'evil-anzu)))
|
||||
:after-call (evil-ex-start-search evil-ex-start-word-search))
|
||||
|
||||
|
||||
;; fish-style modeline
|
||||
|
|
|
@ -22,10 +22,11 @@
|
|||
|
||||
;; <https://github.com/hlissner/emacs-doom-theme>
|
||||
(def-package! doom-themes
|
||||
:config
|
||||
:defer t
|
||||
:init
|
||||
(unless doom-theme
|
||||
(setq doom-theme 'doom-one))
|
||||
|
||||
:config
|
||||
;; Reload common faces when reloading doom-themes live
|
||||
(defun +doom*reload-common (&rest _) (load "doom-themes-common.el" nil t))
|
||||
(advice-add #'doom//reload-theme :before #'+doom*reload-common)
|
||||
|
@ -41,7 +42,7 @@
|
|||
|
||||
|
||||
(def-package! solaire-mode
|
||||
:commands (solaire-mode turn-on-solaire-mode solaire-mode-swap-bg)
|
||||
:defer t
|
||||
:init
|
||||
(defun +doom|solaire-mode-swap-bg-maybe ()
|
||||
(when-let* ((rule (assq doom-theme +doom-solaire-themes)))
|
||||
|
@ -49,8 +50,7 @@
|
|||
(if (cdr rule) (solaire-mode-swap-bg))))
|
||||
(add-hook 'doom-load-theme-hook #'+doom|solaire-mode-swap-bg-maybe t)
|
||||
:config
|
||||
(add-hook 'after-change-major-mode-hook #'turn-on-solaire-mode)
|
||||
(setq solaire-mode-real-buffer-fn #'doom-real-buffer-p)
|
||||
(add-hook 'change-major-mode-after-body-hook #'turn-on-solaire-mode)
|
||||
;; fringe can become unstyled when deleting or focusing frames
|
||||
(add-hook 'focus-in-hook #'solaire-mode-reset)
|
||||
;; Prevent color glitches when reloading either DOOM or loading a new theme
|
||||
|
|
|
@ -2,11 +2,13 @@
|
|||
|
||||
(def-package! evil-goggles
|
||||
:when (featurep! :feature evil)
|
||||
:defer pre-command-hook
|
||||
:after-call pre-command-hook
|
||||
:init
|
||||
(setq evil-goggles-duration 0.05
|
||||
evil-goggles-pulse nil ; too slow
|
||||
evil-goggles-enable-delete t
|
||||
;; evil-goggles provides a good indicator of what has been affected.
|
||||
;; delete/change is obvious, so I'd rather disable it for these.
|
||||
evil-goggles-enable-delete nil
|
||||
evil-goggles-enable-change nil)
|
||||
:config
|
||||
(evil-goggles-mode +1))
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
;;; ui/nav-flash/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(def-package! nav-flash
|
||||
:commands nav-flash-show
|
||||
:defer t
|
||||
:init
|
||||
;; NOTE In :feature lookup `recenter' is hooked to a bunch of jumping
|
||||
;; commands, which will trigger nav-flash.
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue