merge develop
This commit is contained in:
commit
4b435f880b
30 changed files with 210 additions and 133 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,5 +1,4 @@
|
||||||
.local/
|
.local/
|
||||||
.cask/
|
|
||||||
var/
|
var/
|
||||||
modules/private/
|
modules/private/
|
||||||
.yas-compiled-snippets.el
|
.yas-compiled-snippets.el
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -1,4 +1,4 @@
|
||||||
DOOM = bin/doom
|
DOOM = "bin/doom"
|
||||||
MODULES = $(patsubst modules/%/, %, $(sort $(dir $(wildcard modules/*/ modules/*/*/))))
|
MODULES = $(patsubst modules/%/, %, $(sort $(dir $(wildcard modules/*/ modules/*/*/))))
|
||||||
|
|
||||||
all:
|
all:
|
||||||
|
|
19
bin/doom.cmd
19
bin/doom.cmd
|
@ -1,13 +1,24 @@
|
||||||
:: Forward the ./doom script to Emacs
|
:: Forward the ./doom script to Emacs
|
||||||
|
|
||||||
@ECHO OFF
|
@ECHO OFF
|
||||||
|
SETLOCAL ENABLEDELAYEDEXPANSION
|
||||||
|
|
||||||
PUSHD "%~dp0" >NUL
|
PUSHD "%~dp0" >NUL
|
||||||
|
|
||||||
IF %1=="run" (
|
SET args=
|
||||||
SHIFT
|
SET command=%1
|
||||||
emacs -Q %* -l init.el -f "doom|run-all-startup-hooks"
|
|
||||||
|
:LOOP
|
||||||
|
SHIFT /1
|
||||||
|
IF NOT [%1]==[] (
|
||||||
|
SET args=%args% %1
|
||||||
|
GOTO :LOOP
|
||||||
|
)
|
||||||
|
|
||||||
|
IF [%command%]==[run] (
|
||||||
|
start runemacs -Q %args% -l ..\init.el -f "doom|run-all-startup-hooks"
|
||||||
) ELSE (
|
) ELSE (
|
||||||
emacs --quick --script ./doom -- %*
|
emacs --quick --script .\doom -- %*
|
||||||
)
|
)
|
||||||
|
|
||||||
POPD >NUL
|
POPD >NUL
|
||||||
|
|
|
@ -40,10 +40,12 @@ ready to be pasted in a bug report on github."
|
||||||
,doom-core-dir
|
,doom-core-dir
|
||||||
,doom-private-dir)
|
,doom-private-dir)
|
||||||
:type 'files :match "\\.elc$"))
|
:type 'files :match "\\.elc$"))
|
||||||
|
(if IS-WINDOWS
|
||||||
|
"n/a"
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(unless (zerop (call-process "uname" nil t nil "-a"))
|
(unless (zerop (call-process "uname" nil t nil "-a"))
|
||||||
(insert (format "%s" system-type)))
|
(insert (format "%s" system-type)))
|
||||||
(string-trim (buffer-string)))
|
(string-trim (buffer-string))))
|
||||||
(or (cl-loop with cat = nil
|
(or (cl-loop with cat = nil
|
||||||
for key being the hash-keys of (doom-modules)
|
for key being the hash-keys of (doom-modules)
|
||||||
if (or (not cat) (not (eq cat (car key))))
|
if (or (not cat) (not (eq cat (car key))))
|
||||||
|
@ -120,6 +122,20 @@ branch and commit."
|
||||||
(or (vc-git-working-revision doom-core-dir)
|
(or (vc-git-working-revision doom-core-dir)
|
||||||
"n/a")))
|
"n/a")))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun doom/copy-backtrace ()
|
||||||
|
"Copy the first 1000 bytes from the *Backtrace* window into your clipboard for
|
||||||
|
easy pasting into a bug report or discord."
|
||||||
|
(interactive)
|
||||||
|
(if-let* ((buf (get-buffer "*Backtrace*")))
|
||||||
|
(with-current-buffer buf
|
||||||
|
(kill-new
|
||||||
|
(string-trim
|
||||||
|
(buffer-substring-no-properties
|
||||||
|
(point-min)
|
||||||
|
(min (point-max) 1000)))))
|
||||||
|
(user-error "No backtrace buffer detected")))
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Vanilla sandbox
|
;; Vanilla sandbox
|
||||||
|
|
2
init.el
2
init.el
|
@ -27,7 +27,7 @@
|
||||||
;;
|
;;
|
||||||
;;; License: MIT
|
;;; License: MIT
|
||||||
|
|
||||||
(unless (boundp 'early-init-file)
|
(unless (bound-and-true-p early-init-file)
|
||||||
(load (concat (file-name-directory load-file-name) "early-init")
|
(load (concat (file-name-directory load-file-name) "early-init")
|
||||||
nil t))
|
nil t))
|
||||||
|
|
||||||
|
|
|
@ -248,10 +248,8 @@ order.
|
||||||
(t
|
(t
|
||||||
(file-relative-name directory project-root))))))
|
(file-relative-name directory project-root))))))
|
||||||
(require 'counsel)
|
(require 'counsel)
|
||||||
(cl-letf (((symbol-function 'counsel-ag-function)
|
(let ((counsel-more-chars-alist
|
||||||
(symbol-function '+ivy*counsel-ag-function))
|
(if query '((t . 1)) counsel-more-chars-alist)))
|
||||||
((symbol-function 'counsel-git-grep-function)
|
|
||||||
(symbol-function '+ivy*counsel-git-grep-function)))
|
|
||||||
(pcase engine
|
(pcase engine
|
||||||
('grep
|
('grep
|
||||||
(let ((args (if recursive " -R"))
|
(let ((args (if recursive " -R"))
|
||||||
|
@ -363,41 +361,3 @@ non-nil)."
|
||||||
non-nil)."
|
non-nil)."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(+ivy-file-search 'grep :query query :in default-directory :recursive recursive-p))
|
(+ivy-file-search 'grep :query query :in default-directory :recursive recursive-p))
|
||||||
|
|
||||||
|
|
||||||
;;
|
|
||||||
;; Advice
|
|
||||||
;;
|
|
||||||
|
|
||||||
;;;###autoload
|
|
||||||
(defun +ivy*counsel-ag-function (string)
|
|
||||||
"Advice to get rid of the character limit from `counsel-ag-function'.
|
|
||||||
|
|
||||||
NOTE This may need to be updated frequently, to meet changes upstream (in
|
|
||||||
counsel-rg)."
|
|
||||||
(if (< (length string) 1) ; <-- modified the character limit
|
|
||||||
(counsel-more-chars 1) ; <--
|
|
||||||
(let ((default-directory (ivy-state-directory ivy-last))
|
|
||||||
(regex (counsel-unquote-regex-parens
|
|
||||||
(setq ivy--old-re
|
|
||||||
(ivy--regex string)))))
|
|
||||||
(counsel--async-command (format counsel-ag-command
|
|
||||||
(shell-quote-argument regex)))
|
|
||||||
nil)))
|
|
||||||
|
|
||||||
;;;###autoload
|
|
||||||
(defun +ivy*counsel-git-grep-function (string)
|
|
||||||
"Advice to get rid of the character limit from `counsel-git-grep-function'.
|
|
||||||
|
|
||||||
NOTE This may need to be updated frequently, to meet changes upstream (in
|
|
||||||
counsel-git-grep)."
|
|
||||||
(if (and (> counsel--git-grep-count counsel--git-grep-count-threshold)
|
|
||||||
(< (length string) 1)) ; <-- modified the character limit
|
|
||||||
(counsel-more-chars 1) ; <--
|
|
||||||
(let* ((default-directory (ivy-state-directory ivy-last))
|
|
||||||
(cmd (format counsel-git-grep-cmd
|
|
||||||
(setq ivy--old-re (ivy--regex string t)))))
|
|
||||||
(if (<= counsel--git-grep-count counsel--git-grep-count-threshold)
|
|
||||||
(split-string (shell-command-to-string cmd) "\n" t)
|
|
||||||
(counsel--gg-candidates (ivy--regex string))
|
|
||||||
nil))))
|
|
||||||
|
|
|
@ -197,7 +197,7 @@ immediately runs it on the current candidate (ending the ivy session)."
|
||||||
|
|
||||||
;; posframe doesn't work well with async sources
|
;; posframe doesn't work well with async sources
|
||||||
(dolist (fn '(swiper counsel-rg counsel-ag counsel-pt counsel-grep counsel-git-grep))
|
(dolist (fn '(swiper counsel-rg counsel-ag counsel-pt counsel-grep counsel-git-grep))
|
||||||
(setf (alist-get fn ivy-display-functions-alist) nil)))
|
(setf (alist-get fn ivy-display-functions-alist) #'ivy-display-function-fallback)))
|
||||||
|
|
||||||
|
|
||||||
(def-package! flx
|
(def-package! flx
|
||||||
|
|
|
@ -170,12 +170,14 @@
|
||||||
"a" (evilem-create #'evil-forward-arg)
|
"a" (evilem-create #'evil-forward-arg)
|
||||||
"A" (evilem-create #'evil-backward-arg)
|
"A" (evilem-create #'evil-backward-arg)
|
||||||
"s" (evilem-create #'evil-snipe-repeat
|
"s" (evilem-create #'evil-snipe-repeat
|
||||||
|
:name 'evil-easymotion-snipe-forward
|
||||||
:pre-hook (save-excursion (call-interactively #'evil-snipe-s))
|
:pre-hook (save-excursion (call-interactively #'evil-snipe-s))
|
||||||
:bind ((evil-snipe-scope 'buffer)
|
:bind ((evil-snipe-scope 'buffer)
|
||||||
(evil-snipe-enable-highlight)
|
(evil-snipe-enable-highlight)
|
||||||
(evil-snipe-enable-incremental-highlight)))
|
(evil-snipe-enable-incremental-highlight)))
|
||||||
"S" (evilem-create #'evil-snipe-repeat-reverse
|
"S" (evilem-create #'evil-snipe-repeat
|
||||||
:pre-hook (save-excursion (call-interactively #'evil-snipe-s))
|
:name 'evil-easymotion-snipe-backward
|
||||||
|
:pre-hook (save-excursion (call-interactively #'evil-snipe-S))
|
||||||
:bind ((evil-snipe-scope 'buffer)
|
:bind ((evil-snipe-scope 'buffer)
|
||||||
(evil-snipe-enable-highlight)
|
(evil-snipe-enable-highlight)
|
||||||
(evil-snipe-enable-incremental-highlight)))
|
(evil-snipe-enable-incremental-highlight)))
|
||||||
|
@ -838,5 +840,5 @@
|
||||||
|
|
||||||
;; Evil-collection fixes
|
;; Evil-collection fixes
|
||||||
(setq evil-collection-key-blacklist
|
(setq evil-collection-key-blacklist
|
||||||
(list "C-j" "C-k" "gd" "gf" "K" "[" "]"
|
(list "C-j" "C-k" "gd" "gf" "K" "[" "]" "gz"
|
||||||
doom-leader-key doom-localleader-key))
|
doom-leader-key doom-localleader-key))
|
||||||
|
|
|
@ -111,7 +111,8 @@ command from the current directory instead of the project root."
|
||||||
(ex! "grep" #'+helm:grep)
|
(ex! "grep" #'+helm:grep)
|
||||||
(ex! "grepc[wd]" #'+helm:grep-from-cwd)
|
(ex! "grepc[wd]" #'+helm:grep-from-cwd)
|
||||||
(ex! "sw[oop]" #'+helm:swoop)
|
(ex! "sw[oop]" #'+helm:swoop)
|
||||||
(ex! "todo" #'+helm:todo)))
|
;; (ex! "todo" #'+helm:todo) TODO implement `+helm:todo'
|
||||||
|
))
|
||||||
;; Project tools
|
;; Project tools
|
||||||
(ex! "mak[e]" #'doom:make)
|
(ex! "mak[e]" #'doom:make)
|
||||||
(ex! "debug" #'+debug/run)
|
(ex! "debug" #'+debug/run)
|
||||||
|
@ -135,5 +136,5 @@ command from the current directory instead of the project root."
|
||||||
(ex! "tabs" #'+workspace/display)
|
(ex! "tabs" #'+workspace/display)
|
||||||
(ex! "tabsave" #'+workspace:save)
|
(ex! "tabsave" #'+workspace:save)
|
||||||
;; Org-mode
|
;; Org-mode
|
||||||
(ex! "cap" #'+org-capture/dwim)
|
(ex! "cap" #'org-capture)
|
||||||
|
|
||||||
|
|
|
@ -8,5 +8,4 @@
|
||||||
(after! term
|
(after! term
|
||||||
(set-env! "SHELL")
|
(set-env! "SHELL")
|
||||||
|
|
||||||
;; Consider term buffers real
|
|
||||||
(add-hook 'term-mode-hook #'doom|mark-buffer-as-real))
|
(add-hook 'term-mode-hook #'doom|mark-buffer-as-real))
|
||||||
|
|
|
@ -18,7 +18,11 @@
|
||||||
(funcall (if same-window-p #'switch-to-buffer #'pop-to-buffer)
|
(funcall (if same-window-p #'switch-to-buffer #'pop-to-buffer)
|
||||||
(if (buffer-live-p buffer)
|
(if (buffer-live-p buffer)
|
||||||
buffer
|
buffer
|
||||||
(setq buffer (save-window-excursion (call-interactively command)))
|
(setq buffer
|
||||||
|
(save-window-excursion
|
||||||
|
(if (commandp command)
|
||||||
|
(call-interactively command)
|
||||||
|
(funcall command))))
|
||||||
(unless (bufferp buffer)
|
(unless (bufferp buffer)
|
||||||
(error "REPL command didn't return a buffer"))
|
(error "REPL command didn't return a buffer"))
|
||||||
(with-current-buffer buffer (+eval-repl-mode +1))
|
(with-current-buffer buffer (+eval-repl-mode +1))
|
||||||
|
|
|
@ -9,10 +9,11 @@
|
||||||
`+eval/open-repl' and filled with the `:repl' setting.")
|
`+eval/open-repl' and filled with the `:repl' setting.")
|
||||||
|
|
||||||
;;;###autodef
|
;;;###autodef
|
||||||
(defun set-repl-handler! (mode command)
|
(defun set-repl-handler! (modes command)
|
||||||
"Define a REPL for a mode. MODE is a major mode symbol and COMMAND is a
|
"Define a REPL for MODES. MODES is either a single major mode symbol or a list
|
||||||
function that creates and returns the REPL buffer."
|
of them. COMMAND is a function that creates and returns the REPL buffer."
|
||||||
(push (cons mode command) +eval-repls))
|
(dolist (mode (doom-enlist modes))
|
||||||
|
(setf (alist-get mode +eval-repls) command)))
|
||||||
|
|
||||||
;; FIXME obsolete :repl
|
;; FIXME obsolete :repl
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
|
|
@ -50,16 +50,24 @@ cursor at the final match. If BANG, then treat PATTERN as literal."
|
||||||
:move-point nil
|
:move-point nil
|
||||||
:evil-mc t
|
:evil-mc t
|
||||||
(interactive "<R><//g><!>")
|
(interactive "<R><//g><!>")
|
||||||
|
(unless (and (stringp pattern)
|
||||||
|
(not (string-empty-p pattern)))
|
||||||
|
(user-error "A regexp pattern is required"))
|
||||||
(require 'evil-mc)
|
(require 'evil-mc)
|
||||||
(setq evil-mc-pattern (cons (evil-mc-make-pattern (if bang (regexp-quote pattern) pattern) nil)
|
(setq evil-mc-pattern
|
||||||
|
(cons (evil-ex-make-search-pattern
|
||||||
|
(if bang (regexp-quote pattern) pattern))
|
||||||
(list beg end type)))
|
(list beg end type)))
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(evil-with-restriction beg end
|
(evil-with-restriction beg end
|
||||||
(evil-mc-make-cursors-for-all)
|
(evil-mc-make-cursors-for-all)))
|
||||||
(evil-mc-print-cursors-info "Created")))
|
|
||||||
(evil-exit-visual-state)
|
(evil-exit-visual-state)
|
||||||
(evil-mc-goto-cursor
|
(evil-mc-goto-cursor
|
||||||
(if (= (evil-visual-direction) 1)
|
(if (= (evil-visual-direction) 1)
|
||||||
(evil-mc-find-last-cursor)
|
(evil-mc-find-last-cursor)
|
||||||
(evil-mc-find-first-cursor))
|
(evil-mc-find-first-cursor))
|
||||||
nil))
|
nil)
|
||||||
|
(evil-mc-undo-cursor-at-pos (point))
|
||||||
|
(if (evil-mc-has-cursors-p)
|
||||||
|
(evil-mc-print-cursors-info "Created")
|
||||||
|
(evil-mc-message "No cursors were created")))
|
||||||
|
|
|
@ -18,9 +18,13 @@ these properties:
|
||||||
Provides a secondary predicate. This function takes no arguments and is
|
Provides a secondary predicate. This function takes no arguments and is
|
||||||
executed from within the target buffer. If it returns nil, this rule will be
|
executed from within the target buffer. If it returns nil, this rule will be
|
||||||
skipped over.
|
skipped over.
|
||||||
:trigger
|
:trigger STRING|FUNCTION
|
||||||
The yasnippet trigger keyword used to trigger the target snippet. If
|
If a string, this is the yasnippet trigger keyword used to trigger the
|
||||||
omitted, `+file-templates-default-trigger' is used.
|
target snippet.
|
||||||
|
If a function, this function will be run in the context of the buffer to
|
||||||
|
insert a file template into. It is given no arguments and must insert text
|
||||||
|
into the current buffer manually.
|
||||||
|
If omitted, `+file-templates-default-trigger' is used.
|
||||||
:mode SYMBOL
|
:mode SYMBOL
|
||||||
What mode to get the yasnippet snippet from. If omitted, either PRED (if
|
What mode to get the yasnippet snippet from. If omitted, either PRED (if
|
||||||
it's a major-mode symbol) or the mode of the buffer is used.
|
it's a major-mode symbol) or the mode of the buffer is used.
|
||||||
|
@ -69,6 +73,8 @@ evil is loaded and enabled)."
|
||||||
(user-error "Couldn't determine mode for %s file template" pred))
|
(user-error "Couldn't determine mode for %s file template" pred))
|
||||||
(unless trigger
|
(unless trigger
|
||||||
(setq trigger +file-templates-default-trigger))
|
(setq trigger +file-templates-default-trigger))
|
||||||
|
(if (functionp trigger)
|
||||||
|
(funcall trigger)
|
||||||
(require 'yasnippet)
|
(require 'yasnippet)
|
||||||
(unless yas-minor-mode
|
(unless yas-minor-mode
|
||||||
(yas-minor-mode-on))
|
(yas-minor-mode-on))
|
||||||
|
@ -81,7 +87,7 @@ evil is loaded and enabled)."
|
||||||
(and yas--active-field-overlay
|
(and yas--active-field-overlay
|
||||||
(overlay-buffer yas--active-field-overlay)
|
(overlay-buffer yas--active-field-overlay)
|
||||||
(overlay-get yas--active-field-overlay 'yas--field)))
|
(overlay-get yas--active-field-overlay 'yas--field)))
|
||||||
(evil-initialize-state 'insert)))))
|
(evil-initialize-state 'insert))))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +file-templates-get-short-path ()
|
(defun +file-templates-get-short-path ()
|
||||||
|
|
|
@ -37,7 +37,7 @@ don't have a :trigger property in `+file-templates-alist'.")
|
||||||
("\\.c\\(?:c\\|pp\\)$" :trigger "__cpp" :mode c++-mode)
|
("\\.c\\(?:c\\|pp\\)$" :trigger "__cpp" :mode c++-mode)
|
||||||
("\\.h\\(?:h\\|pp\\|xx\\)$" :trigger "__hpp" :mode c++-mode)
|
("\\.h\\(?:h\\|pp\\|xx\\)$" :trigger "__hpp" :mode c++-mode)
|
||||||
("\\.h$" :trigger "__h" :mode c-mode)
|
("\\.h$" :trigger "__h" :mode c-mode)
|
||||||
(c-mode :trigger "__c" :mode c-mode)
|
(c-mode :trigger "__c")
|
||||||
;; go
|
;; go
|
||||||
("/main\\.go$" :trigger "__main.go" :mode go-mode :project t)
|
("/main\\.go$" :trigger "__main.go" :mode go-mode :project t)
|
||||||
(go-mode :trigger "__.go")
|
(go-mode :trigger "__.go")
|
||||||
|
|
|
@ -5,5 +5,4 @@
|
||||||
:hook (haskell-mode . dante-mode)
|
:hook (haskell-mode . dante-mode)
|
||||||
:config
|
:config
|
||||||
(when (featurep! :feature syntax-checker)
|
(when (featurep! :feature syntax-checker)
|
||||||
(add-hook! 'dante-mode-hook
|
(flycheck-add-next-checker 'haskell-dante '(warning . haskell-hlint))))
|
||||||
(flycheck-add-next-checker 'haskell-dante '(warning . haskell-hlint)))))
|
|
||||||
|
|
|
@ -13,4 +13,6 @@ This is necessary because `intero-mode' doesn't do its own error checks."
|
||||||
(message "Couldn't find stack. Refusing to enable intero-mode."))))
|
(message "Couldn't find stack. Refusing to enable intero-mode."))))
|
||||||
(add-hook 'haskell-mode-hook #'+haskell|init-intero)
|
(add-hook 'haskell-mode-hook #'+haskell|init-intero)
|
||||||
:config
|
:config
|
||||||
(set-lookup-handlers! 'intero-mode :definition #'intero-goto-definition))
|
(set-lookup-handlers! 'intero-mode :definition #'intero-goto-definition)
|
||||||
|
(when (featurep! :feature syntax-checker)
|
||||||
|
(flycheck-add-next-checker 'intero '(warning . haskell-hlint))))
|
||||||
|
|
15
modules/lang/haskell/autoload.el
Normal file
15
modules/lang/haskell/autoload.el
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
;;; lang/haskell/autoload.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun +haskell-repl-buffer ()
|
||||||
|
"Returns the appropriate Haskell REPL buffer."
|
||||||
|
(if (featurep! +intero)
|
||||||
|
(intero-repl-buffer arg)
|
||||||
|
(haskell-session-interactive-buffer (haskell-session))))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun +haskell/repl (&optional arg)
|
||||||
|
"Opens a Haskell REPL."
|
||||||
|
(interactive "P")
|
||||||
|
(display-buffer (+haskell-repl-buffer)))
|
||||||
|
|
|
@ -11,6 +11,9 @@
|
||||||
:hook (haskell-mode . hindent-mode))
|
:hook (haskell-mode . hindent-mode))
|
||||||
|
|
||||||
(after! haskell-mode
|
(after! haskell-mode
|
||||||
(set-repl-handler! 'haskell-mode #'switch-to-haskell)
|
(add-hook 'haskell-mode-hook #'interactive-haskell-mode)
|
||||||
|
(set-lookup-handlers! 'haskell-mode :definition #'haskell-mode-jump-to-def-or-tag)
|
||||||
|
(set-file-template! 'haskell-mode :trigger #'haskell-auto-insert-module-template :project t)
|
||||||
|
(set-repl-handler! '(haskell-mode haskell-cabal-mode literate-haskell-mode) #'+haskell-repl-buffer)
|
||||||
(add-to-list 'completion-ignored-extensions ".hi"))
|
(add-to-list 'completion-ignored-extensions ".hi"))
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,7 @@
|
||||||
|
|
||||||
(when (featurep! +dante)
|
(when (featurep! +dante)
|
||||||
(unless (executable-find "cabal")
|
(unless (executable-find "cabal")
|
||||||
(warn! "Couldn't find cabal, haskell-mode may have issues"))
|
(warn! "Couldn't find cabal, haskell-mode may have issues")))
|
||||||
(unless (executable-find "hlint")
|
|
||||||
(warn! "Couldn't find hlint. Flycheck may have issues in haskell-mode")))
|
|
||||||
|
|
||||||
(when (featurep! +intero)
|
(when (featurep! +intero)
|
||||||
(unless (executable-find "stack")
|
(unless (executable-find "stack")
|
||||||
|
@ -14,3 +12,8 @@
|
||||||
(unless (executable-find "hindent")
|
(unless (executable-find "hindent")
|
||||||
(warn! "Couldn't find hindent. hindent-mode won't work"))
|
(warn! "Couldn't find hindent. hindent-mode won't work"))
|
||||||
|
|
||||||
|
(when (or (featurep! +dante) (featurep! +intero))
|
||||||
|
(unless (executable-find "hlint")
|
||||||
|
(warn! "Couldn't find hlint. Flycheck may have issues in haskell-mode")))
|
||||||
|
|
||||||
|
|
||||||
|
|
21
modules/lang/nix/config.el
Normal file
21
modules/lang/nix/config.el
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
;;; lang/nix/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
(after! nix-mode
|
||||||
|
(set-company-backend! 'nix-mode 'company-nixos-options)
|
||||||
|
|
||||||
|
(map! :map nix-mode-map
|
||||||
|
:localleader
|
||||||
|
:n "f" #'nix-update-fetch
|
||||||
|
:n "p" #'nix-format-buffer
|
||||||
|
:n "r" #'nix-repl-show
|
||||||
|
:n "s" #'nix-shell
|
||||||
|
:n "b" #'nix-build
|
||||||
|
:n "u" #'nix-unpack
|
||||||
|
(:when (featurep! :completion helm)
|
||||||
|
:n "o" #'helm-nixos-options)))
|
||||||
|
|
||||||
|
(def-package! nix-update
|
||||||
|
:commands (nix-update-fetch))
|
||||||
|
|
||||||
|
(def-package! nix-repl
|
||||||
|
:commands (nix-repl-show))
|
9
modules/lang/nix/doctor.el
Normal file
9
modules/lang/nix/doctor.el
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
;; -*- lexical-binding: t; no-byte-compile: t; -*-
|
||||||
|
;;; lang/nix/doctor.el
|
||||||
|
|
||||||
|
(unless (executable-find "nix")
|
||||||
|
(warn! "Couldn't find the nix package manager. nix-mode won't work."))
|
||||||
|
|
||||||
|
(unless (executable-find "nixfmt")
|
||||||
|
(warn! "Couldn't find nixfmt. nix-format-buffer won't work."))
|
||||||
|
|
|
@ -2,3 +2,11 @@
|
||||||
;;; lang/nix/packages.el
|
;;; lang/nix/packages.el
|
||||||
|
|
||||||
(package! nix-mode)
|
(package! nix-mode)
|
||||||
|
|
||||||
|
(package! nix-update)
|
||||||
|
|
||||||
|
(when (featurep! :completion company)
|
||||||
|
(package! company-nixos-options))
|
||||||
|
|
||||||
|
(when (featurep! :completion helm)
|
||||||
|
(package! helm-nixos-options))
|
||||||
|
|
|
@ -18,7 +18,8 @@ path too.")
|
||||||
(add-to-list 'org-export-backends 'pandoc nil #'eq)
|
(add-to-list 'org-export-backends 'pandoc nil #'eq)
|
||||||
(setq org-pandoc-options
|
(setq org-pandoc-options
|
||||||
'((standalone . t)
|
'((standalone . t)
|
||||||
(mathjax . t))))
|
(mathjax . t)
|
||||||
|
(variable . "revealjs-url=https://cdn.jsdelivr.net/npm/reveal.js@3/"))))
|
||||||
|
|
||||||
;;
|
;;
|
||||||
(defun +org|init-export ()
|
(defun +org|init-export ()
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
(def-package! ox-reveal
|
(def-package! ox-reveal
|
||||||
:defer t
|
:defer t
|
||||||
:config
|
:config
|
||||||
(setq org-reveal-root "http://cdn.jsdelivr.net/reveal.js/3.0.0/"
|
(setq org-reveal-root "https://cdn.jsdelivr.net/npm/reveal.js@3/"
|
||||||
org-reveal-mathjax t))
|
org-reveal-mathjax t))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,21 +1,33 @@
|
||||||
;;; lang/python/+conda.el -*- lexical-binding: t; -*-
|
;;; lang/python/+conda.el -*- lexical-binding: t; -*-
|
||||||
;;;###if (featurep! +conda)
|
;;;###if (featurep! +conda)
|
||||||
|
|
||||||
;; This file add conda support to doom-emacs. To get started, try `M-x'
|
;; Adds conda support to Doom Emacs. `conda-anaconda-home' should be the path to
|
||||||
;; `+python/set-conda-home' and then `M-x' `conda-env-activate'.
|
;; your anaconda installation, and will be guessed from the following:
|
||||||
|
;;
|
||||||
|
;; + ~/.anaconda3
|
||||||
|
;; + ~/.anaconda
|
||||||
|
;; + ~/usr/bin/anaconda3
|
||||||
|
;;
|
||||||
|
;; If none of these work, you'll need to set `conda-anaconda-home' yourself.
|
||||||
|
;;
|
||||||
|
;; Once set, run M-x `conda-env-activate' to switch between environments OR turn
|
||||||
|
;; on `conda-env-autoactivate-mode' if you want it done automatically.
|
||||||
|
|
||||||
(def-package! conda
|
(def-package! conda
|
||||||
:when (featurep! +conda)
|
:when (featurep! +conda)
|
||||||
:after (python)
|
:after python
|
||||||
:init
|
|
||||||
(defvar +python-conda-home '("~/.anaconda3" "/usr/bin/anaconda3" "~/.anaconda")
|
|
||||||
"A list of host pattern and corresponding anaconda home.")
|
|
||||||
:config
|
:config
|
||||||
(advice-add 'anaconda-mode-bootstrap :override #'+python*anaconda-mode-bootstrap)
|
(unless (cl-loop for dir in (list conda-anaconda-home "/usr/bin/anaconda3" "~/.anaconda")
|
||||||
(conda-env-autoactivate-mode -1)
|
if (file-directory-p dir)
|
||||||
;; (add-hook 'python-mode-hook #'conda-env-activate-for-buffer)
|
return (setq conda-anaconda-home dir
|
||||||
|
conda-env-home-directory dir))
|
||||||
|
(message "Cannot find Anaconda installation"))
|
||||||
|
|
||||||
|
;; integration with term/eshell
|
||||||
(conda-env-initialize-interactive-shells)
|
(conda-env-initialize-interactive-shells)
|
||||||
(conda-env-initialize-eshell)
|
(after! eshell (conda-env-initialize-eshell))
|
||||||
;; Version management with conda
|
|
||||||
(add-hook 'conda-postactivate-hook #'+python|add-conda-env-to-modeline)
|
(add-hook! '(conda-postactivate-hook conda-postdeactivate-hook)
|
||||||
(add-hook 'conda-postdeactivate-hook #'+python|add-conda-env-to-modeline))
|
#'+python|add-conda-env-to-modeline)
|
||||||
|
|
||||||
|
(advice-add 'anaconda-mode-bootstrap :override #'+python*anaconda-mode-bootstrap-in-remote-environments))
|
||||||
|
|
|
@ -3,25 +3,28 @@
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +python/set-conda-home ()
|
(defun +python/set-conda-home ()
|
||||||
"Set the CONDA HOME.
|
"Set `conda-anaconda-home' (ANACONDA_HOME).
|
||||||
Usually it's `~/.anaconda3' on local machine, but you can also set it to a
|
|
||||||
remote directory using TRAMP syntax such as `/ssh:host:/usr/bin/anaconda3'. In
|
Usually it's `~/.anaconda3' on local machine, but it can be set to a remote
|
||||||
that way you can use the remote conda environment as well as the corresponding
|
directory using TRAMP syntax, e.g. `/ssh:host:/usr/bin/anaconda3'. This way, you
|
||||||
remote python executable and packages."
|
can use a remote conda environment, including the corresponding remote python
|
||||||
|
executable and packages."
|
||||||
(interactive)
|
(interactive)
|
||||||
(ivy-read "Set conda home:" +python-conda-home
|
(require 'conda)
|
||||||
:history +python/set-conda-home--history
|
(when-let* ((home (read-directory-name "Set conda home: " "~" nil nil conda-anaconda-home)))
|
||||||
:action (lambda (cand) (setq conda-anaconda-home cand))))
|
(setq conda-anaconda-home home)
|
||||||
|
(message "Successfully changed conda home to: %s" (abbreviate-file-name home))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +python|add-conda-env-to-modeline ()
|
(defun +python|add-conda-env-to-modeline ()
|
||||||
"Add conda environment string to the major mode in the modeline."
|
"Add conda environment string to the major mode modeline segment."
|
||||||
(setq mode-name
|
(setq mode-name
|
||||||
(if conda-env-current-name
|
(if conda-env-current-name
|
||||||
(format "Py:conda:%s" conda-env-current-name)
|
(format "Py:conda:%s" conda-env-current-name)
|
||||||
"Python")))
|
"Python")))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +python*anaconda-mode-bootstrap (&optional callback)
|
(defun +python*anaconda-mode-bootstrap-in-remote-environments (&optional callback)
|
||||||
"Advice to set up the anaconda-mode even in remote environment.
|
"Advice to set up the anaconda-mode even in remote environment.
|
||||||
Original doc:
|
Original doc:
|
||||||
Run `anaconda-mode' server.
|
Run `anaconda-mode' server.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
;;; lang/python/autoload.el -*- lexical-binding: t; -*-
|
;;; lang/python/autoload/python.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +python/repl ()
|
(defun +python/repl ()
|
|
@ -1,7 +1,7 @@
|
||||||
;;; lang/swift/config.el -*- lexical-binding: t; -*-
|
;;; lang/swift/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;; `swift-mode'
|
(after! swift-mode
|
||||||
(set-repl-handler! 'swift-mode #'run-swift)
|
(set-repl-handler! 'swift-mode #'run-swift))
|
||||||
|
|
||||||
|
|
||||||
(def-package! flycheck-swift
|
(def-package! flycheck-swift
|
||||||
|
|
|
@ -42,15 +42,9 @@ load everything.")
|
||||||
|
|
||||||
|
|
||||||
(def-package! magit-todos
|
(def-package! magit-todos
|
||||||
:after magit
|
:hook (magit-mode . magit-todos-mode)
|
||||||
:config
|
:config
|
||||||
(setq magit-todos-require-colon nil)
|
(setq magit-todos-require-colon nil)
|
||||||
;; `magit-todos-mode' defines keybinds on activation, so it's better to just
|
|
||||||
;; do this manually:
|
|
||||||
(magit-add-section-hook 'magit-status-sections-hook
|
|
||||||
#'magit-todos--insert-todos
|
|
||||||
'magit-insert-staged-changes
|
|
||||||
'append)
|
|
||||||
(define-key magit-todos-section-map "j" nil))
|
(define-key magit-todos-section-map "j" nil))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue