Merge branch 'develop' into fix/add-add-featurep-condition-to-global-bindings
This commit is contained in:
commit
a5d9079c43
184 changed files with 2868 additions and 1922 deletions
|
@ -42,7 +42,7 @@ Aesthetic modules that affect the Emacs interface or user experience.
|
|||
+ [[file:ui/unicode/README.org][unicode]]:
|
||||
+ vc-gutter:
|
||||
+ vi-tilde-fringe:
|
||||
+ [[file:ui/window-select/README.org][window-select]]:
|
||||
+ [[file:ui/window-select/README.org][window-select]] =+switch-window +numbers=:
|
||||
+ [[file:ui/workspaces/README.org][workspaces]]: Isolated workspaces
|
||||
|
||||
* :editor
|
||||
|
@ -64,7 +64,6 @@ Modules that reconfigure or augment packages or features built into Emacs.
|
|||
|
||||
+ dired =+ranger +icons=:
|
||||
+ electric:
|
||||
+ imenu:
|
||||
+ vc:
|
||||
|
||||
* :term
|
||||
|
|
|
@ -34,7 +34,7 @@ https://assets.doomemacs.org/completion/company/overlay.png
|
|||
+ [[https://github.com/company-mode/company-mode][company-mode]]
|
||||
+ [[https://github.com/hlissner/emacs-company-dict][company-dict]]
|
||||
+ [[https://github.com/raxod502/prescient.el][company-prescient]]
|
||||
+ [[https://github.com/sebastiencs/company-box][company-box]]
|
||||
+ [[https://github.com/sebastiencs/company-box][company-box]]* (=+childframe=)
|
||||
|
||||
* Prerequisites
|
||||
This module has no direct prerequisites.
|
||||
|
|
|
@ -41,6 +41,7 @@ be negative.")
|
|||
[remap bookmark-jump] #'helm-bookmarks
|
||||
[remap execute-extended-command] #'helm-M-x
|
||||
[remap find-file] #'helm-find-files
|
||||
[remap locate] #'helm-locate
|
||||
[remap imenu] #'helm-semantic-or-imenu
|
||||
[remap noop-show-kill-ring] #'helm-show-kill-ring
|
||||
[remap persp-switch-to-buffer] #'+helm/workspace-mini
|
||||
|
@ -158,7 +159,23 @@ be negative.")
|
|||
|
||||
;;;###package helm-locate
|
||||
(defvar helm-generic-files-map (make-sparse-keymap))
|
||||
(after! helm-locate (set-keymap-parent helm-generic-files-map helm-map))
|
||||
(after! helm-locate
|
||||
(when (and IS-MAC
|
||||
(null helm-locate-command)
|
||||
(executable-find "mdfind"))
|
||||
(setq helm-locate-command "mdfind -name %s"))
|
||||
(set-keymap-parent helm-generic-files-map helm-map))
|
||||
|
||||
|
||||
;;;###package helm-org
|
||||
(use-package! helm-org
|
||||
:when (featurep! :lang org)
|
||||
:defer t
|
||||
:init
|
||||
(after! helm-mode
|
||||
(pushnew! helm-completing-read-handlers-alist
|
||||
'(org-capture . helm-org-completing-read-tags)
|
||||
'(org-set-tags . helm-org-completing-read-tags))))
|
||||
|
||||
|
||||
;;;###package helm-projectile
|
||||
|
|
|
@ -12,3 +12,5 @@
|
|||
(package! helm-flx))
|
||||
(when (and EMACS26+ (featurep! +childframe))
|
||||
(package! posframe))
|
||||
(when (featurep! :lang org)
|
||||
(package! helm-org))
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
- [[#install][Install]]
|
||||
- [[#macos][MacOS]]
|
||||
- [[#arch-linux][Arch Linux]]
|
||||
- [[#opensuse][openSUSE]]
|
||||
- [[#features][Features]]
|
||||
- [[#jump-to-file-project-navigation][Jump-to-file project navigation]]
|
||||
- [[#project-search--replace][Project search & replace]]
|
||||
|
@ -90,6 +91,11 @@ brew install ripgrep the_silver_searcher
|
|||
sudo pacman --needed --noconfirm -S ripgrep the_silver_searcher
|
||||
#+END_SRC
|
||||
|
||||
*** openSUSE
|
||||
#+BEGIN_SRC sh :dir /sudo::
|
||||
sudo zypper install ripgrep the_silver_searcher
|
||||
#+END_SRC
|
||||
|
||||
* Features
|
||||
Ivy and its ilk are large plugins. Covering everything about them is outside of
|
||||
this documentation's scope, so only Doom-specific Ivy features are listed here:
|
||||
|
|
|
@ -214,7 +214,7 @@ If ARG (universal argument), open selection in other-window."
|
|||
|
||||
(defun +ivy--tasks-open-action (x)
|
||||
"Jump to the file and line of the current task."
|
||||
(cl-destructuring-bind (label type file line) x
|
||||
(cl-destructuring-bind (_label type file line) x
|
||||
(with-ivy-window
|
||||
(find-file (expand-file-name file (doom-project-root)))
|
||||
(goto-char (point-min))
|
||||
|
|
|
@ -62,8 +62,6 @@ immediately runs it on the current candidate (ending the ivy session)."
|
|||
projectile-completion-system 'ivy
|
||||
;; Don't use ^ as initial input
|
||||
ivy-initial-inputs-alist nil
|
||||
;; highlight til EOL
|
||||
ivy-format-function #'ivy-format-function-line
|
||||
;; disable magic slash on non-match
|
||||
ivy-magic-slash-non-match-action nil
|
||||
;; don't show recent files in switch-buffer
|
||||
|
@ -75,6 +73,9 @@ immediately runs it on the current candidate (ending the ivy session)."
|
|||
;; enable ability to select prompt (alternative to `ivy-immediate-done')
|
||||
ivy-use-selectable-prompt t)
|
||||
|
||||
(setf (alist-get 't ivy-format-functions-alist)
|
||||
#'ivy-format-function-line)
|
||||
|
||||
;; REVIEW Move this somewhere else and perhaps generalize this so both
|
||||
;; ivy/helm users can enjoy it.
|
||||
(defadvice! +ivy--counsel-file-jump-use-fd-rg-a (args)
|
||||
|
@ -220,10 +221,13 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
|
|||
[remap org-capture] #'counsel-org-capture
|
||||
[remap swiper] #'counsel-grep-or-swiper
|
||||
[remap evil-ex-registers] #'counsel-evil-registers
|
||||
[remap yank-pop] #'counsel-yank-pop)
|
||||
[remap yank-pop] #'counsel-yank-pop
|
||||
[remap locate] #'counsel-locate)
|
||||
:config
|
||||
(set-popup-rule! "^\\*ivy-occur" :size 0.35 :ttl 0 :quit nil)
|
||||
|
||||
(when IS-MAC
|
||||
(setq counsel-locate-cmd #'counsel-locate-cmd-mdfind))
|
||||
(setq counsel-find-file-ignore-regexp "\\(?:^[#.]\\)\\|\\(?:[#~]$\\)\\|\\(?:^Icon?\\)"
|
||||
counsel-describe-function-function #'helpful-callable
|
||||
counsel-describe-variable-function #'helpful-variable
|
||||
|
|
|
@ -20,20 +20,7 @@
|
|||
;;; Leader keys
|
||||
|
||||
(map! :leader
|
||||
:desc "Find file in project" "C-f" #'projectile-find-file
|
||||
:desc "Evaluate line/region" "e" #'+eval/line-or-region
|
||||
:desc "Open scratch buffer" "x" #'doom/open-scratch-buffer
|
||||
:desc "Open project scratch buffer" "X" #'doom/switch-to-scratch-buffer
|
||||
|
||||
(:when (featurep! :term term)
|
||||
:desc "Toggle term popup" "`" #'+term/toggle
|
||||
:desc "Open term here" "~" #'+term/here)
|
||||
(:when (featurep! :term vterm)
|
||||
:desc "Toggle vterm popup" "`" #'+vterm/toggle
|
||||
:desc "Open vterm here" "~" #'+vterm/here)
|
||||
(:when (featurep! :term eshell)
|
||||
:desc "Toggle eshell popup" "`" #'+eshell/toggle
|
||||
:desc "Open eshell here" "~" #'+eshell/here)
|
||||
|
||||
(:prefix ("l" . "<localleader>")) ; bound locally
|
||||
(:prefix ("!" . "checkers")) ; bound by flycheck
|
||||
|
@ -49,6 +36,8 @@
|
|||
:desc "Browse emacs.d" "E" #'+default/browse-emacsd
|
||||
:desc "Find file from here" "f" (if (fboundp 'counsel-file-jump) #'counsel-file-jump #'find-file)
|
||||
:desc "Find file in other project" "F" #'doom/browse-in-other-project
|
||||
:desc "Delete this file" "K" #'doom/delete-this-file
|
||||
:desc "Move this file" "m" #'doom/move-this-file
|
||||
:desc "Find file in project" "p" #'projectile-find-file
|
||||
:desc "Find file in other project" "P" #'doom/find-file-in-other-project
|
||||
:desc "Recent files" "r" #'recentf-open-files
|
||||
|
@ -56,11 +45,25 @@
|
|||
:desc "Sudo this file" "s" #'doom/sudo-this-file
|
||||
:desc "Sudo find file" "S" #'doom/sudo-find-file
|
||||
:desc "Yank filename" "y" #'+default/yank-buffer-filename
|
||||
:desc "Delete this file" "X" #'doom/delete-this-file)
|
||||
:desc "Open scratch buffer" "x" #'doom/open-scratch-buffer
|
||||
:desc "Open project scratch buffer" "X" #'doom/switch-to-scratch-buffer)
|
||||
|
||||
;;; <leader> g --- lookup
|
||||
(:when (featurep! :tools lookup)
|
||||
(:prefix-map ("g" . "lookup")
|
||||
"k" #'+lookup/documentation
|
||||
"d" #'+lookup/definition
|
||||
"D" #'+lookup/references
|
||||
"f" #'+lookup/file
|
||||
"o" #'+lookup/online-select
|
||||
"i" #'+lookup/in-docsets
|
||||
"I" #'+lookup/in-all-docsets))
|
||||
|
||||
;;; <leader> o --- org
|
||||
"o" nil ; we need to unbind it first as Org claims this
|
||||
(:prefix-map ("o". "org")
|
||||
:desc "Do what I mean" "o" #'+org/dwim-at-point
|
||||
:desc "Display inline images" "i" #'org-display-inline-images
|
||||
:desc "Search notes for symbol" "." #'+default/search-notes-for-symbol-at-point
|
||||
(:prefix ("a" . "org agenda")
|
||||
:desc "Agenda" "a" #'org-agenda
|
||||
|
@ -104,6 +107,17 @@
|
|||
:desc "Create Temp Template" "c" #'aya-create
|
||||
:desc "Use Temp Template" "e" #'aya-expand)
|
||||
|
||||
(:prefix-map ("t" . "terminal")
|
||||
(:when (featurep! :term term)
|
||||
:desc "Toggle term popup" "t" #'+term/toggle
|
||||
:desc "Open term here" "T" #'+term/here)
|
||||
(:when (featurep! :term vterm)
|
||||
:desc "Toggle vterm popup" "t" #'+vterm/toggle
|
||||
:desc "Open vterm here" "T" #'+vterm/here)
|
||||
(:when (featurep! :term eshell)
|
||||
:desc "Toggle eshell popup" "t" #'+eshell/toggle
|
||||
:desc "Open eshell here" "T" #'+eshell/here))
|
||||
|
||||
;;; <leader> v --- versioning
|
||||
(:prefix-map ("v" . "versioning")
|
||||
:desc "Git revert file" "R" #'vc-revert
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
[remap quit-window] #'kill-current-buffer)
|
||||
|
||||
(:map (help-mode-map helpful-mode-map)
|
||||
:n "o" 'ace-link-help)
|
||||
:n "o" #'ace-link-help)
|
||||
|
||||
;; misc
|
||||
:n "C-S-f" #'toggle-frame-fullscreen
|
||||
|
@ -116,6 +116,8 @@
|
|||
:v "g+" #'evil-numbers/inc-at-pt
|
||||
|
||||
;; custom evil keybinds
|
||||
:n "zn" #'+evil:narrow-buffer
|
||||
:n "zN" #'doom/widen-indirectly-narrowed-buffer
|
||||
:n "zx" #'kill-current-buffer
|
||||
:n "ZX" #'bury-buffer
|
||||
;; repeat in visual mode (FIXME buggy)
|
||||
|
@ -544,6 +546,7 @@
|
|||
:desc "Search buffer" "b" #'swiper
|
||||
:desc "Search current directory" "d" #'+default/search-cwd
|
||||
:desc "Search other directory" "D" #'+default/search-other-cwd
|
||||
:desc "Locate file" "f" #'locate
|
||||
:desc "Jump to symbol" "i" #'imenu
|
||||
:desc "Jump to link" "l" #'ace-link
|
||||
:desc "Look up online" "o" #'+lookup/online
|
||||
|
@ -581,7 +584,7 @@
|
|||
|
||||
;;; <leader> b --- buffer
|
||||
(:prefix-map ("b" . "buffer")
|
||||
:desc "Toggle narrowing" "-" #'doom/clone-and-narrow-buffer
|
||||
:desc "Toggle narrowing" "-" #'doom/toggle-narrow-buffer
|
||||
:desc "Previous buffer" "[" #'previous-buffer
|
||||
:desc "Next buffer" "]" #'next-buffer
|
||||
(:when (featurep! :ui workspaces)
|
||||
|
@ -594,7 +597,7 @@
|
|||
:desc "Switch to last buffer" "l" #'evil-switch-to-windows-last-buffer
|
||||
:desc "Next buffer" "n" #'next-buffer
|
||||
:desc "New empty buffer" "N" #'evil-buffer-new
|
||||
:desc "Kill other buffers" "o" #'doom/kill-other-buffers
|
||||
:desc "Kill other buffers" "O" #'doom/kill-other-buffers
|
||||
:desc "Previous buffer" "p" #'previous-buffer
|
||||
:desc "Save buffer" "s" #'save-buffer
|
||||
:desc "Sudo edit this file" "S" #'doom/sudo-this-file
|
||||
|
@ -615,7 +618,9 @@
|
|||
:desc "Delete trailing whitespace" "w" #'delete-trailing-whitespace
|
||||
:desc "Delete trailing newlines" "W" #'doom/delete-trailing-newlines
|
||||
(:when (featurep! :tools flycheck)
|
||||
:desc "List errors" "x" #'flycheck-list-errors))
|
||||
:desc "List errors" "x" #'flycheck-list-errors)
|
||||
(:unless (featurep! :tools flycheck)
|
||||
:desc "List errors" "x" #'flymake-show-diagnostics-buffer))
|
||||
|
||||
;;; <leader> f --- file
|
||||
(:prefix-map ("f" . "file")
|
||||
|
@ -629,6 +634,7 @@
|
|||
:desc "Find file in emacs.d" "e" #'+default/find-in-emacsd
|
||||
:desc "Browse emacs.d" "E" #'+default/browse-emacsd
|
||||
:desc "Find file from here" "f" #'find-file
|
||||
:desc "Locate file" "l" #'locate
|
||||
:desc "Move/rename file" "m" #'doom/move-this-file
|
||||
:desc "Find file in private config" "p" #'doom/find-file-in-private-config
|
||||
:desc "Browse private config" "P" #'doom/open-private-config
|
||||
|
@ -642,6 +648,8 @@
|
|||
;;; <leader> g --- git
|
||||
(:prefix-map ("g" . "git")
|
||||
:desc "Git revert file" "R" #'vc-revert
|
||||
:desc "Copy git link" "y" #'git-link
|
||||
:desc "Copy git link to homepage" "Y" #'git-link-homepage
|
||||
(:when (featurep! :ui vc-gutter)
|
||||
:desc "Git revert hunk" "r" #'git-gutter:revert-hunk
|
||||
:desc "Git stage hunk" "s" #'git-gutter:stage-hunk
|
||||
|
@ -667,7 +675,7 @@
|
|||
:desc "Find issue" "i" #'forge-visit-issue
|
||||
:desc "Find pull request" "p" #'forge-visit-pullreq)
|
||||
(:prefix ("o" . "open in browser")
|
||||
:desc "Browse region or line" "." #'+vc/git-browse-region-or-line
|
||||
:desc "Browse region or line" "o" #'+vc/git-browse-region-or-line
|
||||
:desc "Browse remote" "r" #'forge-browse-remote
|
||||
:desc "Browse commit" "c" #'forge-browse-commit
|
||||
:desc "Browse an issue" "i" #'forge-browse-issue
|
||||
|
@ -707,7 +715,12 @@
|
|||
:desc "Search org agenda headlines" "h" #'+default/org-notes-headlines
|
||||
:desc "Find file in notes" "n" #'+default/find-in-notes
|
||||
:desc "Browse notes" "N" #'+default/browse-notes
|
||||
:desc "Org store link" "l" #'org-store-link)
|
||||
:desc "Org store link" "l" #'org-store-link
|
||||
|
||||
(:when (featurep! :lang org +journal)
|
||||
(:prefix ("j" . "journal")
|
||||
:desc "New Entry" "j" #'org-journal-new-entry
|
||||
:desc "Search Forever" "s" #'org-journal-search-forever)))
|
||||
|
||||
;;; <leader> o --- open
|
||||
(:prefix-map ("o" . "open")
|
||||
|
@ -813,6 +826,10 @@
|
|||
;;; <leader> t --- toggle
|
||||
(:prefix-map ("t" . "toggle")
|
||||
:desc "Big mode" "b" #'doom-big-font-mode
|
||||
(:when (featurep! :tools flycheck)
|
||||
:desc "Flycheck" "f" #'flycheck-mode)
|
||||
(:unless (featurep! :tools flycheck)
|
||||
:desc "Flymake" "f" #'flymake-mode)
|
||||
:desc "Frame fullscreen" "F" #'toggle-frame-fullscreen
|
||||
:desc "Evil goggles" "g" #'evil-goggles-mode
|
||||
:desc "Indent style" "I" #'doom/toggle-indent-style
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
;;; config/default/+evil.el -*- lexical-binding: t; -*-
|
||||
|
||||
(defun +default|disable-delete-selection-mode ()
|
||||
(defun +default-disable-delete-selection-mode-h ()
|
||||
(delete-selection-mode -1))
|
||||
(add-hook 'evil-insert-state-entry-hook #'delete-selection-mode)
|
||||
(add-hook 'evil-insert-state-exit-hook #'+default|disable-delete-selection-mode)
|
||||
(add-hook 'evil-insert-state-exit-hook #'+default-disable-delete-selection-mode-h)
|
||||
|
||||
|
||||
;;
|
||||
|
|
|
@ -109,7 +109,7 @@ If ARG (universal argument), runs `compile' from the current directory."
|
|||
((error "No kill-ring search backend available. Enable ivy or helm!")))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +default*newline-indent-and-continue-comments ()
|
||||
(defun +default--newline-indent-and-continue-comments-a ()
|
||||
"A replacement for `newline-and-indent'.
|
||||
|
||||
Continues comments if executed from a commented line, with special support for
|
||||
|
@ -159,7 +159,7 @@ possible, or just one char if that's not possible."
|
|||
((delete-char -1)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +default*delete-backward-char (n &optional killflag)
|
||||
(defun +default--delete-backward-char-a (n &optional killflag)
|
||||
"Same as `delete-backward-char', but preforms these additional checks:
|
||||
|
||||
+ If point is surrounded by (balanced) whitespace and a brace delimiter ({} []
|
||||
|
@ -283,11 +283,11 @@ If prefix ARG is set, prompt for a known project to search from."
|
|||
((rgrep (regexp-quote symbol))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +default/search-notes-for-symbol-at-point (&optional arg symbol)
|
||||
(defun +default/search-notes-for-symbol-at-point (&optional symbol)
|
||||
"Conduct a text search in the current project for symbol at point. If prefix
|
||||
ARG is set, prompt for a known project to search from."
|
||||
(interactive
|
||||
(list current-prefix-arg (thing-at-point 'symbol t)))
|
||||
(list (thing-at-point 'symbol t)))
|
||||
(require 'org)
|
||||
(let ((default-directory org-directory))
|
||||
(+default/search-project-for-symbol-at-point
|
||||
|
|
|
@ -34,6 +34,10 @@
|
|||
;; prompt for the key passphrase.
|
||||
epa-pinentry-mode 'loopback))
|
||||
|
||||
;;;###package tramp
|
||||
(unless IS-WINDOWS
|
||||
(setq tramp-default-method "ssh")) ; faster than the default scp
|
||||
|
||||
|
||||
;;
|
||||
;;; Smartparens config
|
||||
|
@ -195,10 +199,10 @@
|
|||
;; e) properly delete smartparen pairs when they are encountered, without
|
||||
;; the need for strict mode.
|
||||
;; f) do none of this when inside a string
|
||||
(advice-add #'delete-backward-char :override #'+default*delete-backward-char))
|
||||
(advice-add #'delete-backward-char :override #'+default--delete-backward-char-a))
|
||||
|
||||
;; Makes `newline-and-indent' continue comments (and more reliably)
|
||||
(advice-add #'newline-and-indent :override #'+default*newline-indent-and-continue-comments))
|
||||
(advice-add #'newline-and-indent :override #'+default--newline-indent-and-continue-comments-a))
|
||||
|
||||
|
||||
;;
|
||||
|
@ -260,7 +264,6 @@
|
|||
(define-key! help-map
|
||||
;; new keybinds
|
||||
"'" #'describe-char
|
||||
"B" #'doom/open-bug-report
|
||||
"D" #'doom/help
|
||||
"E" #'doom/sandbox
|
||||
"M" #'doom/describe-active-minor-mode
|
||||
|
@ -312,8 +315,6 @@
|
|||
"F" #'describe-face
|
||||
;; replaces `view-hello-file' b/c annoying
|
||||
"h" #'doom/help
|
||||
;; replaces `describe-language-environment' b/c remapped to C-l
|
||||
"L" #'global-command-log-mode
|
||||
;; replaces `view-emacs-news' b/c it's on C-n too
|
||||
"n" #'doom/help-news
|
||||
;; replaces `finder-by-keyword'
|
||||
|
|
|
@ -53,7 +53,12 @@ variable for an explanation of the defaults (in comments). See
|
|||
;; (url-retrieve-synchronously "https://raw.githubusercontent.com/emacs-evil/evil-collection/master/evil-collection.el" t t)
|
||||
;; (goto-char (point-min))
|
||||
;; (when (re-search-forward "^(defcustom evil-collection-mode-list\n[^(]+")
|
||||
;; (kill-new (thing-at-point 'sexp t))))
|
||||
;; (let ((list (sexp-at-point)))
|
||||
;; ;; Fixes
|
||||
;; (when (assq 'pdf list)
|
||||
;; (setf (alist-get 'pdf list) '(pdf-tools)))
|
||||
;; (kill-new (prin1-to-string list)))))
|
||||
|
||||
(defvar evil-collection-mode-list
|
||||
`(2048-game
|
||||
ag
|
||||
|
@ -143,7 +148,7 @@ variable for an explanation of the defaults (in comments). See
|
|||
p4
|
||||
(package-menu package)
|
||||
pass
|
||||
(pdf pdf-view)
|
||||
(pdf pdf-tools)
|
||||
popup
|
||||
proced
|
||||
process-menu
|
||||
|
|
|
@ -135,10 +135,18 @@ integration."
|
|||
|
||||
;;;###autoload (autoload '+evil:narrow-buffer "editor/evil/autoload/evil" nil t)
|
||||
(evil-define-operator +evil:narrow-buffer (beg end &optional bang)
|
||||
"Wrapper around `doom/clone-and-narrow-buffer'."
|
||||
"Narrow the buffer to region between BEG and END.
|
||||
|
||||
Widens narrowed buffers first. If BANG, use indirect buffer clones instead."
|
||||
:move-point nil
|
||||
(interactive "<r><!>")
|
||||
(doom/clone-and-narrow-buffer beg end bang))
|
||||
(if (not bang)
|
||||
(if (buffer-narrowed-p)
|
||||
(widen)
|
||||
(narrow-to-region beg end))
|
||||
(when (buffer-narrowed-p)
|
||||
(doom/widen-indirectly-narrowed-buffer t))
|
||||
(doom/narrow-buffer-indirectly beg end)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +evil/next-beginning-of-method (count)
|
||||
|
@ -192,13 +200,13 @@ See `+evil/next-preproc-directive' for details."
|
|||
(dotimes (_ (abs count))
|
||||
(cond ((> count 0)
|
||||
(while (and (not (eobp)) (sp-point-in-comment))
|
||||
(next-line))
|
||||
(forward-line 1))
|
||||
(unless (comment-search-forward (point-max) 'noerror)
|
||||
(goto-char orig-pt)
|
||||
(user-error "No comment after point")))
|
||||
(t
|
||||
(while (and (not (bobp)) (sp-point-in-comment))
|
||||
(previous-line))
|
||||
(forward-line -1))
|
||||
(unless (comment-search-backward nil 'noerror)
|
||||
(goto-char orig-pt)
|
||||
(user-error "No comment before point")))))))
|
||||
|
|
|
@ -177,7 +177,7 @@ If BANG, search Doom documentation."
|
|||
'module (list cat mod))))
|
||||
(module (completing-read "Describe module: " modules nil t query))
|
||||
(key (get-text-property 0 'module module)))
|
||||
(doom/help-modules key)))
|
||||
(doom/help-modules (car key) (cdr key))))
|
||||
((and (string-match-p "\\(?:SPC\\|[CMsSH]-[^ ]\\|<[^>]+>\\)" query)
|
||||
(helpful-key (kbd (string-trim query)))))
|
||||
((apropos query t)))))
|
||||
|
|
|
@ -85,31 +85,31 @@
|
|||
|
||||
;;; ]u / [u
|
||||
;;;###autoload (autoload '+evil:url-encode "editor/evil/autoload/unimpaired" nil t)
|
||||
(evil-define-operator +evil:url-encode (count &optional beg end type)
|
||||
(evil-define-operator +evil:url-encode (_count &optional beg end)
|
||||
"TODO"
|
||||
(interactive "<c><R>")
|
||||
(interactive "<c><r>")
|
||||
(+evil--encode beg end #'url-encode-url))
|
||||
|
||||
;;;###autoload (autoload '+evil:url-decode "editor/evil/autoload/unimpaired" nil t)
|
||||
(evil-define-operator +evil:url-decode (count &optional beg end type)
|
||||
(evil-define-operator +evil:url-decode (_count &optional beg end)
|
||||
"TODO"
|
||||
(interactive "<c><R>")
|
||||
(interactive "<c><r>")
|
||||
(+evil--encode beg end #'url-unhex-string))
|
||||
|
||||
;;; ]y / [y
|
||||
;;;###autoload (autoload '+evil:c-string-encode "editor/evil/autoload/unimpaired" nil t)
|
||||
(evil-define-operator +evil:c-string-encode (count &optional beg end type)
|
||||
(evil-define-operator +evil:c-string-encode (_count &optional beg end)
|
||||
"TODO"
|
||||
(interactive "<c><R>")
|
||||
(interactive "<c><r>")
|
||||
(+evil--encode
|
||||
beg end
|
||||
(lambda (text)
|
||||
(replace-regexp-in-string "[\"\\]" (lambda (ch) (concat "\\" ch)) text))))
|
||||
|
||||
;;;###autoload (autoload '+evil:c-string-decode "editor/evil/autoload/unimpaired" nil t)
|
||||
(evil-define-operator +evil:c-string-decode (count &optional beg end type)
|
||||
(evil-define-operator +evil:c-string-decode (_count &optional beg end)
|
||||
"TODO"
|
||||
(interactive "<c><R>")
|
||||
(interactive "<c><r>")
|
||||
(+evil--encode
|
||||
beg end
|
||||
(lambda (text)
|
||||
|
|
|
@ -257,12 +257,12 @@ directives. By default, this only recognizes C directives.")
|
|||
|
||||
(use-package! evil-escape
|
||||
:commands evil-escape
|
||||
:after-call evil-normal-state-exit-hook
|
||||
:after-call pre-command-hook
|
||||
:init
|
||||
(setq evil-escape-excluded-states '(normal visual multiedit emacs motion)
|
||||
evil-escape-excluded-major-modes '(neotree-mode treemacs-mode vterm-mode)
|
||||
evil-escape-key-sequence "jk"
|
||||
evil-escape-delay 0.25)
|
||||
evil-escape-delay 0.15)
|
||||
(evil-define-key* '(insert replace visual operator) 'global "\C-g" #'evil-escape)
|
||||
:config
|
||||
;; no `evil-escape' in minibuffer
|
||||
|
|
|
@ -3,12 +3,11 @@
|
|||
|
||||
(describe "feature/evil"
|
||||
:var (resv project-root)
|
||||
(before-all
|
||||
(require! :editor evil)
|
||||
(require 'evil)
|
||||
(load! "../autoload/evil"))
|
||||
(after-all
|
||||
(unload-feature 'evil t))
|
||||
|
||||
(require! :editor evil)
|
||||
(require 'evil)
|
||||
(load! "../autoload/evil")
|
||||
|
||||
(before-each
|
||||
(fset 'resv #'+evil-resolve-vim-path-a)
|
||||
(spy-on 'doom-project-root :and-call-fake (lambda () project-root)))
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
(defun +multiple-cursors/evil-mc-toggle-cursors ()
|
||||
"Toggle frozen state of evil-mc cursors."
|
||||
(interactive)
|
||||
(unless (evil-mc-has-cursors-p)
|
||||
(user-error "No cursors exist to be toggled"))
|
||||
(setq evil-mc-frozen (not (and (evil-mc-has-cursors-p)
|
||||
evil-mc-frozen)))
|
||||
(if evil-mc-frozen
|
||||
|
@ -45,12 +47,14 @@ pauses cursors."
|
|||
(evil-mc-make-cursor-here))))
|
||||
|
||||
;;;###autoload (autoload '+multiple-cursors:evil-mc "editor/multiple-cursors/autoload/evil-mc" nil t)
|
||||
(evil-define-command +multiple-cursors:evil-mc (beg end type pattern &optional bang)
|
||||
"Create mc cursors at each match of PATTERN within BEG and END, and leave the
|
||||
cursor at the final match. If BANG, then treat PATTERN as literal."
|
||||
(evil-define-command +multiple-cursors:evil-mc (beg end type pattern &optional flags bang)
|
||||
"Create mc cursors at each match of PATTERN within BEG and END.
|
||||
|
||||
This leaves the cursor at the final match. If BANG, then treat PATTERN as
|
||||
literal. PATTERN is a delimited regexp (the same that :g or :s uses)."
|
||||
:move-point nil
|
||||
:evil-mc t
|
||||
(interactive "<R><//g><!>")
|
||||
(interactive "<R><//!><!>")
|
||||
(unless (and (stringp pattern)
|
||||
(not (string-empty-p pattern)))
|
||||
(user-error "A regexp pattern is required"))
|
||||
|
@ -59,9 +63,19 @@ cursor at the final match. If BANG, then treat PATTERN as literal."
|
|||
(cons (evil-ex-make-search-pattern
|
||||
(if bang (regexp-quote pattern) pattern))
|
||||
(list beg end type)))
|
||||
(save-excursion
|
||||
(evil-with-restriction beg end
|
||||
(evil-mc-make-cursors-for-all)))
|
||||
(evil-with-restriction beg end
|
||||
(let ((point (point)))
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(while (eq (evil-ex-find-next (evil-mc-get-pattern) 'forward t) t)
|
||||
(goto-char (1- (point)))
|
||||
(when (/= point (point))
|
||||
(evil-mc-run-cursors-before)
|
||||
(evil-mc-make-cursor-at-pos (point)))
|
||||
(goto-char
|
||||
(if (memq ?g flags)
|
||||
(line-beginning-position 2)
|
||||
(1+ (point))))))))
|
||||
(evil-exit-visual-state)
|
||||
(evil-mc-goto-cursor
|
||||
(if (= (evil-visual-direction) 1)
|
||||
|
|
|
@ -59,11 +59,7 @@
|
|||
;; Forward declare these so that ex completion and evil-mc support is
|
||||
;; recognized before the autoloaded functions are loaded.
|
||||
(evil-add-command-properties '+evil:align :evil-mc t)
|
||||
(evil-set-command-properties '+multiple-cursors:evil-mc
|
||||
:move-point nil
|
||||
:ex-arg 'global-match
|
||||
:ex-bang t
|
||||
:evil-mc t))
|
||||
(evil-add-command-properties '+multiple-cursors:evil-mc :evil-mc t))
|
||||
|
||||
|
||||
(after! multiple-cursors-core
|
||||
|
|
|
@ -5,6 +5,6 @@
|
|||
"Register minor MODES (one mode symbol or a list of them) with yasnippet so it
|
||||
can have its own snippets category, if the folder exists."
|
||||
(dolist (mode (doom-enlist modes))
|
||||
(let ((fn (intern (format "+snippets|register-%s" mode))))
|
||||
(let ((fn (intern (format "+snippets-register-%s-h" mode))))
|
||||
(fset fn (lambda () (yas-activate-extra-mode mode)))
|
||||
(add-hook (intern (format "%s-hook" mode)) fn))))
|
||||
|
|
|
@ -225,7 +225,7 @@ You will be prompted for a snippet to alias."
|
|||
"# condition: t}\n"
|
||||
"# type: command\n"
|
||||
"# --\n"
|
||||
"(%alias \"${4:" (or template "uuid") "}\")"))
|
||||
"(%alias \"${4:" (or template-uuid "uuid") "}\")"))
|
||||
(when (bound-and-true-p evil-local-mode)
|
||||
(evil-insert-state)))))
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
;; Use GNU ls as `gls' from `coreutils' if available. Add `(setq
|
||||
;; dired-use-ls-dired nil)' to your config to suppress the Dired warning
|
||||
;; when not using GNU ls.
|
||||
(if-let* ((gls (executable-find "gls")))
|
||||
(if-let (gls (executable-find "gls"))
|
||||
(setq insert-directory-program gls)
|
||||
;; BSD ls doesn't support --group-directories-first
|
||||
(setq args (delete "--group-directories-first" args))))
|
||||
|
@ -45,30 +45,12 @@
|
|||
:hook (dired-mode . diredfl-mode))
|
||||
|
||||
|
||||
(use-package! dired-k
|
||||
:hook (dired-initial-position . dired-k)
|
||||
:hook (dired-after-readin . dired-k-no-revert)
|
||||
(use-package! diff-hl
|
||||
:hook (dired-mode . diff-hl-dired-mode)
|
||||
:hook (magit-post-refresh . diff-hl-magit-post-refresh)
|
||||
:config
|
||||
(setq dired-k-style 'git
|
||||
dired-k-padding 1)
|
||||
|
||||
;; Don't highlight based on mtime, this interferes with diredfl and is more
|
||||
;; confusing than helpful.
|
||||
(advice-add #'dired-k--highlight-by-file-attribyte :override #'ignore)
|
||||
|
||||
(defadvice! +dired--interrupt-process-a (orig-fn &rest args)
|
||||
"Fixes dired-k killing git processes too abruptly, leaving behind disruptive
|
||||
.git/index.lock files."
|
||||
:around #'dired-k--start-git-status
|
||||
(cl-letf (((symbol-function #'kill-process)
|
||||
(symbol-function #'interrupt-process)))
|
||||
(apply orig-fn args)))
|
||||
|
||||
(defadvice! +dired--dired-k-highlight-a (orig-fn &rest args)
|
||||
"Butt out if the requested directory is remote (i.e. through tramp)."
|
||||
:around #'dired-k--highlight
|
||||
(unless (file-remote-p default-directory)
|
||||
(apply orig-fn args))))
|
||||
;; use margin instead of fringe
|
||||
(diff-hl-margin-mode))
|
||||
|
||||
|
||||
(use-package! ranger
|
||||
|
@ -117,6 +99,7 @@ we have to clean it up ourselves."
|
|||
|
||||
|
||||
(use-package! dired-x
|
||||
:unless (featurep! +ranger)
|
||||
:hook (dired-mode . dired-omit-mode)
|
||||
:config
|
||||
(setq dired-omit-verbose nil)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
;;; emacs/dired/packages.el
|
||||
|
||||
(package! diredfl)
|
||||
(package! dired-k)
|
||||
(package! diff-hl)
|
||||
(package! dired-rsync)
|
||||
(when (featurep! +ranger)
|
||||
(package! ranger))
|
||||
|
|
|
@ -4,16 +4,18 @@
|
|||
#+STARTUP: inlineimages
|
||||
|
||||
* Table of Contents :TOC:
|
||||
- [[Description][Description]]
|
||||
- [[Module Flags][Module Flags]]
|
||||
- [[Plugins][Plugins]]
|
||||
- [[Prerequisites][Prerequisites]]
|
||||
- [[MacOS][MacOS]]
|
||||
- [[Arch Linux][Arch Linux]]
|
||||
- [[Features][Features]]
|
||||
- [[Configuration][Configuration]]
|
||||
- [[offlineimap][offlineimap]]
|
||||
- [[mbsync][mbsync]]
|
||||
- [[#description][Description]]
|
||||
- [[#module-flags][Module Flags]]
|
||||
- [[#plugins][Plugins]]
|
||||
- [[#prerequisites][Prerequisites]]
|
||||
- [[#macos][MacOS]]
|
||||
- [[#arch-linux][Arch Linux]]
|
||||
- [[#nixos][NixOS]]
|
||||
- [[#opensuse][openSUSE]]
|
||||
- [[#features][Features]]
|
||||
- [[#configuration][Configuration]]
|
||||
- [[#offlineimap][offlineimap]]
|
||||
- [[#mbsync][mbsync]]
|
||||
|
||||
* Description
|
||||
This module makes Emacs an email client, using ~mu4e~.
|
||||
|
@ -66,6 +68,15 @@ environment.systemPackages = with pkgs; [
|
|||
|
||||
[[https://github.com/Emiller88/dotfiles/blob/master/modules/shell/mail.nix][An example of setting up mbsync with home-manager]]
|
||||
|
||||
** openSUSE
|
||||
|
||||
Remove ~#~ in ~#sync_program=offlineimap~ to choose ~offlineimap~ instead of ~mbsync~.
|
||||
#+BEGIN_SRC sh :dir /sudo::
|
||||
sync_program=isync # mbsync
|
||||
#sync_program=offlineimap
|
||||
sudo zypper install maildir-utils $sync_programm
|
||||
#+END_SRC
|
||||
|
||||
* TODO Features
|
||||
|
||||
* Configuration
|
||||
|
|
|
@ -36,15 +36,15 @@
|
|||
when exporting org-mode to html."
|
||||
:filter-args #'org-html-paragraph
|
||||
(cl-destructuring-bind (paragraph contents info) args
|
||||
(let* ((fix-regexp "[[:multibyte:]a-zA-Z0-9]")
|
||||
(origin-contents contents)
|
||||
(let* ((fix-regexp "[[:multibyte:]]")
|
||||
(origin-contents
|
||||
(replace-regexp-in-string
|
||||
"<[Bb][Rr] */>"
|
||||
""
|
||||
contents))
|
||||
(fixed-contents
|
||||
(replace-regexp-in-string
|
||||
(concat "\\("
|
||||
fix-regexp
|
||||
"\\) *\\(<[Bb][Rr] */>\\)?\n *\\("
|
||||
fix-regexp
|
||||
"\\)")
|
||||
"\\1\\3"
|
||||
(concat "\\(" fix-regexp "\\) *\n *\\(" fix-regexp "\\)")
|
||||
"\\1\\2"
|
||||
origin-contents)))
|
||||
(list paragraph fixed-contents info))))
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
(after! helm (helm-migemo-mode +1)))))
|
||||
|
||||
|
||||
(use-package pangu-spacing
|
||||
(use-package! pangu-spacing
|
||||
:hook (text-mode . pangu-spacing-mode)
|
||||
:init
|
||||
;; replacing `chinese-two-byte' by `japanese'
|
||||
|
@ -46,15 +46,15 @@
|
|||
when exporting org-mode to html."
|
||||
:filter-args #'org-html-paragraph
|
||||
(cl-destructuring-bind (paragraph contents info) args
|
||||
(let* ((fix-regexp "[[:multibyte:]a-zA-Z0-9]")
|
||||
(origin-contents contents)
|
||||
(let* ((fix-regexp "[[:multibyte:]]")
|
||||
(origin-contents
|
||||
(replace-regexp-in-string
|
||||
"<[Bb][Rr] */>"
|
||||
""
|
||||
contents))
|
||||
(fixed-contents
|
||||
(replace-regexp-in-string
|
||||
(concat "\\("
|
||||
fix-regexp
|
||||
"\\) *\\(<[Bb][Rr] */>\\)?\n *\\("
|
||||
fix-regexp
|
||||
"\\)")
|
||||
"\\1\\3"
|
||||
(concat "\\(" fix-regexp "\\) *\n *\\(" fix-regexp "\\)")
|
||||
"\\1\\2"
|
||||
origin-contents)))
|
||||
(list paragraph fixed-contents info))))
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
#+TITLE: :lang agda
|
||||
|
||||
This module adds support for the [[http://wiki.portal.chalmers.se/agda/pmwiki.php][agda]] programming language.
|
||||
|
||||
Emacs support is included in the agda release (you can find installation
|
||||
instructions [[https://agda.readthedocs.io/en/latest/getting-started/installation.html][here]]). This module attempts to find the location of ~agda2.el~ via
|
||||
the ~agda-mode locate~ command that comes with the agda release. Users can set
|
||||
this manually by setting the ~+agda2-dir~ variable.
|
||||
|
||||
This module adds support for the [[http://wiki.portal.chalmers.se/agda/pmwiki.php][agda]] programming language. The Emacs support
|
||||
exists directly in the agda repository but not in melpa.
|
||||
|
|
|
@ -1,41 +1,31 @@
|
|||
;;; lang/agda/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(defvar +agda-dir
|
||||
(when (executable-find "agda-mode")
|
||||
(file-name-directory (shell-command-to-string "agda-mode locate"))))
|
||||
|
||||
(use-package! agda2
|
||||
:when +agda-dir
|
||||
:load-path +agda-dir)
|
||||
|
||||
(use-package! agda2-mode
|
||||
:defer t
|
||||
:config
|
||||
(map! :map agda2-mode-map
|
||||
:localleader
|
||||
"?" #'agda2-show-goals
|
||||
"." #'agda2-goal-and-context-and-inferred
|
||||
"," #'agda2-goal-and-context
|
||||
"=" #'agda2-show-constraints
|
||||
"SPC" #'agda2-give
|
||||
"a" #'agda2-auto-maybe-all
|
||||
"b" #'agda2-previous-goal
|
||||
"c" #'agda2-make-case
|
||||
"d" #'agda2-infer-type-maybe-toplevel
|
||||
"e" #'agda2-show-context
|
||||
"f" #'agda2-next-goal
|
||||
"gG" #'agda2-go-back
|
||||
"h" #'agda2-helper-function-type
|
||||
"l" #'agda2-load
|
||||
"n" #'agda2-compute-normalised-maybe-toplevel
|
||||
"p" #'agda2-module-contents-maybe-toplevel
|
||||
"r" #'agda2-refine
|
||||
"s" #'agda2-solveAll
|
||||
"t" #'agda2-goal-type
|
||||
"w" #'agda2-why-in-scope-maybe-toplevel
|
||||
(:prefix "x"
|
||||
"c" #'agda2-compile
|
||||
"d" #'agda2-remove-annotations
|
||||
"h" #'agda2-display-implicit-arguments
|
||||
"q" #'agda2-quit
|
||||
"r" #'agda2-restart)))
|
||||
(map! :after agda2-mode
|
||||
:map agda2-mode-map
|
||||
:localleader
|
||||
"?" #'agda2-show-goals
|
||||
"." #'agda2-goal-and-context-and-inferred
|
||||
"," #'agda2-goal-and-context
|
||||
"=" #'agda2-show-constraints
|
||||
"SPC" #'agda2-give
|
||||
"a" #'agda2-auto-maybe-all
|
||||
"b" #'agda2-previous-goal
|
||||
"c" #'agda2-make-case
|
||||
"d" #'agda2-infer-type-maybe-toplevel
|
||||
"e" #'agda2-show-context
|
||||
"f" #'agda2-next-goal
|
||||
"gG" #'agda2-go-back
|
||||
"h" #'agda2-helper-function-type
|
||||
"l" #'agda2-load
|
||||
"n" #'agda2-compute-normalised-maybe-toplevel
|
||||
"p" #'agda2-module-contents-maybe-toplevel
|
||||
"r" #'agda2-refine
|
||||
"s" #'agda2-solveAll
|
||||
"t" #'agda2-goal-type
|
||||
"w" #'agda2-why-in-scope-maybe-toplevel
|
||||
(:prefix "x"
|
||||
"c" #'agda2-compile
|
||||
"d" #'agda2-remove-annotations
|
||||
"h" #'agda2-display-implicit-arguments
|
||||
"q" #'agda2-quit
|
||||
"r" #'agda2-restart))
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
;; -*- lexical-binding: t; no-byte-compile: t; -*-
|
||||
;;; lang/agda/doctor.el
|
||||
|
||||
(unless (executable-find "agda-mode")
|
||||
(warn! "Couldn't find agda-mode. Agda support won't work"))
|
15
modules/lang/agda/packages.el
Normal file
15
modules/lang/agda/packages.el
Normal file
|
@ -0,0 +1,15 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/agda/packages.el
|
||||
|
||||
|
||||
(package! agda-input
|
||||
:recipe
|
||||
(:host github :repo "agda/agda"
|
||||
:files ("src/data/emacs-mode/agda-input.el")))
|
||||
|
||||
(package! agda2-mode
|
||||
:recipe
|
||||
(:host github :repo "agda/agda"
|
||||
:files
|
||||
("src/data/emacs-mode/*.el"
|
||||
(:exclude "agda-input.el"))))
|
|
@ -11,6 +11,7 @@
|
|||
- [[#irony-server][irony-server]]
|
||||
- [[#macos][MacOS]]
|
||||
- [[#arch-linux][Arch Linux]]
|
||||
- [[#opensuse][openSUSE]]
|
||||
- [[#rtags][rtags]]
|
||||
- [[#configure][Configure]]
|
||||
- [[#project-compile-settings][Project compile settings]]
|
||||
|
@ -93,6 +94,11 @@ rm -rf irony-mode
|
|||
pacman -S clang cmake
|
||||
#+END_SRC
|
||||
|
||||
*** openSUSE
|
||||
#+BEGIN_SRC sh :dir /sudo::
|
||||
sudo zypper install clang cmake
|
||||
#+END_SRC
|
||||
|
||||
** rtags
|
||||
Code navigation requires an [[https://github.com/Andersbakken/rtags][rtags]] server (~rdm~) installed. This should be
|
||||
available through your OS's package manager.
|
||||
|
|
|
@ -103,7 +103,7 @@ simpler."
|
|||
(rtags-call-rc :silent t "-J" (or (doom-project-root) default-directory))))
|
||||
;; then irony
|
||||
(when (and (featurep 'irony) irony-mode)
|
||||
(+cc|irony-init-compile-options)))
|
||||
(+cc-init-irony-compile-options-h)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +cc/imenu ()
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
;;; lang/clojure/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###package clojure-mode
|
||||
(add-hook 'clojure-mode-hook #'rainbow-delimiters-mode)
|
||||
(after! clojure-mode
|
||||
(add-hook 'clojure-mode-hook #'rainbow-delimiters-mode)
|
||||
|
||||
(set-repl-handler! 'clojure-mode #'+clojure/repl)
|
||||
(set-eval-handler! 'clojure-mode #'cider-eval-region))
|
||||
|
||||
|
||||
(use-package! cider
|
||||
;; NOTE: if you don't have an org directory set (the dir doesn't exist),
|
||||
;; cider jack in won't work.
|
||||
:commands (cider-jack-in cider-jack-in-clojurescript)
|
||||
:commands cider-jack-in cider-jack-in-clojurescript
|
||||
:hook (clojure-mode-local-vars . cider-mode)
|
||||
:init
|
||||
(set-repl-handler! 'clojure-mode #'+clojure/repl)
|
||||
(set-eval-handler! 'clojure-mode #'cider-eval-region)
|
||||
:config
|
||||
(add-hook 'cider-mode-hook #'eldoc-mode)
|
||||
(set-lookup-handlers! 'cider-mode
|
||||
:definition #'+clojure-cider-lookup-definition
|
||||
:documentation #'cider-doc)
|
||||
(add-hook 'cider-mode-hook #'eldoc-mode)
|
||||
:config
|
||||
(set-popup-rules!
|
||||
'(("^\\*cider-error*" :ignore t)
|
||||
("^\\*cider-repl" :quit nil)
|
||||
|
@ -134,10 +134,9 @@
|
|||
|
||||
(use-package! clj-refactor
|
||||
:hook (clojure-mode . clj-refactor-mode)
|
||||
:init
|
||||
:config
|
||||
(set-lookup-handlers! 'clj-refactor-mode
|
||||
:references #'cljr-find-usages)
|
||||
:config
|
||||
(map! :map clojure-mode-map
|
||||
:localleader
|
||||
:desc "refactor" "R" #'hydra-cljr-help-menu/body))
|
||||
|
|
|
@ -1,4 +1,15 @@
|
|||
;;; lang/coq/autoload.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; HACK `proof-general' ascertains its own library path at compile time in its
|
||||
;; autoloads file using `byte-compile-current-file' (and stores it in
|
||||
;; `pg-init--script-full-path'). This means that when
|
||||
;; `doom-package-autoload-file' is created and byte-compiled,
|
||||
;; `pg-init--script-full-path' will be wrong, causing file-missing errors as it
|
||||
;; tries to load `proof-site'. We prevent this by defining these two variables
|
||||
;; early, in our own autoloads file.
|
||||
;;;###autoload
|
||||
(setq pg-init--script-full-path (locate-library "proof-general")
|
||||
pg-init--pg-root (file-name-directory pg-init--script-full-path))
|
||||
|
||||
;;;###autoload
|
||||
(add-hook 'coq-mode-hook #'company-coq-mode)
|
||||
|
|
|
@ -7,6 +7,45 @@
|
|||
;; library included with Doom).
|
||||
(setq coq-mode-abbrev-table '())
|
||||
|
||||
(map! :after coq-mode
|
||||
:map coq-mode-map
|
||||
:localleader
|
||||
"]" #'proof-assert-next-command-interactive
|
||||
"[" #'proof-undo-last-successful-command
|
||||
"." #'proof-goto-point
|
||||
(:prefix ("l" . "layout")
|
||||
"c" #'pg-response-clear-displays
|
||||
"l" #'proof-layout-windows
|
||||
"p" #'proof-prf)
|
||||
(:prefix ("p" . "proof")
|
||||
"i" #'proof-interrupt-process
|
||||
"p" #'proof-process-buffer
|
||||
"q" #'proof-shell-exit
|
||||
"r" #'proof-retract-buffer)
|
||||
(:prefix ("a" . "about/print/check")
|
||||
"a" #'coq-Print
|
||||
"A" #'coq-Print-with-all
|
||||
"b" #'coq-About
|
||||
"B" #'coq-About-with-all
|
||||
"c" #'coq-Check
|
||||
"C" #'coq-Check-show-all
|
||||
"f" #'proof-find-theorems
|
||||
(:prefix ("i" . "implicits")
|
||||
"b" #'coq-About-with-implicits
|
||||
"c" #'coq-Check-show-implicits
|
||||
"i" #'coq-Print-with-implicits))
|
||||
(:prefix ("g" . "goto")
|
||||
"e" #'proof-goto-command-end
|
||||
"l" #'proof-goto-end-of-locked
|
||||
"s" #'proof-goto-command-start)
|
||||
(:prefix ("i" . "insert")
|
||||
"c" #'coq-insert-command
|
||||
"e" #'coq-end-Section
|
||||
"i" #'coq-insert-intros
|
||||
"r" #'coq-insert-requires
|
||||
"s" #'coq-insert-section-or-module
|
||||
"t" #'coq-insert-tactic
|
||||
"T" #'coq-insert-tactical))
|
||||
|
||||
(after! company-coq
|
||||
(set-popup-rule! "^\\*\\(?:response\\|goals\\)\\*" :ignore t)
|
||||
|
@ -15,4 +54,15 @@
|
|||
:references #'company-coq-grep-symbol
|
||||
:documentation #'company-coq-doc)
|
||||
(unless (featurep! :completion company)
|
||||
(setq company-coq-disabled-features '(company company-defaults))))
|
||||
(setq company-coq-disabled-features '(company company-defaults)))
|
||||
|
||||
(map! :map coq-mode-map
|
||||
:localleader
|
||||
(:prefix ("i" . "insert")
|
||||
"l" #'company-coq-lemma-from-goal
|
||||
"m" #'company-coq-insert-match-construct)
|
||||
"ao" #'company-coq-occur
|
||||
(:prefix ("h" . "help")
|
||||
"e" #'company-coq-document-error
|
||||
"E" #'company-coq-browse-error-messages
|
||||
"h" #'company-coq-doc)))
|
||||
|
|
|
@ -1,28 +1,39 @@
|
|||
#+TITLE: :lang csharp
|
||||
|
||||
This module adds C# support to Emacs.
|
||||
|
||||
#+begin_quote
|
||||
I don't use C# for much else than Unity3D and, seldomly, for Mono game
|
||||
development on Linux.
|
||||
#+end_quote
|
||||
|
||||
* Table of Contents :TOC:
|
||||
- [[Install][Install]]
|
||||
- [[MacOS][MacOS]]
|
||||
- [[Arch Linux][Arch Linux]]
|
||||
- [[#description][Description]]
|
||||
- [[#module-flags][Module Flags]]
|
||||
- [[#plugins][Plugins]]
|
||||
- [[#prerequisites][Prerequisites]]
|
||||
- [[#macos][MacOS]]
|
||||
- [[#arch-linux][Arch Linux]]
|
||||
- [[#nixos][NixOS]]
|
||||
|
||||
* Install
|
||||
* Description
|
||||
This module adds C# support to Emacs. Powered by omnisharp (directly or through
|
||||
LSP).
|
||||
|
||||
** Module Flags
|
||||
+ =+lsp= Enables omnisharp through LSP support (requires omnisharp).
|
||||
+ =+unity= Enables special support for the [[https://unity.com/][Unity game engine]] (particularly,
|
||||
support for HLSL shaders).
|
||||
|
||||
** Plugins
|
||||
+ [[https://github.com/josteink/csharp-mode][csharp-mode]]
|
||||
+ [[https://github.com/OmniSharp/omnisharp-emacs][omnisharp]]* (not =+lsp=)
|
||||
+ [[https://github.com/midnightSuyama/shader-mode][shader-mode]]* (=+unity=)
|
||||
|
||||
* Prerequisites
|
||||
This module needs:
|
||||
|
||||
+ omnisharp-roslyn (install with ~M-x omnisharp-install-server~)
|
||||
+ omnisharp (with the ~+lsp~ flag, this must be installed externally. Without
|
||||
it, use ~M-x omnisharp-install-server~)
|
||||
+ .NET SDKs (on Windows)
|
||||
+ Mono (on UNIX platforms)
|
||||
|
||||
** MacOS
|
||||
=TODO=
|
||||
|
||||
** TODO MacOS
|
||||
** Arch Linux
|
||||
#+BEGIN_SRC sh :dir /sudo:: :tangle (if (doom-system-os 'arch) "yes")
|
||||
#+BEGIN_SRC sh
|
||||
sudo pacman --needed --noconfirm -S mono
|
||||
#+END_SRC
|
||||
** TODO NixOS
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
(after! csharp-mode
|
||||
(add-hook 'csharp-mode-hook #'rainbow-delimiters-mode)
|
||||
|
||||
(when (featurep! +lsp)
|
||||
(add-hook 'csharp-mode-local-vars-hook #'lsp!))
|
||||
|
||||
(set-electric! 'csharp-mode :chars '(?\n ?\}))
|
||||
(set-rotate-patterns! 'csharp-mode
|
||||
:symbols '(("public" "protected" "private")
|
||||
|
@ -13,6 +16,7 @@
|
|||
|
||||
|
||||
(use-package! omnisharp
|
||||
:unless (featurep! +lsp)
|
||||
:hook (csharp-mode . omnisharp-mode)
|
||||
:commands omnisharp-install-server
|
||||
:preface
|
||||
|
@ -56,9 +60,10 @@
|
|||
"b" #'omnisharp-unit-test-buffer)))
|
||||
|
||||
|
||||
;;;###package shader-mode
|
||||
(when (featurep! +unity)
|
||||
;; `shader-mode' --- unity shaders
|
||||
(add-to-list 'auto-mode-alist '("\\.shader$" . shader-mode))
|
||||
;; Unity shaders
|
||||
(add-to-list 'auto-mode-alist '("\\.shader\\'" . shader-mode))
|
||||
|
||||
(def-project-mode! +csharp-unity-mode
|
||||
:modes '(csharp-mode shader-mode)
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
;;; lang/csharp/packages.el
|
||||
|
||||
(package! csharp-mode)
|
||||
(package! omnisharp)
|
||||
|
||||
(unless (featurep! +lsp)
|
||||
(package! omnisharp))
|
||||
|
||||
(when (featurep! +unity)
|
||||
(package! shader-mode))
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
;;
|
||||
;;; Third-party plugins
|
||||
|
||||
;; `csv-mode'
|
||||
;;;###package csv-mode
|
||||
(map! :after csv-mode
|
||||
:localleader
|
||||
:map csv-mode-map
|
||||
|
@ -37,13 +37,12 @@
|
|||
:config
|
||||
(set-electric! 'json-mode :chars '(?\n ?: ?{ ?})))
|
||||
|
||||
(use-package! jsonnet-mode
|
||||
:defer t
|
||||
:config
|
||||
(after! jsonnet-mode
|
||||
(set-electric! 'jsonnet-mode :chars '(?\n ?: ?{ ?})))
|
||||
|
||||
|
||||
;;
|
||||
;; Frameworks
|
||||
;;; Frameworks
|
||||
|
||||
(def-project-mode! +data-vagrant-mode
|
||||
:files ("Vagrantfile"))
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
- [[#with-asdf][With ~asdf~]]
|
||||
- [[#arch-linux][Arch Linux]]
|
||||
- [[#gentoo-linux][Gentoo Linux]]
|
||||
- [[#opensuse][openSUSE]]
|
||||
- [[#features][Features]]
|
||||
|
||||
* Description
|
||||
|
@ -47,6 +48,11 @@ sudo pacman -S elixir
|
|||
#+BEGIN_SRC sh :dir /sudo::
|
||||
sudo emerge -v dev-lang/elixir
|
||||
#+END_SRC
|
||||
|
||||
*** openSUSE
|
||||
#+BEGIN_SRC sh :dir /sudo::
|
||||
sudo zypper install elixir
|
||||
#+END_SRC
|
||||
* Features
|
||||
- Code completion (~:completion company~)
|
||||
- Documentation lookup (~:tools lookup~)
|
||||
|
|
|
@ -32,18 +32,6 @@
|
|||
(when (featurep! +lsp)
|
||||
(add-hook 'elixir-mode-local-vars-hook #'lsp!))
|
||||
|
||||
(use-package! alchemist-company
|
||||
:when (featurep! :completion company)
|
||||
: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)))
|
||||
|
||||
(use-package! flycheck-credo
|
||||
:when (featurep! :tools flycheck)
|
||||
:config (flycheck-credo-setup)))
|
||||
|
@ -51,9 +39,24 @@
|
|||
|
||||
(use-package! alchemist
|
||||
:hook (elixir-mode . alchemist-mode)
|
||||
:init
|
||||
(after! elixir-mode
|
||||
(set-lookup-handlers! 'elixir-mode
|
||||
:definition #'alchemist-goto-definition-at-point
|
||||
:documentation #'alchemist-help-search-at-point)
|
||||
(set-eval-handler! 'elixir-mode #'alchemist-eval-region)
|
||||
(set-repl-handler! 'elixir-mode #'alchemist-iex-project-run)))
|
||||
|
||||
|
||||
(use-package! alchemist-company
|
||||
:when (featurep! :completion company)
|
||||
:commands alchemist-company
|
||||
:init
|
||||
(after! elixir-mode
|
||||
(set-company-backend! 'elixir-mode '(alchemist-company company-yasnippet)))
|
||||
:config
|
||||
(set-lookup-handlers! 'elixir-mode
|
||||
:definition #'alchemist-goto-definition-at-point
|
||||
:documentation #'alchemist-help-search-at-point)
|
||||
(set-eval-handler! 'elixir-mode #'alchemist-eval-region)
|
||||
(set-repl-handler! 'elixir-mode #'alchemist-iex-project-run))
|
||||
;; 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)))
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
;;; lang/elm/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; `elm-mode'
|
||||
(setq elm-format-on-save t)
|
||||
|
||||
(after! elm-mode
|
||||
(add-hook 'elm-mode-hook #'rainbow-delimiters-mode)
|
||||
|
||||
|
|
|
@ -135,7 +135,7 @@ if it's callable, `apropos' otherwise."
|
|||
`(("Section" "^[ \t]*;;;;*[ \t]+\\([^\n]+\\)" 1)
|
||||
("Evil commands" "^\\s-*(evil-define-\\(?:command\\|operator\\|motion\\) +\\(\\_<[^ ()\n]+\\_>\\)" 1)
|
||||
("Unit tests" "^\\s-*(\\(?:ert-deftest\\|describe\\) +\"\\([^\")]+\\)\"" 1)
|
||||
("Package" "^\\s-*(\\(?:;;;###package\\|def-package!\\|package!\\|use-package\\|after!\\) +\\(\\_<[^ ()\n]+\\_>\\)" 1)
|
||||
("Package" "^\\s-*(\\(?:;;;###package\\|package!\\|use-package!?\\|after!\\) +\\(\\_<[^ ()\n]+\\_>\\)" 1)
|
||||
("Major modes" "^\\s-*(define-derived-mode +\\([^ ()\n]+\\)" 1)
|
||||
("Minor modes" "^\\s-*(define-\\(?:global\\(?:ized\\)?-minor\\|generic\\|minor\\)-mode +\\([^ ()\n]+\\)" 1)
|
||||
("Modelines" "^\\s-*(def-modeline! +\\([^ ()\n]+\\)" 1)
|
||||
|
@ -174,3 +174,15 @@ verbosity when editing a file in `doom-private-dir' or `doom-emacs-dir'."
|
|||
" "
|
||||
(default-value 'flycheck-emacs-lisp-check-form)
|
||||
")"))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +emacs-lisp/edebug-instrument-defun-on ()
|
||||
"Toggle on instrumentalisation for the function under `defun'."
|
||||
(interactive)
|
||||
(eval-defun 'edebugit))
|
||||
|
||||
;;;###autoload
|
||||
(defun +emacs-lisp/edebug-instrument-defun-off ()
|
||||
"Toggle off instrumentalisation for the function under `defun'."
|
||||
(interactive)
|
||||
(eval-defun nil))
|
||||
|
|
|
@ -77,8 +77,10 @@ This marks a foldable marker for `outline-minor-mode' in elisp buffers.")
|
|||
|
||||
(map! :localleader
|
||||
:map emacs-lisp-mode-map
|
||||
"e" #'macrostep-expand))
|
||||
|
||||
"e" #'macrostep-expand
|
||||
(:prefix ("d" . "debug")
|
||||
("f" #'+emacs-lisp/edebug-instrument-defun-on)
|
||||
("F" #'+emacs-lisp/edebug-instrument-defun-off))))
|
||||
|
||||
;;
|
||||
;;; Packages
|
||||
|
@ -112,8 +114,20 @@ This marks a foldable marker for `outline-minor-mode' in elisp buffers.")
|
|||
"Add Doom's own demos to help buffers."
|
||||
:around #'elisp-demos--search
|
||||
(or (funcall orig-fn symbol)
|
||||
(when-let* ((elisp-demos--elisp-demos.org (doom-glob doom-docs-dir "api.org")))
|
||||
(funcall orig-fn symbol)))))
|
||||
(when-let (demos-file (doom-glob doom-docs-dir "api.org"))
|
||||
(with-temp-buffer
|
||||
(insert-file-contents demos-file)
|
||||
(goto-char (point-min))
|
||||
(when (re-search-forward
|
||||
(format "^\\*\\*\\* %s$" (regexp-quote (symbol-name symbol)))
|
||||
nil t)
|
||||
(let (beg end)
|
||||
(forward-line 1)
|
||||
(setq beg (point))
|
||||
(if (re-search-forward "^\\*" nil t)
|
||||
(setq end (line-beginning-position))
|
||||
(setq end (point-max)))
|
||||
(string-trim (buffer-substring-no-properties beg end)))))))))
|
||||
|
||||
|
||||
(use-package! buttercup
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
;;; lang/erlang/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(use-package! erlang
|
||||
:mode ("\\.erlang$" . erlang-mode)
|
||||
:mode ("/rebar\\.config\\(?:\\.script\\)?$" . erlang-mode)
|
||||
:mode ("/\\(?:app\\|sys\\)\\.config$" . erlang-mode))
|
||||
:mode ("\\.erlang\\'" . erlang-mode)
|
||||
:mode ("/rebar\\.config\\(?:\\.script\\)?\\'" . erlang-mode)
|
||||
:mode ("/\\(?:app\\|sys\\)\\.config\\'" . erlang-mode))
|
||||
|
||||
|
||||
(use-package! flycheck-rebar3
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
;;; lang/ess/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(use-package! ess
|
||||
:commands (stata SAS)
|
||||
:commands stata SAS
|
||||
:init
|
||||
(setq ess-smart-S-assign-key nil)
|
||||
(unless (featurep! :lang julia)
|
||||
|
|
|
@ -4,15 +4,15 @@
|
|||
#+STARTUP: inlineimages
|
||||
|
||||
* Table of Contents :TOC:
|
||||
- [[Description][Description]]
|
||||
- [[Module Flags][Module Flags]]
|
||||
- [[Plugins][Plugins]]
|
||||
- [[Prerequisites][Prerequisites]]
|
||||
- [[Go][Go]]
|
||||
- [[Dependencies][Dependencies]]
|
||||
- [[Features][Features]]
|
||||
- [[Configuration][Configuration]]
|
||||
- [[Troubleshooting][Troubleshooting]]
|
||||
- [[#description][Description]]
|
||||
- [[#module-flags][Module Flags]]
|
||||
- [[#plugins][Plugins]]
|
||||
- [[#prerequisites][Prerequisites]]
|
||||
- [[#go][Go]]
|
||||
- [[#dependencies][Dependencies]]
|
||||
- [[#features][Features]]
|
||||
- [[#configuration][Configuration]]
|
||||
- [[#troubleshooting][Troubleshooting]]
|
||||
|
||||
* Description
|
||||
This module adds [[https://golang.org][Go]] support.
|
||||
|
@ -35,6 +35,7 @@ This module provides no flags.
|
|||
+ [[https://github.com/syohex/emacs-go-eldoc][go-eldoc]]
|
||||
+ [[https://github.com/dominikh/go-mode.el][go-guru]]
|
||||
+ [[https://github.com/manute/gorepl-mode][gorepl-mode]]
|
||||
+ [[https://github.com/syohex/emacs-go-add-tags][go-add-tags]]
|
||||
+ [[https://github.com/mdempsky/gocode][company-go]]*
|
||||
|
||||
* Prerequisites
|
||||
|
@ -51,6 +52,11 @@ brew install go
|
|||
sudo pacman -S go
|
||||
#+END_SRC
|
||||
|
||||
*** openSUSE
|
||||
#+BEGIN_SRC sh :dir /sudo::
|
||||
sudo zypper install go
|
||||
#+END_SRC
|
||||
|
||||
** Dependencies
|
||||
This module requires a valid ~GOPATH~, and the following Go packages:
|
||||
|
||||
|
|
|
@ -6,17 +6,21 @@
|
|||
(defvar +go-test-last nil
|
||||
"The last test run.")
|
||||
|
||||
(defun +go--run-tests (args)
|
||||
(require 'async)
|
||||
(defun +go--spawn (cmd)
|
||||
(save-selected-window
|
||||
(async-shell-command (concat "go test " args))))
|
||||
(compile cmd)))
|
||||
|
||||
(defun +go--run-tests (args)
|
||||
(let ((cmd (concat "go test " args)))
|
||||
(setq +go-test-last (concat "cd " default-directory ";" cmd))
|
||||
(+go--spawn cmd)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +go/test-rerun ()
|
||||
(interactive)
|
||||
(if +go-test-last
|
||||
(funcall +go-test-last)
|
||||
(+go/run-all-tests)))
|
||||
(+go--spawn +go-test-last)
|
||||
(+go/test-all)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +go/test-all ()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
;;; lang/go/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;
|
||||
;; Packages
|
||||
;;; Packages
|
||||
|
||||
(after! go-mode
|
||||
(set-docsets! 'go-mode "Go")
|
||||
|
@ -25,6 +25,7 @@
|
|||
|
||||
(map! :map go-mode-map
|
||||
:localleader
|
||||
"a" #'go-add-tags
|
||||
"e" #'+go/play-buffer-or-region
|
||||
"i" #'go-goto-imports ; Go to imports
|
||||
(:prefix ("h" . "help")
|
||||
|
@ -58,8 +59,8 @@
|
|||
|
||||
|
||||
(use-package! company-go
|
||||
:when (and (featurep! :completion company)
|
||||
(not (featurep! +lsp)))
|
||||
:when (featurep! :completion company)
|
||||
:unless (featurep! +lsp)
|
||||
:after go-mode
|
||||
:config
|
||||
(set-company-backend! 'go-mode 'company-go)
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
(package! go-guru)
|
||||
(package! go-mode)
|
||||
(package! gorepl-mode)
|
||||
(package! go-add-tags)
|
||||
|
||||
(when (featurep! :completion company)
|
||||
(package! company-go))
|
||||
|
|
|
@ -72,7 +72,6 @@ To use Intero, you need =stack=:
|
|||
brew install haskell-stack
|
||||
stack setup
|
||||
#+END_SRC
|
||||
|
||||
*** Arch Linux
|
||||
#+BEGIN_SRC sh
|
||||
sudo pacman -S stack
|
||||
|
@ -81,6 +80,12 @@ pacaur -S ncurses5-compat-lib
|
|||
stack setup
|
||||
#+END_SRC
|
||||
|
||||
*** openSUSE
|
||||
#+BEGIN_SRC sh :dir /sudo::
|
||||
sudo zypper install stack
|
||||
stack setup
|
||||
#+END_SRC
|
||||
|
||||
** Cabal
|
||||
To use Dante, you need =cabal= (the haskell package builder) and =ghci= (the
|
||||
compiler, syntax checker & repl):
|
||||
|
@ -95,6 +100,11 @@ brew install cabal-install ghc
|
|||
sudo pacman -S cabal-install ghc
|
||||
#+END_SRC
|
||||
|
||||
*** openSUSE
|
||||
#+BEGIN_SRC sh :dir /sudo::
|
||||
sudo zypper install cabal-install ghc
|
||||
#+END_SRC
|
||||
|
||||
** LSP
|
||||
You will need =stack= and =git= installed.
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
- [[#prerequisites][Prerequisites]]
|
||||
- [[#macos][MacOS]]
|
||||
- [[#arch-linux][Arch Linux]]
|
||||
- [[#opensuse][openSUSE]]
|
||||
- [[#appendix][Appendix]]
|
||||
- [[#commands][Commands]]
|
||||
|
||||
|
@ -56,6 +57,11 @@ brew install node
|
|||
sudo pacman --needed --noconfirm -S nodejs npm
|
||||
#+END_SRC
|
||||
|
||||
** openSUSE
|
||||
#+BEGIN_SRC sh :dir /sudo::
|
||||
sudo zypper install nodejs npm
|
||||
#+END_SRC
|
||||
|
||||
* Appendix
|
||||
** Commands
|
||||
*** JS2-mode
|
||||
|
|
|
@ -145,8 +145,7 @@ to tide."
|
|||
;; necessary because `tide-setup' and `lsp' will error if not a
|
||||
;; file-visiting buffer
|
||||
(add-hook 'after-save-hook #'+javascript-init-tide-or-lsp-maybe-h nil 'local)
|
||||
(or (and (featurep! +lsp)
|
||||
(progn (lsp!) lsp-mode))
|
||||
(or (and (featurep! +lsp) (lsp!))
|
||||
;; fall back to tide
|
||||
(if (executable-find "node")
|
||||
(and (require 'tide nil t)
|
||||
|
@ -238,7 +237,7 @@ to tide."
|
|||
|
||||
|
||||
;;;###package npm-mode
|
||||
(use-package npm-mode
|
||||
(use-package! npm-mode
|
||||
:hook ((js-mode typescript-mode) . npm-mode)
|
||||
:config
|
||||
(map! :localleader
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
;;; lang/julia/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(use-package julia-mode
|
||||
(use-package! julia-mode
|
||||
:interpreter "julia"
|
||||
:config
|
||||
(set-repl-handler! 'julia-mode #'+julia/repl)
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
:desc "gradlew build" "b" (λ! (+kotlin/run-gradlew "build"))
|
||||
:desc "gradlew test" "t" (λ! (+kotlin/run-gradlew "test"))))
|
||||
|
||||
|
||||
(use-package! flycheck-kotlin
|
||||
:when (featurep! :tools flycheck)
|
||||
:after kotlin-mode
|
||||
:config (add-hook 'kotlin-mode-hook #'flycheck-kotlin-setup))
|
||||
:hook (kotlin-mode . flycheck-kotlin-setup))
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
(add-to-list 'TeX-view-program-selection '(output-pdf "preview-pane") 'append)
|
||||
(add-to-list 'TeX-view-program-list '("preview-pane" latex-preview-pane-mode))
|
||||
|
||||
(dolist (viewer +latex-viewers)
|
||||
(dolist (viewer (reverse +latex-viewers))
|
||||
(pcase viewer
|
||||
(`skim
|
||||
(when (and IS-MAC
|
||||
|
@ -39,7 +39,7 @@
|
|||
;; PDF Tools isn't in `TeX-view-program-list-builtin' on macs
|
||||
(add-to-list 'TeX-view-program-list '("PDF Tools" TeX-pdf-tools-sync-view)))
|
||||
;; Update PDF buffers after successful LaTeX runs
|
||||
(add-hook 'TeX-after-compilation-finished-function #'TeX-revert-document-buffer)))))
|
||||
(add-hook 'TeX-after-compilation-finished-functions #'TeX-revert-document-buffer)))))
|
||||
|
||||
|
||||
(after! latex-preview-pane
|
||||
|
|
|
@ -4,13 +4,13 @@
|
|||
#+STARTUP: inlineimages
|
||||
|
||||
* Table of Contents :TOC_3:noexport:
|
||||
- [[Description][Description]]
|
||||
- [[Module Flags][Module Flags]]
|
||||
- [[Plugins][Plugins]]
|
||||
- [[Features][Features]]
|
||||
- [[Customization][Customization]]
|
||||
- [[Specifying the location of a bibtex file & corresponding PDFs][Specifying the location of a bibtex file & corresponding PDFs]]
|
||||
- [[Changing the PDFs viewer][Changing the PDFs viewer]]
|
||||
- [[#description][Description]]
|
||||
- [[#module-flags][Module Flags]]
|
||||
- [[#plugins][Plugins]]
|
||||
- [[#features][Features]]
|
||||
- [[#customization][Customization]]
|
||||
- [[#specifying-the-location-of-a-bibtex-file--corresponding-pdfs][Specifying the location of a bibtex file & corresponding PDFs]]
|
||||
- [[#changing-the-pdfs-viewer][Changing the PDFs viewer]]
|
||||
|
||||
* Description
|
||||
Provide a helping hand when working with LaTeX documents.
|
||||
|
@ -56,8 +56,10 @@ PDFs:
|
|||
This module provides integration for four supported pdf viewers. They are
|
||||
|
||||
+ [[https://skim-app.sourceforge.io/][Skim.app]] (MacOS only)
|
||||
+ Okular
|
||||
+ Evince
|
||||
+ Sumatra PDF
|
||||
+ Zathura
|
||||
+ Okular
|
||||
+ pdf-tools (requires =:tools pdf= module)
|
||||
|
||||
They are searched for in this order. See ~+latex-viewers~ to change the order,
|
||||
|
|
|
@ -13,8 +13,8 @@ package to be installed.")
|
|||
|
||||
(defvar +latex-viewers '(skim evince sumatrapdf zathura okular pdf-tools)
|
||||
"A list of enabled latex viewers to use, in this order. If they don't exist,
|
||||
they will be ignored. Recognized viewers are skim, zathura, okular and
|
||||
pdf-tools.
|
||||
they will be ignored. Recognized viewers are skim, evince, sumatrapdf, zathura,
|
||||
okular and pdf-tools.
|
||||
|
||||
If no viewers are found, `latex-preview-pane' is used.")
|
||||
|
||||
|
@ -25,7 +25,7 @@ If no viewers are found, `latex-preview-pane' is used.")
|
|||
;;
|
||||
;; Packages
|
||||
|
||||
(add-to-list 'auto-mode-alist '("\\.tex\\'" . TeX-latex-mode))
|
||||
(add-to-list 'auto-mode-alist '("\\.tex\\'" . LaTeX-mode))
|
||||
|
||||
|
||||
(after! tex
|
||||
|
@ -66,10 +66,10 @@ If no viewers are found, `latex-preview-pane' is used.")
|
|||
(cl-find-if #'byte-code-function-p find-file-hook)
|
||||
'local))
|
||||
(add-hook 'latex-mode-local-vars-hook #'flyspell-mode!)
|
||||
;; All these excess pairs dramatically slow down typing in latex buffers, so
|
||||
;; we remove them. Let snippets do their job.
|
||||
(after! smartparens-latex
|
||||
(let ((modes '(tex-mode plain-tex-mode latex-mode LaTeX-mode)))
|
||||
;; All these excess pairs dramatically slow down typing in latex buffers,
|
||||
;; so we remove them. Let snippets do their job.
|
||||
(dolist (open '("\\left(" "\\left[" "\\left\\{" "\\left|"
|
||||
"\\bigl(" "\\biggl(" "\\Bigl(" "\\Biggl(" "\\bigl["
|
||||
"\\biggl[" "\\Bigl[" "\\Biggl[" "\\bigl\\{" "\\biggl\\{"
|
||||
|
@ -77,6 +77,8 @@ If no viewers are found, `latex-preview-pane' is used.")
|
|||
"\\lfloor" "\\lceil" "\\langle"
|
||||
"\\lVert" "\\lvert" "`"))
|
||||
(sp-local-pair modes open nil :actions :rem))
|
||||
;; And tweak these so that users can decide whether they want use latex
|
||||
;; quotes or not, via `+latex-enable-plain-double-quotes'
|
||||
(sp-local-pair modes "``" nil :unless '(:add sp-in-math-p)))))
|
||||
|
||||
|
||||
|
|
36
modules/lang/lean/config.el
Normal file
36
modules/lang/lean/config.el
Normal file
|
@ -0,0 +1,36 @@
|
|||
;;; lang/lean/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(after! lean-mode
|
||||
(set-lookup-handlers! 'lean-mode
|
||||
:definition #'lean-find-definition)
|
||||
(sp-with-modes 'lean-mode
|
||||
(sp-local-pair "/-" "-/")
|
||||
(sp-local-pair "`" "`")
|
||||
(sp-local-pair "{" "}")
|
||||
(sp-local-pair "«" "»")
|
||||
(sp-local-pair "⟨" "⟩")
|
||||
(sp-local-pair "⟪" "⟫"))
|
||||
(map! :map lean-mode-map
|
||||
:localleader
|
||||
"g" #'lean-toggle-show-goal
|
||||
"n" #'lean-toggle-next-error
|
||||
(:prefix ("s" . "server")
|
||||
"r" #'lean-server-restart
|
||||
"s" #'lean-server-stop
|
||||
"v" #'lean-server-switch-version)
|
||||
(:prefix ("p" . "leanpkg")
|
||||
"t" #'lean-leanpkg-test
|
||||
"b" #'lean-leanpkg-build
|
||||
"c" #'lean-leanpkg-configure)
|
||||
"f" #'lean-fill-placeholder
|
||||
"h" #'lean-hole
|
||||
"m" #'lean-message-boxes-toggle
|
||||
"e" #'lean-execute))
|
||||
|
||||
|
||||
(use-package! company-lean
|
||||
:init
|
||||
(advice-add #'company-lean-hook :override #'ignore)
|
||||
(set-company-backend! 'lean-mode 'company-lean)
|
||||
:when (featurep! :completion company)
|
||||
:after lean-mode)
|
7
modules/lang/lean/packages.el
Normal file
7
modules/lang/lean/packages.el
Normal file
|
@ -0,0 +1,7 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/lean/packages.el
|
||||
|
||||
(package! lean-mode)
|
||||
|
||||
(when (featurep! :completion company)
|
||||
(package! company-lean))
|
|
@ -1,14 +1,14 @@
|
|||
;;; lang/ledger/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; `ledger-mode'
|
||||
;;;###package ledger-mode
|
||||
(setq ledger-clear-whole-transactions 1)
|
||||
|
||||
(defun +ledger*check-version (orig-fn)
|
||||
(defadvice! +ledger--check-version-a (orig-fn)
|
||||
"Fail gracefully if ledger binary isn't available."
|
||||
:around #'ledger-check-version
|
||||
(if (executable-find ledger-binary-path)
|
||||
(funcall orig-fn)
|
||||
(message "Couldn't find '%s' executable" ledger-binary-path)))
|
||||
(advice-add #'ledger-check-version :around #'+ledger*check-version)
|
||||
|
||||
;; Restore leader key in ledger reports
|
||||
(map! :after ledger-mode
|
||||
|
@ -51,7 +51,8 @@
|
|||
(:prefix "g"
|
||||
"s" #'ledger-display-ledger-stats
|
||||
"b" #'ledger-display-balance-at-point))
|
||||
;; Fix inaccurate keybind message
|
||||
(defun +ledger*fix-key-help (&rest _)
|
||||
(message "q to quit; gr to redo; RET to edit; C-c C-s to save"))
|
||||
(advice-add #'ledger-report :after #'+ledger*fix-key-help))
|
||||
|
||||
(defadvice! +ledger--fix-key-help-a (&rest _)
|
||||
"Fix inaccurate keybind message."
|
||||
:after #'ledger-report
|
||||
(message "q to quit; gr to redo; RET to edit; C-c C-s to save")))
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
;;;###if (featurep! +moonscript)
|
||||
|
||||
;;;###autoload
|
||||
(defun +lua|moonscript-fix-single-quotes ()
|
||||
(defun +lua-moonscript-fix-single-quotes-h ()
|
||||
"Single-quoted strings aren't treated as strings."
|
||||
;; (modify-syntax-entry ?\" "\"" moonscript-mode-syntax-table)
|
||||
(modify-syntax-entry ?\' "\"" moonscript-mode-syntax-table))
|
||||
|
||||
;;;###autoload
|
||||
(defun +lua|moonscript-fontify-interpolation ()
|
||||
(defun +lua-moonscript-fontify-interpolation-h ()
|
||||
"Highlight interpolated expressions in moonscript strings."
|
||||
(font-lock-add-keywords
|
||||
nil '(("#{\\([^}]+\\)}"
|
||||
|
|
|
@ -26,8 +26,10 @@
|
|||
(setq-hook! 'moonscript-mode-hook
|
||||
moonscript-indent-offset tab-width)
|
||||
(add-hook! 'moonscript-mode-hook
|
||||
#'+lua|moonscript-fix-single-quotes
|
||||
#'+lua|moonscript-fontify-interpolation))
|
||||
#'+lua-moonscript-fix-single-quotes-h
|
||||
#'+lua-moonscript-fontify-interpolation-h)
|
||||
(when (featurep! :tools flycheck)
|
||||
(require 'flycheck-moonscript nil t)))
|
||||
|
||||
|
||||
;;
|
||||
|
|
|
@ -2,7 +2,12 @@
|
|||
;;; lang/lua/packages.el
|
||||
|
||||
(package! lua-mode)
|
||||
(package! moonscript)
|
||||
|
||||
(when (featurep! +moonscript)
|
||||
(package! moonscript)
|
||||
(when (featurep! :tools flycheck)
|
||||
(package! flycheck-moonscript
|
||||
:recipe (:host github :repo "hlissner/emacs-flycheck-moonscript"))))
|
||||
|
||||
(when (featurep! :completion company)
|
||||
(package! company-lua))
|
||||
|
|
|
@ -36,10 +36,7 @@ otherwise throws an error."
|
|||
Returns its exit code."
|
||||
(when (executable-find "marked")
|
||||
(apply #'call-process-region
|
||||
beg end
|
||||
shell-file-name nil output-buffer nil
|
||||
shell-command-switch
|
||||
"marked"
|
||||
beg end "marked" nil output-buffer nil
|
||||
(when (eq major-mode 'gfm-mode)
|
||||
(list "--gfm" "--tables" "--breaks")))))
|
||||
|
||||
|
@ -48,21 +45,18 @@ Returns its exit code."
|
|||
"Compiles markdown with the pandoc program, if available.
|
||||
Returns its exit code."
|
||||
(when (executable-find "pandoc")
|
||||
(call-process-region beg end
|
||||
shell-file-name nil output-buffer nil
|
||||
shell-command-switch
|
||||
"pandoc" "-f" "markdown" "-t" "html"
|
||||
"--standalone" "--mathjax" "--highlight-style=pygments")))
|
||||
(call-process-region beg end "pandoc" nil output-buffer nil
|
||||
"-f" "markdown"
|
||||
"-t" "html"
|
||||
"--mathjax"
|
||||
"--highlight-style=pygments")))
|
||||
|
||||
;;;###autoload
|
||||
(defun +markdown-compile-multimarkdown (beg end output-buffer)
|
||||
"Compiles markdown with the multimarkdown program, if available. Returns its
|
||||
exit code."
|
||||
(when (executable-find "multimarkdown")
|
||||
(call-process-region beg end
|
||||
shell-file-name nil output-buffer nil
|
||||
shell-command-switch
|
||||
"multimarkdown")))
|
||||
(call-process-region beg end "multimarkdown" nil output-buffer)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +markdown-compile-markdown (beg end output-buffer)
|
||||
|
@ -70,10 +64,7 @@ exit code."
|
|||
available. Returns its exit code."
|
||||
(when-let (exe (or (executable-find "Markdown.pl")
|
||||
(executable-find "markdown")))
|
||||
(call-process-region beg end
|
||||
shell-file-name nil output-buffer nil
|
||||
shell-command-switch
|
||||
exe)))
|
||||
(call-process-region beg end exe nil output-buffer nil)))
|
||||
|
||||
;;
|
||||
;;; Commands
|
||||
|
|
|
@ -38,6 +38,7 @@ capture, the end position, and the output buffer.")
|
|||
(set-lookup-handlers! '(markdown-mode gfm-mode)
|
||||
:file #'markdown-follow-thing-at-point)
|
||||
|
||||
;; Enable hard-wrapping. By convention, Doom does this for all textual modes.
|
||||
(add-hook 'markdown-mode-hook #'auto-fill-mode)
|
||||
|
||||
;; Prevent mis-fontification of YAML metadata blocks in `markdown-mode' which
|
||||
|
|
|
@ -11,10 +11,10 @@ This module adds [[https://nim-lang.org][Nim]] support to Emacs.
|
|||
+ Babel support (~ob-nim~)
|
||||
|
||||
* Table of Contents :TOC:
|
||||
- [[Module Flags][Module Flags]]
|
||||
- [[Prerequisites][Prerequisites]]
|
||||
- [[Nim][Nim]]
|
||||
- [[Configuration][Configuration]]
|
||||
- [[#module-flags][Module Flags]]
|
||||
- [[#prerequisites][Prerequisites]]
|
||||
- [[#nim][Nim]]
|
||||
- [[#configuration][Configuration]]
|
||||
|
||||
* Module Flags
|
||||
This module provides no flags.
|
||||
|
@ -44,4 +44,9 @@ brew install nim
|
|||
sudo pacman --needed --noconfirm -S nim nimble
|
||||
#+END_SRC
|
||||
|
||||
*** openSUSE
|
||||
#+BEGIN_SRC sh :dir /sudo::
|
||||
sudo zypper install nim
|
||||
#+END_SRC
|
||||
|
||||
* Configuration
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
;;; lang/nim/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(after! nim-mode
|
||||
(defun +nim|init-nimsuggest-mode ()
|
||||
"Conditionally load `nimsuggest-mode', instead of clumsily erroring out if
|
||||
(add-hook! 'nim-mode-hook
|
||||
(defun +nim-init-nimsuggest-mode-h ()
|
||||
"Conditionally load `nimsuggest-mode', instead of clumsily erroring out if
|
||||
nimsuggest isn't installed."
|
||||
(unless (stringp nimsuggest-path)
|
||||
(setq nimsuggest-path (executable-find "nimsuggest")))
|
||||
(when (and nimsuggest-path (file-executable-p nimsuggest-path))
|
||||
(nimsuggest-mode)))
|
||||
(add-hook 'nim-mode-hook #'+nim|init-nimsuggest-mode)
|
||||
(unless (stringp nimsuggest-path)
|
||||
(setq nimsuggest-path (executable-find "nimsuggest")))
|
||||
(when (and nimsuggest-path (file-executable-p nimsuggest-path))
|
||||
(nimsuggest-mode))))
|
||||
|
||||
(when IS-WINDOWS
|
||||
;; TODO File PR/report upstream (https://github.com/nim-lang/nim-mode)
|
||||
|
|
41
modules/lang/nix/autoload.el
Normal file
41
modules/lang/nix/autoload.el
Normal file
|
@ -0,0 +1,41 @@
|
|||
;;; lang/nix/autoload.el -*- lexical-binding: t; -*-
|
||||
|
||||
(defun +nix--options-action (candidate)
|
||||
(switch-to-buffer-other-window
|
||||
(nixos-options-doc-buffer
|
||||
(nixos-options-get-documentation-for-option candidate))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +nix/lookup-option (&optional initial-input)
|
||||
"Look up documentation on a nix option."
|
||||
(interactive
|
||||
(list
|
||||
;; REVIEW Must be a better way to do this
|
||||
(when (and (looking-at-p "[a-zA-Z0-9-_\\.]")
|
||||
(not (doom-point-in-string-or-comment-p)))
|
||||
(buffer-substring-no-properties
|
||||
(save-excursion
|
||||
(skip-chars-backward "^ ")
|
||||
(point))
|
||||
(save-excursion
|
||||
(skip-chars-forward "^ ")
|
||||
(point))))))
|
||||
(cond ((featurep! :completion helm)
|
||||
(require 'helm-nixos-options)
|
||||
;; REVIEW We reimplment `helm-nixos-options' so we can supply
|
||||
;; `initial-input'. Maybe use `helm-attrset' instead?
|
||||
(helm :sources `(,(helm-source-nixos-options-search))
|
||||
:buffer "*helm-nixos-options*"
|
||||
:input initial-input))
|
||||
((featurep! :completion ivy)
|
||||
(require 'nixos-options)
|
||||
(ivy-read "NixOS options: "
|
||||
nixos-options
|
||||
:require-match t
|
||||
:initial-input initial-input
|
||||
:action #'+nix--options-action
|
||||
:caller '+nix/options))
|
||||
;; TODO Add general `completing-read' support
|
||||
((user-error "No search engine is enabled. Enable helm or ivy!")))
|
||||
;; Tell lookup module to let us handle things from here
|
||||
'deferred)
|
|
@ -4,6 +4,8 @@
|
|||
:mode "\\.nix\\'"
|
||||
:config
|
||||
(set-company-backend! 'nix-mode 'company-nixos-options)
|
||||
(set-lookup-handlers! 'nix-mode
|
||||
:documentation '(+nix/lookup-option :async t))
|
||||
|
||||
(map! :localleader
|
||||
:map nix-mode-map
|
||||
|
@ -13,8 +15,7 @@
|
|||
"s" #'nix-shell
|
||||
"b" #'nix-build
|
||||
"u" #'nix-unpack
|
||||
(:when (featurep! :completion helm)
|
||||
"o" #'helm-nixos-options)))
|
||||
"o" #'+nix/lookup-option))
|
||||
|
||||
(use-package! nix-drv-mode
|
||||
:mode "\\.drv\\'")
|
||||
|
|
|
@ -1,8 +1,23 @@
|
|||
#+TITLE: :lang ocaml
|
||||
#+TITLE: lang/ocaml
|
||||
#+DATE: June 27, 2017
|
||||
#+SINCE: v2.0.3
|
||||
|
||||
This module adds [[https://ocaml.org/][OCaml]] support, powered by [[https://github.com/ocaml/tuareg][tuareg-mode]].
|
||||
* Table of Contents :TOC:
|
||||
- [[#description][Description]]
|
||||
- [[#module-flags][Module Flags]]
|
||||
- [[#plugins][Plugins]]
|
||||
- [[#prerequisites][Prerequisites]]
|
||||
- [[#features][Features]]
|
||||
- [[#configuration][Configuration]]
|
||||
- [[#appendix][Appendix]]
|
||||
- [[#commands][Commands]]
|
||||
- [[#hacks][Hacks]]
|
||||
|
||||
+ Code completion, documentation look-up, code navigation and refactoring ([[https://github.com/ocaml/merlin/wiki/emacs-from-scratch][merlin]])
|
||||
* Description
|
||||
This module adds [[https://ocaml.org/][OCaml]] support to Doom Emacs, powered by [[https://github.com/ocaml/tuareg][tuareg-mode]].
|
||||
|
||||
+ Code completion, documentation look-up, code navigation and refactoring
|
||||
([[https://github.com/ocaml/merlin/wiki/emacs-from-scratch][merlin]])
|
||||
+ Type, documentation and function argument display on idle ([[https://github.com/Khady/merlin-eldoc][merlin-eldoc]])
|
||||
+ REPL ([[https://github.com/ocaml-community/utop][utop]])
|
||||
+ Syntax-checking (~merlin~ with [[https://github.com/flycheck/flycheck-ocaml][flycheck-ocaml]])
|
||||
|
@ -10,75 +25,66 @@ This module adds [[https://ocaml.org/][OCaml]] support, powered by [[https://gi
|
|||
+ Code formatting ([[https://github.com/ocaml-ppx/ocamlformat][ocamlformat]])
|
||||
+ Dune file format ([[http://dune.build/][dune]])
|
||||
|
||||
* Table of Contents :TOC:
|
||||
- [[Module Flags][Module Flags]]
|
||||
- [[Prerequisites][Prerequisites]]
|
||||
- [[Features][Features]]
|
||||
- [[Configuration][Configuration]]
|
||||
- [[Appendix][Appendix]]
|
||||
- [[Commands][Commands]]
|
||||
- [[Hacks][Hacks]]
|
||||
** Module Flags
|
||||
This module provides no flags.
|
||||
|
||||
* Module Flags
|
||||
This module provides the ~+opam-site-lisp~ flag to compile editor support ~.el~
|
||||
files from opam's =site-lisp= directory.
|
||||
By default all editor plugins are installed from MELPA/GitHub even if the
|
||||
corresponding =opam= package isn't installed.
|
||||
If this flag is enabled then you must have all of the packages listed in
|
||||
=package.el= installed via =opam=.
|
||||
|
||||
To enable this, use:
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(doom! :lang (ocaml +opam-site-lisp))
|
||||
#+END_SRC
|
||||
** Plugins
|
||||
+ [[https://github.com/ocaml/tuareg][tuareg]]
|
||||
+ [[https://github.com/ocaml/merlin][merlin]]
|
||||
+ [[https://github.com/Khady/merlin-eldoc][merlin-eldoc]]
|
||||
+ [[https://github.com/OCamlPro/ocp-indent][ocp-indent]]
|
||||
+ [[https://github.com/flycheck/flycheck-ocaml][flycheck-ocaml]]*
|
||||
+ [[https://github.com/ocaml-community/utop][utop]]*
|
||||
+ [[https://github.com/ocaml-ppx/ocamlformat][ocamlformat]]*
|
||||
+ [[https://github.com/ocaml/dune][dune]]
|
||||
|
||||
* Prerequisites
|
||||
It is highly recommended to install [[http://opam.ocaml.org/][opam]].
|
||||
To get all the features you should also install these ~opam~ packages, however
|
||||
they are not all required (features should be disabled gracefully when a tool is
|
||||
missing):
|
||||
This module has no hard dependencies, but it is recommanded that you install
|
||||
[[http://opam.ocaml.org/][opam]] and the following opam (optional) packages:
|
||||
|
||||
#+BEGIN_SRC shell
|
||||
opam install merlin utop ocp-indent dune ocamlformat
|
||||
#+END_SRC
|
||||
|
||||
* Features
|
||||
+ the following files should have syntax highlighting support:
|
||||
~.ml{i,p,y,}~, ~.eliom{i,}~, ~jbuild~, ~dune~, ~opam~
|
||||
+ The following files should have syntax highlighting support: ~.ml{i,p,y,}~,
|
||||
~.eliom{i,}~, ~jbuild~, ~dune~, ~opam~
|
||||
+ =merlin-mode= is activated whenever a =.merlin= file is found (including in a
|
||||
parent directory) and =ocamlmerlin= executable is present
|
||||
+ line-based auto-indentation is provided by =ocp-indent= when installed
|
||||
+ Line-based auto-indentation is provided by =ocp-indent=, if it is available.
|
||||
|
||||
* Configuration
|
||||
+ if =:completion company= is enabled then autocomplete is provided by =merlin=
|
||||
+ when =:tools flycheck= is enabled then =flycheck-ocaml= is activated to do
|
||||
+ If =:completion company= is enabled then autocomplete is provided by =merlin=
|
||||
+ When =:tools flycheck= is enabled then =flycheck-ocaml= is activated to do
|
||||
on-the-fly syntax/type checking via =merlin=, otherwise this is only done when
|
||||
the file is saved.
|
||||
+ spell checking is activated in comments if =:tools flyspell= is active
|
||||
+ a REPL is provided if =utop= is installed and =:tools eval= is active
|
||||
+ if =:editor format= is enabled, the =ocamlformat= executable is available and
|
||||
+ Spell checking is activated in comments if =:tools flyspell= is active
|
||||
+ A REPL is provided if =utop= is installed and =:tools eval= is active
|
||||
+ If =:editor format= is enabled, the =ocamlformat= executable is available and
|
||||
there is an =.ocamlformat= file present then =format-all-buffer= is bound to
|
||||
=ocamlformat=, otherwise to =ocp-indent=
|
||||
+ if =:editor multiple-cursors= is enabled then identifiers can be refactored
|
||||
+ If =:editor multiple-cursors= is enabled then identifiers can be refactored
|
||||
with =v R= and multiple cursors (this correctly matches identifier occurrences
|
||||
according to scope, it is not purely a textual match)
|
||||
+ if =:emacs imenu= is enabled then top level symbols (modules, type, functions, etc.) can
|
||||
be looked up using =SPC / i=
|
||||
+ If =:emacs imenu= is enabled then top level symbols (modules, type, functions,
|
||||
etc.) can be looked up using =SPC / i=
|
||||
|
||||
Run =make install= to install all packages, and =make doctor= to diagnose missing tools.
|
||||
Run =bin/doom refresh= to install all packages and =make doctor= to diagnose
|
||||
missing tools.
|
||||
|
||||
* Appendix
|
||||
** Commands
|
||||
| command | key / ex command | description |
|
||||
|------------------------------+------------------+-----------------------------------------------------------|
|
||||
| =merlin-type-enclosing= | =SPC m t= | display type under point |
|
||||
| =tuareg-find-alternate-file= | =SPC m a= | switch between =.ml= and =.mli= |
|
||||
| =merlin-locate= | =gd= | lookup definition |
|
||||
| =merlin-occurences= | =SPC c D= | lookup references |
|
||||
| =merlin-document= | =K= | lookup documentation |
|
||||
| =merlin-imenu= | =SPC / i= | symbol lookup in file |
|
||||
| =merlin-iedit-occurrences= | =v R= | visual refactor identifier under point (multiple cursors) |
|
||||
| =utop= | =SPC o r= | open =utop= as REPL |
|
||||
| =utop-eval-region= | =SPC c e= | evaluate selected region in =utop= |
|
||||
| Command | Key | Description |
|
||||
|------------------------------+-----------+-----------------------------------------------------------|
|
||||
| =merlin-type-enclosing= | =SPC m t= | display type under point |
|
||||
| =tuareg-find-alternate-file= | =SPC m a= | switch between =.ml= and =.mli= |
|
||||
| =merlin-locate= | =gd= | lookup definition |
|
||||
| =merlin-occurences= | =SPC c D= | lookup references |
|
||||
| =merlin-document= | =K= | lookup documentation |
|
||||
| =merlin-imenu= | =SPC / i= | symbol lookup in file |
|
||||
| =merlin-iedit-occurrences= | =v R= | visual refactor identifier under point (multiple cursors) |
|
||||
| =utop= | =SPC o r= | open =utop= as REPL |
|
||||
| =utop-eval-region= | =SPC c e= | evaluate selected region in =utop= |
|
||||
|
||||
** Hacks
|
||||
+ =set-pretty-symbols!= is called with the full tuareg prettify symbol list, this
|
||||
|
|
|
@ -28,20 +28,20 @@
|
|||
|
||||
(use-package! utop
|
||||
:when (featurep! :tools eval)
|
||||
:hook (tuareg-mode . +ocaml|init-utop)
|
||||
:hook (tuareg-mode . +ocaml-init-utop-h)
|
||||
:init
|
||||
(set-repl-handler! 'tuareg-mode #'utop)
|
||||
(set-eval-handler! 'tuareg-mode #'utop-eval-region)
|
||||
(defun +ocaml|init-utop ()
|
||||
(defun +ocaml-init-utop-h ()
|
||||
(when (executable-find "utop")
|
||||
(utop-minor-mode)))))
|
||||
|
||||
|
||||
(use-package! merlin
|
||||
:unless (featurep! +lsp)
|
||||
:hook (tuareg-mode . +ocaml|init-merlin)
|
||||
:hook (tuareg-mode . +ocaml-init-merlin-h)
|
||||
:init
|
||||
(defun +ocaml|init-merlin ()
|
||||
(defun +ocaml-init-merlin-h ()
|
||||
"Activate `merlin-mode' if the ocamlmerlin executable exists."
|
||||
(when (executable-find "ocamlmerlin")
|
||||
(merlin-mode)))
|
||||
|
@ -62,9 +62,9 @@
|
|||
|
||||
(use-package! flycheck-ocaml
|
||||
:when (featurep! :tools flycheck)
|
||||
:hook (merlin-mode . +ocaml|init-flycheck)
|
||||
:hook (merlin-mode . +ocaml-init-flycheck-h)
|
||||
:config
|
||||
(defun +ocaml|init-flycheck ()
|
||||
(defun +ocaml-init-flycheck-h ()
|
||||
"Activate `flycheck-ocaml` if the current project possesses a .merlin file."
|
||||
(when (projectile-locate-dominating-file default-directory ".merlin")
|
||||
;; Disable Merlin's own error checking
|
||||
|
@ -90,9 +90,9 @@
|
|||
(use-package! ocp-indent
|
||||
;; must be careful to always defer this, it has autoloads that adds hooks
|
||||
;; which we do not want if the executable can't be found
|
||||
:hook (tuareg-mode . +ocaml|init-ocp-indent)
|
||||
:hook (tuareg-mode . +ocaml-init-ocp-indent-h)
|
||||
:config
|
||||
(defun +ocaml|init-ocp-indent ()
|
||||
(defun +ocaml-init-ocp-indent-h ()
|
||||
"Run `ocp-setup-indent', so long as the ocp-indent binary exists."
|
||||
(when (executable-find "ocp-indent")
|
||||
(ocp-setup-indent))))
|
||||
|
@ -101,12 +101,12 @@
|
|||
(use-package! ocamlformat
|
||||
:when (featurep! :editor format)
|
||||
:commands ocamlformat
|
||||
:hook (tuareg-mode . +ocaml|init-ocamlformat)
|
||||
:hook (tuareg-mode . +ocaml-init-ocamlformat-h)
|
||||
:config
|
||||
(set-formatter! 'ocamlformat #'ocamlformat
|
||||
:modes '(caml-mode tuareg-mode))
|
||||
;; TODO Fix region-based formatting support
|
||||
(defun +ocaml|init-ocamlformat ()
|
||||
(defun +ocaml-init-ocamlformat-h ()
|
||||
(setq +format-with 'ocp-indent)
|
||||
(when (and (executable-find "ocamlformat")
|
||||
(locate-dominating-file default-directory ".ocamlformat"))
|
||||
|
|
|
@ -31,42 +31,46 @@
|
|||
(+org-present--make-invisible (match-beginning 1) (match-end 1)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +org-present|remove-overlays ()
|
||||
(defun +org-present-remove-overlays-h ()
|
||||
(mapc #'delete-overlay +org-present--overlays)
|
||||
(remove-from-invisibility-spec '(+org-present)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +org-present-detect-slide-h ()
|
||||
(outline-show-all)
|
||||
(if (member "title" (org-get-tags-at))
|
||||
(if (member "title" (org-get-tags))
|
||||
(text-scale-set 10)
|
||||
(text-scale-set +org-present-text-scale)))
|
||||
|
||||
(defvar cwm-use-vertical-padding)
|
||||
(defvar cwm-frame-internal-border)
|
||||
(defvar cwm-left-fringe-ratio)
|
||||
(defvar cwm-centered-window-width)
|
||||
;;;###autoload
|
||||
(defun +org-present-init-org-tree-window-h ()
|
||||
"Set up the org window for presentation."
|
||||
(doom/window-maximize-buffer)
|
||||
(let ((cwm-use-vertical-padding t)
|
||||
(cwm-frame-internal-border 110)
|
||||
(cwm-left-fringe-ratio -10)
|
||||
(cwm-centered-window-width 240)
|
||||
(arg (if org-tree-slide-mode +1 -1)))
|
||||
(let ((arg (if org-tree-slide-mode +1 -1)))
|
||||
(when (fboundp 'centered-window-mode)
|
||||
(centered-window-mode arg))
|
||||
(let ((cwm-use-vertical-padding t)
|
||||
(cwm-frame-internal-border 110)
|
||||
(cwm-left-fringe-ratio -10)
|
||||
(cwm-centered-window-width 240))
|
||||
(centered-window-mode arg)))
|
||||
(window-divider-mode (* arg -1))
|
||||
(hide-mode-line-mode arg)
|
||||
(+org-pretty-mode arg)
|
||||
(cond (org-tree-slide-mode
|
||||
(org-indent-mode -1)
|
||||
(text-scale-set +org-present-text-scale)
|
||||
(ignore-errors (org-toggle-latex-fragment '(4)))
|
||||
(ignore-errors (org-latex-preview '(4)))
|
||||
(set-face-attribute 'org-level-2 nil :height 1.4))
|
||||
(t
|
||||
(org-indent-mode +1)
|
||||
(text-scale-set 0)
|
||||
(org-remove-latex-fragment-image-overlays)
|
||||
(org-clear-latex-preview)
|
||||
(set-face-attribute 'org-level-2 nil :height 1.0)
|
||||
(+org-present|remove-overlays)
|
||||
(+org-present-remove-overlays-h)
|
||||
(org-remove-inline-images)))))
|
||||
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
"A list of all indexed attachments in `org-directory'.")
|
||||
|
||||
(defvar +org-attachments-files nil
|
||||
"A list of all attachments in `org-attach-directory'.")
|
||||
"A list of all attachments in `org-attach-id-dir'.")
|
||||
|
||||
(defun +org-attachments--list (&optional beg end)
|
||||
"Return a list of all attachment file names in the current buffer between BEG
|
||||
|
@ -33,20 +33,20 @@ and END (defaults to `point-min' and `point-max')."
|
|||
(while (search-forward "[[attach:" end t)
|
||||
(let* ((context (save-match-data (org-element-context)))
|
||||
(link (expand-file-name (org-link-unescape (org-element-property :path context))
|
||||
org-attach-directory)))
|
||||
org-attach-id-dir)))
|
||||
(when (and (equal "file" (org-element-property :type context))
|
||||
(file-in-directory-p link org-attach-directory))
|
||||
(file-in-directory-p link org-attach-id-dir))
|
||||
(push (file-name-nondirectory link) attachments))))))
|
||||
(cl-delete-duplicates attachments :test #'string=)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +org-attach/sync (arg)
|
||||
"Reindex all attachments in `org-directory' and delete orphaned attachments in
|
||||
`org-attach-directory'. If ARG (universal arg), conduct a dry run."
|
||||
`org-attach-id-dir'. If ARG (universal arg), conduct a dry run."
|
||||
(declare (interactive-only t))
|
||||
(interactive "P")
|
||||
(message "Reloading")
|
||||
(setq +org-attachments-files (directory-files org-attach-directory nil "^[^.]" t))
|
||||
(setq +org-attachments-files (directory-files org-attach-id-dir nil "^[^.]" t))
|
||||
(with-temp-buffer
|
||||
(delay-mode-hooks (org-mode))
|
||||
(dolist (org-file (directory-files-recursively org-directory "\\.org$"))
|
||||
|
@ -59,14 +59,14 @@ and END (defaults to `point-min' and `point-max')."
|
|||
(message "Deleting orphaned attachment: %s" file)
|
||||
(cl-incf deleted)
|
||||
(unless arg
|
||||
(delete-file (expand-file-name file org-attach-directory))))
|
||||
(delete-file (expand-file-name file org-attach-id-dir))))
|
||||
(message "Buffer's attachments synced (%d deleted)" deleted)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +org-attach/find-file ()
|
||||
"Open a file from `org-attach-directory'."
|
||||
"Open a file from `org-attach-id-dir'."
|
||||
(interactive)
|
||||
(doom-project-browse org-attach-directory))
|
||||
(doom-project-browse org-attach-id-dir))
|
||||
|
||||
;;;###autoload
|
||||
(defun +org-attach/file (path)
|
||||
|
|
|
@ -40,6 +40,7 @@ you're done. This can be called from an external shell script."
|
|||
(frame (if (+org-capture-frame-p)
|
||||
(selected-frame)
|
||||
(make-frame +org-capture-frame-parameters))))
|
||||
(select-frame-set-input-focus frame) ; fix MacOS not focusing new frames
|
||||
(with-selected-frame frame
|
||||
(require 'org-capture)
|
||||
(condition-case ex
|
||||
|
|
|
@ -111,8 +111,8 @@ If on a:
|
|||
'done)))
|
||||
(t
|
||||
(+org/refresh-inline-images)
|
||||
(org-remove-latex-fragment-image-overlays)
|
||||
(org-toggle-latex-fragment '(4)))))
|
||||
(org-clear-latex-preview)
|
||||
(org-latex-preview '(4)))))
|
||||
|
||||
(`clock (org-clock-update-time-maybe))
|
||||
|
||||
|
@ -150,7 +150,7 @@ If on a:
|
|||
(org-babel-execute-src-block))
|
||||
|
||||
((or `latex-fragment `latex-environment)
|
||||
(org-toggle-latex-fragment))
|
||||
(org-latex-preview))
|
||||
|
||||
(`link
|
||||
(let* ((lineage (org-element-lineage context '(link) t))
|
||||
|
@ -298,15 +298,14 @@ wrong places)."
|
|||
(defun +org/remove-link ()
|
||||
"Unlink the text at point."
|
||||
(interactive)
|
||||
(unless (org-in-regexp org-bracket-link-regexp 1)
|
||||
(unless (org-in-regexp org-link-bracket-re 1)
|
||||
(user-error "No link at point"))
|
||||
(save-excursion
|
||||
(let ((remove (list (match-beginning 0) (match-end 0)))
|
||||
(description (if (match-end 3)
|
||||
(match-string-no-properties 3)
|
||||
(match-string-no-properties 1))))
|
||||
(apply #'delete-region remove)
|
||||
(insert description))))
|
||||
(let ((label (if (match-end 2)
|
||||
(match-string-no-properties 2)
|
||||
(org-link-unescape (match-string-no-properties 1)))))
|
||||
(delete-region (match-beginning 0) (match-end 0))
|
||||
(insert label))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +org/toggle-checkbox ()
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
(unless org-agenda-files
|
||||
(setq org-agenda-files (list org-directory)))
|
||||
(setq-default
|
||||
;; Don't monopolize the whole frame just for the agenda
|
||||
org-agenda-window-setup 'current-window
|
||||
;; Hide blocked tasks in the agenda view.
|
||||
org-agenda-dim-blocked-tasks 'invisible
|
||||
org-agenda-inhibit-startup t
|
||||
|
@ -22,8 +24,7 @@
|
|||
(defun +org-init-appearance-h ()
|
||||
"Configures the UI for `org-mode'."
|
||||
(setq-default
|
||||
org-adapt-indentation nil
|
||||
org-cycle-include-plain-lists t
|
||||
org-indirect-buffer-display 'current-window
|
||||
org-eldoc-breadcrumb-separator " → "
|
||||
org-enforce-todo-dependencies t
|
||||
org-entities-user
|
||||
|
@ -33,16 +34,10 @@
|
|||
org-fontify-quote-and-verse-blocks t
|
||||
org-fontify-whole-heading-line t
|
||||
org-footnote-auto-label 'plain
|
||||
org-hidden-keywords nil
|
||||
org-hide-emphasis-markers nil
|
||||
org-hide-leading-stars t
|
||||
org-hide-leading-stars-before-indent-mode t
|
||||
org-image-actual-width nil
|
||||
org-indent-indentation-per-level 2
|
||||
org-indent-mode-turns-on-hiding-stars t
|
||||
org-list-description-max-indent 4
|
||||
org-pretty-entities nil
|
||||
org-pretty-entities-include-sub-superscripts t
|
||||
org-priority-faces
|
||||
'((?a . error)
|
||||
(?b . warning)
|
||||
|
@ -50,10 +45,7 @@
|
|||
org-refile-targets
|
||||
'((nil :maxlevel . 3)
|
||||
(org-agenda-files :maxlevel . 3))
|
||||
org-startup-folded t
|
||||
org-startup-indented t
|
||||
org-startup-with-inline-images nil
|
||||
org-tags-column 0
|
||||
org-todo-keywords
|
||||
'((sequence "TODO(t)" "PROJ(p)" "|" "DONE(d)")
|
||||
(sequence "[ ](T)" "[-](P)" "[?](M)" "|" "[X](D)")
|
||||
|
@ -69,6 +61,7 @@
|
|||
;; Scale up LaTeX previews a bit (default is too small)
|
||||
org-format-latex-options (plist-put org-format-latex-options :scale 1.5))
|
||||
|
||||
;; Show the full link destination in minibuffer when cursor/mouse is over it
|
||||
(advice-add #'org-eldoc-documentation-function :around #'+org-display-link-in-eldoc-a)
|
||||
|
||||
;; Don't do automatic indent detection in org files
|
||||
|
@ -93,11 +86,11 @@
|
|||
|
||||
|
||||
(defun +org-init-babel-h ()
|
||||
(setq org-src-fontify-natively t ; make code pretty
|
||||
org-src-preserve-indentation t ; use native major-mode indentation
|
||||
(setq org-src-preserve-indentation t ; use native major-mode indentation
|
||||
org-src-tab-acts-natively t
|
||||
org-src-window-setup 'current-window
|
||||
org-confirm-babel-evaluate nil) ; you don't need my permission
|
||||
org-confirm-babel-evaluate nil ; you don't need my permission
|
||||
;; Show src buffer in popup, and don't monopolize the frame
|
||||
org-src-window-setup 'other-window)
|
||||
|
||||
;; I prefer C-c C-c over C-c ' (more consistent)
|
||||
(define-key org-src-mode-map (kbd "C-c C-c") #'org-edit-src-exit)
|
||||
|
@ -106,7 +99,8 @@
|
|||
(advice-add #'org-return-indent :after #'+org-fix-newline-and-indent-in-src-blocks-a)
|
||||
|
||||
;; `org-babel-get-header' was removed from org in 9.0. Quite a few babel
|
||||
;; plugins use it, so until those plugins update, this polyfill will do:
|
||||
;; plugins use it (like ob-spice), so until those plugins update, this
|
||||
;; polyfill will do:
|
||||
(defun org-babel-get-header (params key &optional others)
|
||||
(cl-loop with fn = (if others #'not #'identity)
|
||||
for p in params
|
||||
|
@ -148,10 +142,12 @@ at the first function to return non-nil.")
|
|||
"Load babel libraries lazily when babel blocks are executed."
|
||||
:after-while #'org-babel-confirm-evaluate
|
||||
(let* ((lang (nth 0 info))
|
||||
(lang (if (symbolp lang) lang (intern lang)))
|
||||
(lang (cond ((symbolp lang) lang)
|
||||
((stringp lang) (intern lang))))
|
||||
(lang (or (cdr (assq lang +org-babel-mode-alist))
|
||||
lang)))
|
||||
(when (and (not (cdr (assq lang org-babel-load-languages)))
|
||||
(when (and lang
|
||||
(not (cdr (assq lang org-babel-load-languages)))
|
||||
(or (run-hook-with-args-until-success '+org-babel-load-functions lang)
|
||||
(require (intern (format "ob-%s" lang)) nil t)))
|
||||
(when (assq :async (nth 2 info))
|
||||
|
@ -258,7 +254,7 @@ underlying, modified buffer. This fixes that."
|
|||
"I believe Org's native attachment system is over-complicated and litters
|
||||
files with metadata I don't want. So I wrote my own, which:
|
||||
|
||||
+ Places attachments in a centralized location (`org-attach-directory' in
|
||||
+ Places attachments in a centralized location (`org-attach-id-dir' in
|
||||
`org-directory').
|
||||
+ Adds attach:* link abbreviation for quick links to these files from anywhere.
|
||||
+ Use `+org-attach/sync' to index all attachments in `org-directory' that use
|
||||
|
@ -272,30 +268,30 @@ Some commands of interest:
|
|||
+ `+org-attach/file'
|
||||
+ `+org-attach/url'
|
||||
+ `+org-attach/sync'"
|
||||
(setq org-attach-directory (doom-path org-directory org-attach-directory))
|
||||
(setq org-attach-id-dir (doom-path org-directory org-attach-id-dir))
|
||||
|
||||
;; A shorter link to attachments
|
||||
(add-to-list 'org-link-abbrev-alist
|
||||
(cons "attach"
|
||||
(abbreviate-file-name org-attach-directory)))
|
||||
(abbreviate-file-name org-attach-id-dir)))
|
||||
|
||||
(org-link-set-parameters
|
||||
"attach"
|
||||
:follow (lambda (link) (find-file (doom-path org-attach-directory link)))
|
||||
:follow (lambda (link) (find-file (doom-path org-attach-id-dir link)))
|
||||
:complete (lambda (&optional _arg)
|
||||
(+org--relpath (+org-link-read-file "attach" org-attach-directory)
|
||||
org-attach-directory))
|
||||
(+org--relpath (+org-link-read-file "attach" org-attach-id-dir)
|
||||
org-attach-id-dir))
|
||||
:face (lambda (link)
|
||||
(if (file-exists-p (expand-file-name link org-attach-directory))
|
||||
(if (file-exists-p (expand-file-name link org-attach-id-dir))
|
||||
'org-link
|
||||
'error)))
|
||||
|
||||
(after! projectile
|
||||
(add-to-list 'projectile-globally-ignored-directories org-attach-directory))
|
||||
(add-to-list 'projectile-globally-ignored-directories org-attach-id-dir))
|
||||
|
||||
(after! recentf
|
||||
(add-to-list 'recentf-exclude
|
||||
(lambda (file) (file-in-directory-p file org-attach-directory)))))
|
||||
(lambda (file) (file-in-directory-p file org-attach-id-dir)))))
|
||||
|
||||
|
||||
(defun +org-init-centralized-exports-h ()
|
||||
|
@ -387,8 +383,8 @@ file isn't in `org-directory'."
|
|||
(add-to-list 'org-export-backends 'md))
|
||||
|
||||
(use-package! ox-pandoc
|
||||
:when (and (featurep! +pandoc)
|
||||
(executable-find "pandoc"))
|
||||
:when (featurep! +pandoc)
|
||||
:when (executable-find "pandoc")
|
||||
:after ox
|
||||
:init
|
||||
(add-to-list 'org-export-backends 'pandoc)
|
||||
|
@ -459,7 +455,7 @@ eldoc string."
|
|||
for n from 0
|
||||
for face = (nth (% n org-n-level-faces) org-level-faces)
|
||||
collect
|
||||
(org-add-props (replace-regexp-in-string org-any-link-re "\\4" part)
|
||||
(org-add-props (replace-regexp-in-string org-link-any-re "\\4" part)
|
||||
nil 'face `(:foreground ,(face-foreground face nil t) :weight bold)))
|
||||
separator)))
|
||||
|
||||
|
@ -477,7 +473,20 @@ current workspace."
|
|||
"Prevent temporarily opened agenda buffers from polluting recentf."
|
||||
:around #'org-get-agenda-file-buffer
|
||||
(let ((recentf-exclude (list (lambda (_file) t))))
|
||||
(funcall orig-fn file))))
|
||||
(funcall orig-fn file)))
|
||||
|
||||
;; HACK With https://code.orgmode.org/bzg/org-mode/commit/48da60f4, inline
|
||||
;; image previews broke for users with imagemagick support built in. This
|
||||
;; reverses the problem, but should be removed once it is addressed upstream
|
||||
;; (if ever).
|
||||
(defadvice! +org--fix-inline-images-for-imagemagick-users-a (orig-fn &rest args)
|
||||
:around #'org-display-inline-images
|
||||
(cl-letf* ((old-create-image (symbol-function #'create-image))
|
||||
((symbol-function #'create-image)
|
||||
(lambda (file-or-data &optional type data-p &rest props)
|
||||
(let ((type (if (plist-get props :width) type)))
|
||||
(apply old-create-image file-or-data type data-p props)))))
|
||||
(apply orig-fn args))))
|
||||
|
||||
|
||||
(defun +org-init-keybinds-h ()
|
||||
|
@ -603,7 +612,7 @@ between the two."
|
|||
"t" #'org-agenda-todo))
|
||||
|
||||
|
||||
(defun +org-init-keybinds-for-evil-h (&rest args)
|
||||
(defun +org-init-keybinds-for-evil-h (&rest _)
|
||||
"TODO"
|
||||
(when (featurep! :editor evil +everywhere)
|
||||
(use-package! evil-org
|
||||
|
@ -657,18 +666,18 @@ between the two."
|
|||
(org-at-table-p) 'org-table-insert-column)
|
||||
:ni "C-S-h" (general-predicate-dispatch 'org-shiftmetaleft
|
||||
(org-at-table-p) '+org/table-insert-column-left)
|
||||
:ni "C-S-k" (general-predicate-dispatch 'org-shiftmetaup
|
||||
:ni "C-S-k" (general-predicate-dispatch 'org-metaup
|
||||
(org-at-table-p) 'org-table-insert-row)
|
||||
:ni "C-S-j" (general-predicate-dispatch 'org-shiftmetadown
|
||||
:ni "C-S-j" (general-predicate-dispatch 'org-metadown
|
||||
(org-at-table-p) '+org/table-insert-row-below)
|
||||
;; moving/(de|pro)moting single headings & shifting table rows/columns
|
||||
:ni "C-M-S-l" (general-predicate-dispatch 'org-metaright
|
||||
(org-at-table-p) 'org-table-move-column-right)
|
||||
:ni "C-M-S-h" (general-predicate-dispatch 'org-metaleft
|
||||
(org-at-table-p) 'org-table-move-column-left)
|
||||
:ni "C-M-S-k" (general-predicate-dispatch 'org-metaup
|
||||
:ni "C-M-S-k" (general-predicate-dispatch 'org-shiftmetaup
|
||||
(org-at-table-p) 'org-table-move-row-up)
|
||||
:ni "C-M-S-j" (general-predicate-dispatch 'org-metadown
|
||||
:ni "C-M-S-j" (general-predicate-dispatch 'org-shiftmetadown
|
||||
(org-at-table-p) 'org-table-move-row-down)
|
||||
;; more intuitive RET keybinds
|
||||
:i [return] #'org-return-indent
|
||||
|
@ -693,8 +702,7 @@ between the two."
|
|||
:n "zc" #'+org/close-fold
|
||||
:n "zC" #'outline-hide-subtree
|
||||
:n "zm" #'+org/hide-next-fold-level
|
||||
:n "zn" #'org-narrow-to-subtree
|
||||
:n "zN" #'org-tree-to-indirect-buffer
|
||||
:n "zn" #'org-tree-to-indirect-buffer
|
||||
:n "zo" #'+org/open-fold
|
||||
:n "zO" #'outline-show-subtree
|
||||
:n "zr" #'+org/show-next-fold-level
|
||||
|
@ -717,8 +725,8 @@ between the two."
|
|||
'(("^\\*Org Links" :slot -1 :vslot -1 :size 2 :ttl 0)
|
||||
("^\\*\\(?:Agenda Com\\|Calendar\\|Org \\(?:Export Dispatcher\\|Select\\)\\)"
|
||||
:slot -1 :vslot -1 :size #'+popup-shrink-to-fit :ttl 0)
|
||||
("^\\*Org Agenda" :size 0.35 :select t :ttl nil)
|
||||
("^\\*Org Src" :size 0.3 :quit nil :select t :autosave t :ttl nil)
|
||||
("^\\*Org Agenda" :ignore t)
|
||||
("^\\*Org Src" :size 0.4 :quit nil :select t :autosave t :modeline t :ttl nil)
|
||||
("^CAPTURE.*\\.org$" :size 0.2 :quit nil :select t :autosave t))))
|
||||
|
||||
|
||||
|
@ -774,13 +782,17 @@ compelling reason, so..."
|
|||
(skip-chars-backward "*")
|
||||
(bolp))))
|
||||
|
||||
(defun +org-sp-in-src-block-p (_id action _context)
|
||||
(and (eq action 'insert)
|
||||
(org-in-src-block-p)))
|
||||
|
||||
;; make delimiter auto-closing a little more conservative
|
||||
(sp-with-modes 'org-mode
|
||||
(sp-local-pair "*" "*" :unless '(:add sp-point-before-word-p sp-in-math-p +org-sp-point-at-bol-p))
|
||||
(sp-local-pair "_" "_" :unless '(:add sp-point-before-word-p sp-in-math-p))
|
||||
(sp-local-pair "/" "/" :unless '(:add sp-point-before-word-p sp-in-math-p +org-sp-point-in-checkbox-p))
|
||||
(sp-local-pair "~" "~" :unless '(:add sp-point-before-word-p))
|
||||
(sp-local-pair "=" "=" :unless '(:add sp-point-before-word-p sp-in-math-p)))))
|
||||
(sp-local-pair "*" "*" :unless '(:add sp-point-before-word-p sp-in-math-p +org-sp-point-at-bol-p +org-sp-in-src-block-p))
|
||||
(sp-local-pair "_" "_" :unless '(:add sp-point-before-word-p sp-in-math-p +org-sp-in-src-block-p))
|
||||
(sp-local-pair "/" "/" :unless '(:add sp-point-before-word-p sp-in-math-p +org-sp-point-in-checkbox-p +org-sp-in-src-block-p))
|
||||
(sp-local-pair "~" "~" :unless '(:add sp-point-before-word-p +org-sp-in-src-block-p))
|
||||
(sp-local-pair "=" "=" :unless '(:add sp-point-before-word-p sp-in-math-p +org-sp-in-src-block-p)))))
|
||||
|
||||
|
||||
;;
|
||||
|
@ -794,7 +806,7 @@ compelling reason, so..."
|
|||
:preface
|
||||
;; Change org defaults (should be set before org loads)
|
||||
(defvar org-directory "~/org/")
|
||||
(defvar org-attach-directory ".attach/")
|
||||
(defvar org-attach-id-dir ".attach/")
|
||||
|
||||
(setq org-clock-persist-file (concat doom-etc-dir "org-clock-save.el")
|
||||
org-publish-timestamp-directory (concat doom-cache-dir "org-timestamps/")
|
||||
|
@ -815,7 +827,6 @@ compelling reason, so..."
|
|||
|
||||
(add-hook! 'org-mode-hook
|
||||
#'org-bullets-mode ; "prettier" bullets
|
||||
#'org-indent-mode ; margin-based indentation
|
||||
#'toc-org-enable ; auto-table of contents
|
||||
#'auto-fill-mode ; hard line wrapping
|
||||
;; `show-paren-mode' causes flickering with indentation margins made by
|
||||
|
@ -850,7 +861,8 @@ compelling reason, so..."
|
|||
|
||||
;; In case the user has eagerly loaded org from their configs
|
||||
(when (and (featurep 'org)
|
||||
(not doom-reloading-p))
|
||||
(not doom-reloading-p)
|
||||
(not byte-compile-current-file))
|
||||
(message "`org' was already loaded by the time lang/org loaded, this may cause issues")
|
||||
(run-hooks 'org-load-hook))
|
||||
|
||||
|
|
14
modules/lang/org/contrib/journal.el
Normal file
14
modules/lang/org/contrib/journal.el
Normal file
|
@ -0,0 +1,14 @@
|
|||
;;; lang/org/contrib/journal.el -*- lexical-binding: t; -*-
|
||||
;;;###if (featurep! +journal)
|
||||
|
||||
(use-package! org-journal
|
||||
:defer t
|
||||
:config
|
||||
(map! :map org-journal-search-mode-map
|
||||
:localleader
|
||||
"n" #'org-journal-search-next
|
||||
"p" #'org-journal-search-prev)
|
||||
(map! :map org-journal-mode-map
|
||||
:localleader
|
||||
"n" #'org-journal-open-next-entry
|
||||
"p" #'org-journal-open-previous-entry))
|
|
@ -49,3 +49,6 @@
|
|||
(package! centered-window :recipe (:host github :repo "anler/centered-window-mode"))
|
||||
(package! org-tree-slide)
|
||||
(package! ox-reveal))
|
||||
|
||||
(when (featurep! +journal)
|
||||
(package! org-journal))
|
||||
|
|
|
@ -19,33 +19,33 @@
|
|||
|
||||
(describe "headlines"
|
||||
(it "appends first-level headlines with an extra newline"
|
||||
(insert! "* {0}Header")
|
||||
(insert!! "* {0}Header")
|
||||
(+org/insert-item-below 1)
|
||||
(expect (eobp))
|
||||
(expect (buffer-substring-no-properties (point-min) (point-max))
|
||||
:to-equal "* Header\n\n* "))
|
||||
(it "prepends first-level headlines with an extra newline"
|
||||
(insert! "* {0}Header")
|
||||
(insert!! "* {0}Header")
|
||||
(+org/insert-item-above 1)
|
||||
(expect (eolp))
|
||||
(expect (buffer-substring-no-properties (point-min) (point-max))
|
||||
:to-equal "* \n\n* Header"))
|
||||
|
||||
(it "appends second-level headlines with an no extra newline"
|
||||
(insert! "** {0}Header")
|
||||
(insert!! "** {0}Header")
|
||||
(+org/insert-item-below 1)
|
||||
(expect (eobp))
|
||||
(expect (buffer-substring-no-properties (point-min) (point-max))
|
||||
:to-equal "** Header\n** "))
|
||||
(it "prepends second-level headlines with an no extra newline"
|
||||
(insert! "** {0}Header")
|
||||
(insert!! "** {0}Header")
|
||||
(+org/insert-item-above 1)
|
||||
(expect (eolp))
|
||||
(expect (buffer-substring-no-properties (point-min) (point-max))
|
||||
:to-equal "** \n** Header"))
|
||||
|
||||
(it "appends headlines, skipping subtrees"
|
||||
(insert! "** {0}First\n"
|
||||
(insert!! "** {0}First\n"
|
||||
"*** sub 1\n"
|
||||
"*** sub 2\n"
|
||||
"**** subsub 1\n"
|
||||
|
@ -63,7 +63,7 @@
|
|||
"** Header")
|
||||
"\n")))
|
||||
(it "prepends headlines, skipping subtrees"
|
||||
(insert! "** First\n"
|
||||
(insert!! "** First\n"
|
||||
"*** sub 1\n"
|
||||
"*** sub 2\n"
|
||||
"**** {0}subsub 1\n"
|
||||
|
@ -83,18 +83,18 @@
|
|||
|
||||
(describe "plain lists"
|
||||
(it "appends items"
|
||||
(insert! "+ {0}List item")
|
||||
(insert!! "+ {0}List item")
|
||||
(+org/insert-item-below 1)
|
||||
(expect (buffer-substring-no-properties (point-min) (point-max))
|
||||
:to-equal "+ List item\n+ "))
|
||||
(it "prepends items"
|
||||
(insert! "+ {0}List item")
|
||||
(insert!! "+ {0}List item")
|
||||
(+org/insert-item-above 1)
|
||||
(expect (buffer-substring-no-properties (point-min) (point-max))
|
||||
:to-equal "+ \n+ List item"))
|
||||
|
||||
(it "appends items, but skips over child items"
|
||||
(insert! "+ {0}List item\n"
|
||||
(insert!! "+ {0}List item\n"
|
||||
" + Sub item\n"
|
||||
"+ List item")
|
||||
(+org/insert-item-below 1)
|
||||
|
@ -106,7 +106,7 @@
|
|||
"+ List item")
|
||||
"\n")))
|
||||
(it "prepends items, but skips over child items"
|
||||
(insert! "+ List item\n"
|
||||
(insert!! "+ List item\n"
|
||||
" + Sub item\n"
|
||||
"+ {0}List item")
|
||||
(+org/insert-item-above 1)
|
||||
|
@ -120,7 +120,7 @@
|
|||
|
||||
(describe "numbered lists"
|
||||
(it "appends items and updates numbers"
|
||||
(insert! "1. {0}List item\n"
|
||||
(insert!! "1. {0}List item\n"
|
||||
"2. Sub item\n"
|
||||
"3. List item")
|
||||
(+org/insert-item-below 1)
|
||||
|
@ -132,7 +132,7 @@
|
|||
"4. List item")
|
||||
"\n")))
|
||||
(it "prepends items and updates numbers"
|
||||
(insert! "1. List item\n"
|
||||
(insert!! "1. List item\n"
|
||||
"2. Sub item\n"
|
||||
"3. {0}List item")
|
||||
(+org/insert-item-above 1)
|
||||
|
|
|
@ -40,6 +40,11 @@ brew install composer
|
|||
sudo pacman --needed --noconfirm -S php composer # or php53, php54, php55
|
||||
#+END_SRC
|
||||
|
||||
*** openSUSE
|
||||
#+BEGIN_SRC sh :dir /sudo::
|
||||
sudo zypper install php-composer
|
||||
#+END_SRC
|
||||
|
||||
** Dependencies
|
||||
The features in this module optionally depend on the following php packages:
|
||||
|
||||
|
|
|
@ -24,14 +24,3 @@ ignore the cache."
|
|||
(require 'json)
|
||||
(json-read-file package-file)))
|
||||
(puthash project-root data +php-composer-conf))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +php|init-ac-php-core-eldoc ()
|
||||
"Initialize eldoc support for `php-mode' with `ac-php-core'. Fails gracefully
|
||||
if phpctags isn't installed."
|
||||
(require 'ac-php-core)
|
||||
(cond ((not ac-php-ctags-executable))
|
||||
((not (file-exists-p ac-php-ctags-executable))
|
||||
(message "Could not find phpctags executable, eldoc support is disabled")
|
||||
(message "To disable these warnings, set ac-php-ctags-executable to nil"))
|
||||
((ac-php-core-eldoc-setup))))
|
||||
|
|
|
@ -6,5 +6,5 @@
|
|||
(interactive)
|
||||
(if (file-exists-p plantuml-jar-path)
|
||||
(user-error "plantuml.jar already installed")
|
||||
(url-copy-file "https://datapacket.dl.sourceforge.net/project/plantuml/plantuml.jar"
|
||||
(url-copy-file "https://downloads.sourceforge.net/project/plantuml/plantuml.jar"
|
||||
plantuml-jar-path)))
|
||||
|
|
|
@ -13,3 +13,22 @@
|
|||
:when (featurep! :tools flycheck)
|
||||
:after plantuml-mode
|
||||
:config (flycheck-plantuml-setup))
|
||||
|
||||
|
||||
(after! ob-plantuml
|
||||
(defadvice! +plantuml--fix-atstart-in-org-src-blocks-a (args)
|
||||
"Fix error when executing plantuml src blocks in org-mode for code that
|
||||
begins with '@'. This character needs to be escaped with a backslash or comma
|
||||
for the block to execute correctly, so we do it automatically."
|
||||
:filter-args #'org-babel-execute:plantuml
|
||||
(cl-destructuring-bind (body params) args
|
||||
(let* ((origin-body body)
|
||||
(fix-body
|
||||
(replace-regexp-in-string
|
||||
"^[[:blank:]\n]*\\(@start\\)"
|
||||
"\\\\\\1"
|
||||
origin-body)))
|
||||
(list fix-body params))))
|
||||
|
||||
(add-to-list 'org-babel-default-header-args:plantuml
|
||||
'(:cmdline . "-charset utf-8")))
|
||||
|
|
120
modules/lang/python/README.org
Normal file
120
modules/lang/python/README.org
Normal file
|
@ -0,0 +1,120 @@
|
|||
#+TITLE: lang/python
|
||||
#+DATE: Oct, 2019
|
||||
#+SINCE: v2.0.9
|
||||
#+STARTUP: inlineimages
|
||||
|
||||
* Table of Contents :TOC_3:noexport:
|
||||
- [[#description][Description]]
|
||||
- [[#module-flags][Module Flags]]
|
||||
- [[#plugins][Plugins]]
|
||||
- [[#prerequisites][Prerequisites]]
|
||||
- [[#language-server-protocol-support][Language Server Protocol Support]]
|
||||
- [[#features][Features]]
|
||||
- [[#keybindings][Keybindings]]
|
||||
- [[#configuration][Configuration]]
|
||||
|
||||
* Description
|
||||
Adds Python support to Doom Emacs.
|
||||
|
||||
+ Syntax checking (~flycheck~)
|
||||
+ Snippets
|
||||
+ Run tests (~nose~, ~pytest~)
|
||||
+ Auto-format (~black~), requires ~:editor format~
|
||||
|
||||
** Module Flags
|
||||
+ ~+lsp~ Language Server Protocol support
|
||||
+ ~+pyenv~ Python virtual environment support via [[https://github.com/pyenv/pyenv][pyenv]]
|
||||
+ ~+conda~ Python virtual environment support via [[https://conda.io/en/latest/][Conda]]
|
||||
|
||||
** Plugins
|
||||
+ [[https://github.com/pythonic-emacs/anaconda-mode][anaconda-mode]]*
|
||||
+ [[https://github.com/Wilfred/pyimport][pyimport]]*
|
||||
+ [[https://github.com/emacs-pe/pyimpsort.el][pyimpsort]]*
|
||||
+ [[https://melpa.org/#/nose][nose]]*
|
||||
+ [[https://github.com/wbolster/emacs-python-pytest][python-pytest]]*
|
||||
+ [[https://github.com/Wilfred/pip-requirements.el][pip-requirements]]*
|
||||
+ [[https://github.com/pwalsh/pipenv.el][pipenv]]*
|
||||
+ ~:editor format~
|
||||
+ [[https://github.com/lassik/emacs-format-all-the-code][format-all]]*
|
||||
+ ~+conda~
|
||||
+ [[https://github.com/necaris/conda.el][conda]]*
|
||||
+ ~+pyenv~
|
||||
+ [[https://github.com/pythonic-emacs/pyenv-mode][pyenv]]*
|
||||
+ ~+lsp~ and ~:tools lsp~
|
||||
+ [[https://github.com/emacs-lsp/lsp-mode][lsp]]
|
||||
+ [[https://github.com/emacs-lsp/lsp-python-ms][lsp-python-ms]]*
|
||||
|
||||
* Prerequisites
|
||||
This module has no direct prerequisites. Here are some of its soft dependencies.
|
||||
|
||||
+ To run tests inside of Emacs:
|
||||
+ ~pip install pytest~
|
||||
+ ~pip install nose~
|
||||
|
||||
+ The ~:editor format~ module uses [[https://github.com/psf/black][Black]] for python files
|
||||
+ ~pip install black~
|
||||
|
||||
+ ~pyimport~ requires Python's module ~pyimport~:
|
||||
+ ~pip install pyimport~
|
||||
|
||||
+ Python virtual environments install instructions at:
|
||||
+ [[https://github.com/pyenv/pyenv][pyenv]]
|
||||
+ [[https://conda.io/en/latest/][Conda]]
|
||||
|
||||
+ ~pipenv~ requires [[https://pipenv.readthedocs.io/en/latest/][pipenv]]
|
||||
|
||||
** Language Server Protocol Support
|
||||
Requires the ~+lsp~ flag and ~:tools lsp~ module to be enabled.
|
||||
By default LSP will use Microsoft's language server if installed.
|
||||
|
||||
To install the language server:
|
||||
~M-x lsp-python-ms-setup~
|
||||
To update the server:
|
||||
~M-x lsp-python-ms-update-server~
|
||||
|
||||
Alternatively you can use the [[https://pypi.org/project/python-language-server/][Python Language Server]] instead.
|
||||
~pip install 'python-language-server[all]'~
|
||||
|
||||
* Features
|
||||
This module supports LSP. It requires installation of [[https://pypi.org/project/python-language-server/][Python Language
|
||||
Server]] or [[https://github.com/Microsoft/python-language-server][Microsoft Lnaguaje Server]], see [[Language Server Protocol Support][LSP Support]].
|
||||
|
||||
To enable support for auto-formatting with black enable ~:editor format-all~ in
|
||||
~init.el~ file.
|
||||
|
||||
** Keybindings
|
||||
|
||||
| Binding | Description |
|
||||
|---------------------+----------------------------------|
|
||||
| ~<localleader> i i~ | ~Insert mising imports~ |
|
||||
| ~<localleader> i r~ | ~Remove unused imports~ |
|
||||
| ~<localleader> i s~ | ~Sort imports~ |
|
||||
| ~<localleader> i o~ | ~Optimize imports~ |
|
||||
| ~<localleader> t r~ | ~nosetests-again~ |
|
||||
| ~<localleader> t a~ | ~nosetests-all~ |
|
||||
| ~<localleader> t s~ | ~nosetests-one~ |
|
||||
| ~<localleader> t v~ | ~nosetests-module~ |
|
||||
| ~<localleader> t A~ | ~nosetests-pdb-all~ |
|
||||
| ~<localleader> t O~ | ~nosetests-pdb-one~ |
|
||||
| ~<localleader> t V~ | ~nosetests-pdb-module~ |
|
||||
| ~<localleader> t f~ | ~python-pytest-file~ |
|
||||
| ~<localleader> t k~ | ~python-pytest-file-dwin~ |
|
||||
| ~<localleader> t t~ | ~python-pytest-function~ |
|
||||
| ~<localleader> t m~ | ~python-pytest-function-dwim~ |
|
||||
| ~<localleader> t r~ | ~python-pytest-repeat~ |
|
||||
| ~<localleader> t p~ | ~python-pytest-popup~ |
|
||||
| ~<localleader> f d~ | ~anaconda-mode-find-definitions~ |
|
||||
| ~<localleader> f h~ | ~anaconda-mode-show-doc~ |
|
||||
| ~<localleader> f a~ | ~anaconda-mode-find-assignments~ |
|
||||
| ~<localleader> f f~ | ~anaconda-mode-find-file~ |
|
||||
| ~<localleader> f u~ | ~anaconda-mode-find-references~ |
|
||||
|
||||
* Configuration
|
||||
This module has the following variables to set extra arguments to [[https://ipython.org/][ipython]] and
|
||||
[[https://jupyter.org/][jupyter]] shells:
|
||||
|
||||
#+BEGIN_SRC elisp
|
||||
;; ~/.doom.d/config.el
|
||||
(setq +python-ipython-repl-args '("-i" "--simple-prompt" "--no-color-info"))
|
||||
(setq +python-jupyter-repl-args '("--simple-prompt"))
|
||||
#+END_SRC
|
|
@ -218,19 +218,12 @@ called.")
|
|||
:when (featurep! +conda)
|
||||
:after python
|
||||
:config
|
||||
;; The location of your anaconda home will be guessed from the following:
|
||||
;; The location of your anaconda home will be guessed from a list of common
|
||||
;; possibilities, starting with `conda-anaconda-home''s default value (which
|
||||
;; will consult a ANACONDA_HOME envvar, if it exists).
|
||||
;;
|
||||
;; + `conda-anaconda-home's default value:
|
||||
;; + ANACONDA_HOME
|
||||
;; + ~/.anaconda3
|
||||
;; + ~/.anaconda
|
||||
;; + ~/.miniconda
|
||||
;; + ~/usr/bin/anaconda3
|
||||
;; + ~/usr/local/anaconda3
|
||||
;; + ~/usr/local/miniconda3
|
||||
;;
|
||||
;; If none of these work for you, you must set `conda-anaconda-home'
|
||||
;; explicitly. Once set, run M-x `conda-env-activate' to switch between
|
||||
;; If none of these work for you, `conda-anaconda-home' must be set
|
||||
;; explicitly. Afterwards, run M-x `conda-env-activate' to switch between
|
||||
;; environments
|
||||
(unless (cl-loop for dir in (list conda-anaconda-home
|
||||
"~/.anaconda"
|
||||
|
@ -259,6 +252,8 @@ called.")
|
|||
:when (featurep! +lsp)
|
||||
:after lsp-clients
|
||||
:init
|
||||
(setq lsp-python-ms-dir (concat doom-etc-dir "mspyls/"))
|
||||
|
||||
;; HACK lsp-python-ms shouldn't install itself if it isn't present. This
|
||||
;; circumvents LSP falling back to pyls when lsp-python-ms is absent.
|
||||
;; Installing the server should be a deliberate act; either 'M-x
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
(add-hook! 'racket-mode-hook
|
||||
#'rainbow-delimiters-mode
|
||||
#'highlight-quoted-mode)
|
||||
(set-lookup-handlers! 'racket-mode :definition #'racket-visit-definition)
|
||||
|
||||
(map! :map (racket-mode-map racket-repl-mode-map)
|
||||
:i "[" #'racket-smart-open-bracket)
|
||||
|
|
|
@ -11,12 +11,12 @@
|
|||
(setq-hook! 'restclient-mode-hook
|
||||
imenu-generic-expression '((nil "^[A-Z]+\s+.+" 0)))
|
||||
|
||||
;; Forces underlying SSL verification to prompt for self-signed or invalid
|
||||
;; certs, rather than silently reject them.
|
||||
(defun +rest*permit-self-signed-ssl (orig-fn &rest args)
|
||||
(defadvice! +rest--permit-self-signed-ssl-a (orig-fn &rest args)
|
||||
"Forces underlying SSL verification to prompt for self-signed or invalid
|
||||
certs, rather than silently reject them."
|
||||
:around #'restclient-http-do
|
||||
(let (gnutls-verify-error tls-checktrust)
|
||||
(apply orig-fn args)))
|
||||
(advice-add #'restclient-http-do :around #'+rest*permit-self-signed-ssl)
|
||||
|
||||
(map! :map restclient-mode-map
|
||||
:n [return] #'+rest/dwim-at-point
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
;;; lang/ruby/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;
|
||||
;; Packages
|
||||
;;; Packages
|
||||
|
||||
(use-package! enh-ruby-mode
|
||||
:mode ("\\.\\(?:pry\\|irb\\)rc\\'" . +ruby|init)
|
||||
:mode ("\\.\\(?:rb\\|rake\\|rabl\\|ru\\|builder\\|gemspec\\|jbuilder\\|thor\\)\\'" . +ruby|init)
|
||||
:mode ("/\\(?:Berks\\|Cap\\|Gem\\|Guard\\|Pod\\|Puppet\\|Rake\\|Thor\\|Vagrant\\)file\\'" . +ruby|init)
|
||||
:mode ("\\.\\(?:pry\\|irb\\)rc\\'" . +ruby-init-h)
|
||||
:mode ("\\.\\(?:rb\\|rake\\|rabl\\|ru\\|builder\\|gemspec\\|jbuilder\\|thor\\)\\'" . +ruby-init-h)
|
||||
:mode ("/\\(?:Berks\\|Cap\\|Gem\\|Guard\\|Pod\\|Puppet\\|Rake\\|Thor\\|Vagrant\\)file\\'" . +ruby-init-h)
|
||||
:preface
|
||||
(after! ruby-mode
|
||||
(require 'enh-ruby-mode))
|
||||
(defun +ruby|init ()
|
||||
(defun +ruby-init-h ()
|
||||
"Enable `enh-ruby-mode' if ruby is available, otherwise `ruby-mode'."
|
||||
(if (executable-find "ruby")
|
||||
(enh-ruby-mode)
|
||||
|
@ -33,11 +33,11 @@
|
|||
(use-package! robe
|
||||
:defer t
|
||||
:init
|
||||
(defun +ruby|init-robe-mode-maybe ()
|
||||
"Start `robe-mode' if `lsp-mode' isn't active."
|
||||
(unless (bound-and-true-p lsp-mode)
|
||||
(robe-mode +1)))
|
||||
(add-hook 'enh-ruby-mode-hook #'+ruby|init-robe-mode-maybe)
|
||||
(add-hook! 'enh-ruby-mode-hook
|
||||
(defun +ruby-init-robe-mode-maybe-h ()
|
||||
"Start `robe-mode' if `lsp-mode' isn't active."
|
||||
(unless (bound-and-true-p lsp-mode)
|
||||
(robe-mode +1))))
|
||||
:config
|
||||
(set-repl-handler! 'enh-ruby-mode #'robe-start)
|
||||
(set-company-backend! 'enh-ruby-mode 'company-robe)
|
||||
|
@ -76,7 +76,7 @@
|
|||
|
||||
|
||||
;;
|
||||
;; Package & Ruby version management
|
||||
;;; Package & Ruby version management
|
||||
|
||||
(use-package! rake
|
||||
:defer t
|
||||
|
@ -111,7 +111,7 @@
|
|||
|
||||
|
||||
;;
|
||||
;; Testing frameworks
|
||||
;;; Testing frameworks
|
||||
|
||||
(use-package! rspec-mode
|
||||
:mode ("/\\.rspec\\'" . text-mode)
|
||||
|
|
|
@ -40,13 +40,14 @@ To get started with Rust, you can either use =rustup= and install rust with:
|
|||
Package manager is not recommended to install Nightly version of Rust what is
|
||||
required for ~racer~ from [[https://github.com/racer-rust/racer#installation][version 2.1]] (more info in [[#Troubleshooting][Troubleshooting]])
|
||||
|
||||
Some commands require additional crates to be installed to work, e.g. ~cargo
|
||||
add~.
|
||||
#+BEGIN_SRC sh
|
||||
rustup component add rustfmt
|
||||
rustup component add cargo-check
|
||||
rustup component add cargo-edit
|
||||
#+END_SRC
|
||||
Some features have additional dependencies:
|
||||
|
||||
+ The ~:editor format~ module uses ~rustfmt~ for rust files: ~rustup component
|
||||
add rustfmt-preview~
|
||||
+ The following commands require:
|
||||
+ ~cargo-process-check~: ~cargo install cargo-check~
|
||||
+ ~cargo-process-clippy~: ~rustup component add clippy-preview~
|
||||
+ ~cargo-process-{add,rm,upgrade}~: ~cargo install cargo-edit~
|
||||
|
||||
* Features
|
||||
This module also supports LSP, it requires installation of Rust Language Server
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
:defer t
|
||||
:config
|
||||
(setq rust-indent-method-chain t)
|
||||
(add-hook 'rust-mode-hook #'rainbow-delimiters-mode)
|
||||
|
||||
;; This is necessary because both plugins are fighting for supremacy in
|
||||
;; `auto-mode-alist', so rustic-mode *must* load second. It only needs to
|
||||
|
@ -51,12 +52,22 @@
|
|||
;; use :editor format instead
|
||||
rustic-format-on-save nil)
|
||||
|
||||
;; `rustic-setup-rls' uses `package-installed-p' unnecessarily, which breaks
|
||||
;; because Doom lazy loads package.el.
|
||||
(defadvice! +rust--disable-package-call-a (orig-fn &rest args)
|
||||
(add-hook 'rustic-mode-hook #'rainbow-delimiters-mode)
|
||||
|
||||
(defadvice! +rust--dont-install-packages-p (orig-fn &rest args)
|
||||
:around #'rustic-setup-rls
|
||||
(cl-letf (((symbol-function 'package-installed-p)
|
||||
(symbol-function 'ignore)))
|
||||
(cl-letf (;; `rustic-setup-rls' uses `package-installed-p' to determine if
|
||||
;; lsp-mode/elgot are available. This breaks because Doom doesn't
|
||||
;; use package.el to begin with (and lazy loads it).
|
||||
((symbol-function #'package-installed-p)
|
||||
(lambda (pkg)
|
||||
(require pkg nil t)))
|
||||
;; If lsp/elgot isn't available, it attempts to install lsp-mode
|
||||
;; via package.el. Doom manages its own dependencies so we disable
|
||||
;; that behavior.
|
||||
((symbol-function #'rustic-install-rls-client-p)
|
||||
(lambda (&rest _)
|
||||
(message "No RLS server running."))))
|
||||
(apply orig-fn args))))
|
||||
|
||||
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
;; indent block comments to first asterix, not second
|
||||
scala-indent:use-javadoc-style t)
|
||||
|
||||
(setq-hook! 'scala-mode-hook comment-line-break-function #'+scala-comment-indent-new-line)
|
||||
(setq-hook! 'scala-mode-hook
|
||||
comment-line-break-function #'+scala-comment-indent-new-line)
|
||||
|
||||
(after! dtrt-indent
|
||||
(add-to-list 'dtrt-indent-hook-mapping-list '(scala-mode c/c++/java scala-indent:step)))
|
||||
|
@ -14,23 +15,6 @@
|
|||
(add-hook 'scala-mode-local-vars-hook #'lsp!)))
|
||||
|
||||
|
||||
(use-package! ensime
|
||||
:unless (featurep! +lsp)
|
||||
:defer t
|
||||
:config
|
||||
(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))
|
||||
|
||||
|
||||
(use-package! sbt-mode
|
||||
:after scala-mode
|
||||
:config (set-repl-handler! 'scala-mode #'+scala/open-repl))
|
||||
|
|
9
modules/lang/scala/doctor.el
Normal file
9
modules/lang/scala/doctor.el
Normal file
|
@ -0,0 +1,9 @@
|
|||
;;; lang/scala/doctor.el -*- lexical-binding: t; -*-
|
||||
|
||||
(assert! (or (not (featurep! +lsp))
|
||||
(featurep! :tools lsp))
|
||||
"This module requires (:tools lsp)")
|
||||
|
||||
(if (and (featurep! +lsp)
|
||||
(not (executable-find "metals-emacs")))
|
||||
(warn! "metals-emacs isn't installed"))
|
|
@ -3,9 +3,3 @@
|
|||
|
||||
(package! sbt-mode)
|
||||
(package! scala-mode)
|
||||
|
||||
(unless (featurep! +lsp)
|
||||
;; Fix #1697: Ensime doesn't have a master branch and its MELPA recipe doesn't
|
||||
;; specify a branch. Straight can't handle packages with non-standard primary
|
||||
;; branches (at the time of writing), so we must specify it manually:
|
||||
(package! ensime :recipe (:branch "2.0")))
|
||||
|
|
|
@ -1,39 +1,42 @@
|
|||
;;; lang/scheme/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###package scheme
|
||||
(add-hook 'scheme-mode-hook #'rainbow-delimiters-mode)
|
||||
|
||||
(def-package! geiser
|
||||
:mode ("\\.scm\\'" . scheme-mode)
|
||||
:mode ("\\.ss\\'" . scheme-mode)
|
||||
:commands (geiser)
|
||||
|
||||
(use-package! geiser
|
||||
:defer t
|
||||
:init
|
||||
(setq geiser-active-implementations '(guile chicken mit chibi chez))
|
||||
(set-repl-handler! 'scheme-mode '+scheme/repl)
|
||||
(set-eval-handler! 'scheme-mode #'geiser-eval-region)
|
||||
(set-lookup-handlers! 'scheme-mode
|
||||
:definition #'geiser-edit-symbol-at-point
|
||||
:documentation #'geiser-doc-symbol-at-point)
|
||||
(unless (featurep! :lang racket)
|
||||
(push 'racket geiser-active-implementations))
|
||||
(after! scheme ; built-in
|
||||
(set-repl-handler! 'scheme-mode '+scheme/repl)
|
||||
(set-eval-handler! 'scheme-mode #'geiser-eval-region)
|
||||
(set-lookup-handlers! 'scheme-mode
|
||||
:definition #'geiser-edit-symbol-at-point
|
||||
:documentation #'geiser-doc-symbol-at-point))
|
||||
:config
|
||||
(map! (:localleader
|
||||
(:map scheme-mode-map
|
||||
"'" #'geiser-mode-switch-to-repl
|
||||
"s" #'geiser-set-scheme
|
||||
(map! :localleader
|
||||
:map scheme-mode-map
|
||||
"'" #'geiser-mode-switch-to-repl
|
||||
"s" #'geiser-set-scheme
|
||||
|
||||
(:prefix ("e" . "eval")
|
||||
"b" #'geiser-eval-buffer
|
||||
"B" #'geiser-eval-buffer-and-go
|
||||
"e" #'geiser-eval-definition
|
||||
"E" #'geiser-eval-definition-and-go
|
||||
"r" #'geiser-eval-region
|
||||
"R" #'geiser-eval-region-and-go)
|
||||
(:prefix ("e" . "eval")
|
||||
"b" #'geiser-eval-buffer
|
||||
"B" #'geiser-eval-buffer-and-go
|
||||
"e" #'geiser-eval-definition
|
||||
"E" #'geiser-eval-definition-and-go
|
||||
"r" #'geiser-eval-region
|
||||
"R" #'geiser-eval-region-and-go)
|
||||
|
||||
(:prefix ("h" . "help")
|
||||
"d" 'geiser-autodoc)
|
||||
;; TODO add more help keybindings
|
||||
(:prefix ("h" . "help")
|
||||
"d" 'geiser-autodoc)
|
||||
;; TODO add more help keybindings
|
||||
|
||||
(:prefix ("r" . "repl")
|
||||
"b" #'geiser-switch-to-repl
|
||||
"q" #'geiser-repl-exit
|
||||
"r" #'geiser-restart-repl
|
||||
"R" #'geiser-reload
|
||||
"c" #'geiser-repl-clear-buffer)))))
|
||||
(:prefix ("r" . "repl")
|
||||
"b" #'geiser-switch-to-repl
|
||||
"q" #'geiser-repl-exit
|
||||
"r" #'geiser-restart-repl
|
||||
"R" #'geiser-reload
|
||||
"c" #'geiser-repl-clear-buffer)))
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
;;; lang/sh/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(defvar +sh-builtin-keywords
|
||||
'("cat" "cat" "cd" "chmod" "chown" "cp" "curl" "date" "echo" "find" "git"
|
||||
"grep" "kill" "less" "ls" "make" "mkdir" "mv" "pgrep" "pkill" "pwd"
|
||||
"rm" "sleep" "sudo" "touch")
|
||||
'("cat" "cd" "chmod" "chown" "cp" "curl" "date" "echo" "find" "git" "grep"
|
||||
"kill" "less" "ln" "ls" "make" "mkdir" "mv" "pgrep" "pkill" "pwd" "rm"
|
||||
"sleep" "sudo" "touch")
|
||||
"A list of common shell commands to be fontified especially in `sh-mode'.")
|
||||
|
||||
|
||||
;;
|
||||
;; Packages
|
||||
;;; Packages
|
||||
|
||||
(use-package! sh-script ; built-in
|
||||
:mode ("\\.zunit\\'" . sh-mode)
|
||||
|
@ -43,7 +43,7 @@
|
|||
(2 'font-lock-variable-name-face prepend))
|
||||
(+sh--match-command-subst-in-quotes
|
||||
(1 'sh-quoted-exec prepend))
|
||||
(,(regexp-opt +sh-builtin-keywords 'words)
|
||||
(,(regexp-opt +sh-builtin-keywords 'symbols)
|
||||
(0 'font-lock-type-face append))))))
|
||||
;; 4. Fontify delimiters by depth
|
||||
(add-hook 'sh-mode-hook #'rainbow-delimiters-mode)
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
;;
|
||||
;; Packages
|
||||
|
||||
;; `solidity-mode'
|
||||
;;;###package solidity-mode
|
||||
(setq solidity-comment-style 'slash)
|
||||
|
||||
|
||||
|
@ -22,5 +22,5 @@
|
|||
:when (featurep! :completion company)
|
||||
:after solidity-mode
|
||||
:config
|
||||
(setq company-backends (delq 'company-solidity company-backends))
|
||||
(delq! 'company-solidity company-backends)
|
||||
(set-company-backend! 'solidity-mode 'company-solidity))
|
||||
|
|
|
@ -5,15 +5,15 @@
|
|||
|
||||
|
||||
(use-package! flycheck-swift
|
||||
:when (and (featurep! :tools flycheck)
|
||||
(not (featurep! +lsp)))
|
||||
:when (featurep! :tools flycheck)
|
||||
:unless (featurep! +lsp)
|
||||
:after swift-mode
|
||||
:config (flycheck-swift-setup))
|
||||
|
||||
|
||||
(use-package! company-sourcekit
|
||||
:when (and (featurep! :completion company)
|
||||
(not (featurep! +lsp)))
|
||||
:when (featurep! :completion company)
|
||||
:unless (featurep! +lsp)
|
||||
:after swift-mode
|
||||
:config
|
||||
(set-company-backend! 'swift-mode '(company-sourcekit company-yasnippet)))
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
;;; lang/lua/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;
|
||||
;; Major modes
|
||||
;;; Major modes
|
||||
|
||||
(use-package! terra-mode
|
||||
:defer t
|
||||
:config
|
||||
(set-lookup-handlers! 'terra-mode :documentation 'terra-search-documentation)
|
||||
(after! terra-mode
|
||||
(set-lookup-handlers! 'terra-mode
|
||||
:documentation #'terra-search-documentation)
|
||||
(set-electric! 'terra-mode :words '("else" "end"))
|
||||
(set-repl-handler! 'terra-mode #'+terra/open-repl)
|
||||
(set-company-backend! 'terra-mode '(company-lua company-yasnippet)))
|
||||
|
|
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