Merge branch 'develop' into add-persistent-soft-package
This commit is contained in:
commit
dc24c1cddc
65 changed files with 490 additions and 373 deletions
|
@ -44,8 +44,7 @@ FRAME parameter defaults to current frame."
|
|||
(let* ((font (frame-parameter nil 'font))
|
||||
(font (doom--font-name font))
|
||||
(increment (* increment doom-font-increment))
|
||||
(zoom-factor (or doom--font-scale 0))
|
||||
success)
|
||||
(zoom-factor (or doom--font-scale 0)))
|
||||
(let ((new-size (+ (string-to-number (aref font xlfd-regexp-pixelsize-subnum))
|
||||
increment)))
|
||||
(unless (> new-size 0)
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
(car (gethash (symbol-name package) straight--build-cache)))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom-package-dependencies (package &optional recursive noerror)
|
||||
(defun doom-package-dependencies (package &optional recursive _noerror)
|
||||
"Return a list of dependencies for a package."
|
||||
(let ((deps (nth 1 (gethash (symbol-name package) straight--build-cache))))
|
||||
(if recursive
|
||||
|
@ -210,11 +210,12 @@ ones."
|
|||
"Return an alist mapping package names (strings) to pinned commits (strings)."
|
||||
(let (alist)
|
||||
(dolist (package doom-packages alist)
|
||||
(with-plist! (cdr package) (recipe modules disable ignore pin unpin)
|
||||
(cl-destructuring-bind (name &key disable ignore pin unpin &allow-other-keys)
|
||||
package
|
||||
(when (and (not ignore)
|
||||
(not disable)
|
||||
(or pin unpin))
|
||||
(setf (alist-get (doom-package-recipe-repo (car package)) alist
|
||||
(setf (alist-get (doom-package-recipe-repo name) alist
|
||||
nil 'remove #'equal)
|
||||
(unless unpin pin)))))))
|
||||
|
||||
|
@ -223,7 +224,9 @@ ones."
|
|||
"Return an alist mapping package names (strings) to pinned commits (strings)."
|
||||
(let (alist)
|
||||
(dolist (package doom-packages alist)
|
||||
(with-plist! (cdr package) (recipe modules disable ignore pin unpin)
|
||||
(cl-destructuring-bind
|
||||
(_ &key recipe disable ignore pin unpin &allow-other-keys)
|
||||
package
|
||||
(when (and (not ignore)
|
||||
(not disable)
|
||||
(or unpin
|
||||
|
@ -237,8 +240,11 @@ ones."
|
|||
"Return straight recipes for non-builtin packages with a local-repo."
|
||||
(let (recipes)
|
||||
(dolist (recipe (hash-table-values straight--recipe-cache))
|
||||
(with-plist! recipe (local-repo type)
|
||||
(when (and local-repo (not (eq type 'built-in)))
|
||||
(cl-destructuring-bind (&key local-repo type no-build &allow-other-keys)
|
||||
recipe
|
||||
(unless (or (null local-repo)
|
||||
(eq type 'built-in)
|
||||
no-build)
|
||||
(push recipe recipes))))
|
||||
(nreverse recipes)))
|
||||
|
||||
|
@ -291,25 +297,29 @@ Grabs the latest commit id of the package using 'git'."
|
|||
(user-error "Not on a `package!' call")
|
||||
(backward-char)
|
||||
(let* ((recipe (cdr (sexp-at-point)))
|
||||
(name (car recipe))
|
||||
(package (car recipe))
|
||||
(oldid (doom-package-get package :pin))
|
||||
(id
|
||||
(cdr (doom-call-process
|
||||
"git" "ls-remote"
|
||||
(straight-vc-git--destructure
|
||||
(doom-plist-merge
|
||||
(plist-get (cdr recipe) :recipe)
|
||||
(or (cdr (straight-recipes-retrieve name))
|
||||
(plist-get (cdr (assq name doom-packages)) :recipe)))
|
||||
(or (cdr (straight-recipes-retrieve package))
|
||||
(plist-get (cdr (assq package doom-packages)) :recipe)))
|
||||
(upstream-repo upstream-host)
|
||||
(straight-vc-git--encode-url upstream-repo upstream-host))))))
|
||||
(unless id
|
||||
(user-error "No id for %S package" name))
|
||||
(user-error "No id for %S package" package))
|
||||
(let* ((id (if select
|
||||
(car (split-string (completing-read "Commit: " (split-string id "\n" t))))
|
||||
(car (split-string id))))
|
||||
(id (substring id 0 10)))
|
||||
(if (re-search-forward ":pin +\"\\([^\"]+\\)\"" (cdr (bounds-of-thing-at-point 'sexp)) t)
|
||||
(replace-match id t t nil 1)
|
||||
(thing-at-point--end-of-sexp)
|
||||
(backward-char)
|
||||
(insert " :pin " (prin1-to-string id))))))))
|
||||
(if (and oldid (string-match-p (concat "^" oldid) id))
|
||||
(user-error "No update necessary")
|
||||
(if (re-search-forward ":pin +\"\\([^\"]+\\)\"" (cdr (bounds-of-thing-at-point 'sexp)) t)
|
||||
(replace-match id t t nil 1)
|
||||
(thing-at-point--end-of-sexp)
|
||||
(backward-char)
|
||||
(insert " :pin " (prin1-to-string id)))
|
||||
(message "Updated %S: %s -> %s" package oldid id)))))))
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
;;; core/autoload/projects.el -*- lexical-binding: t; -*-
|
||||
|
||||
(defvar projectile-project-root nil)
|
||||
(defvar projectile-enable-caching)
|
||||
(defvar projectile-require-project-root)
|
||||
|
||||
;;;###autoload (autoload 'projectile-relevant-known-projects "projectile")
|
||||
|
||||
|
|
|
@ -96,6 +96,7 @@ following:
|
|||
;;
|
||||
;;; Commands
|
||||
|
||||
(defvar projectile-enable-caching)
|
||||
;;;###autoload
|
||||
(defun doom/open-scratch-buffer (&optional arg project-p)
|
||||
"Pop up a persistent scratch buffer.
|
||||
|
|
|
@ -117,34 +117,37 @@ in some cases."
|
|||
;;; Commands
|
||||
|
||||
(defun doom--bol-bot-eot-eol (&optional pos)
|
||||
(let* ((bol (if visual-line-mode
|
||||
(save-excursion
|
||||
(beginning-of-visual-line)
|
||||
(point))
|
||||
(line-beginning-position)))
|
||||
(bot (save-excursion
|
||||
(goto-char bol)
|
||||
(skip-chars-forward " \t\r")
|
||||
(point)))
|
||||
(eol (if visual-line-mode
|
||||
(save-excursion (end-of-visual-line) (point))
|
||||
(line-end-position)))
|
||||
(eot (or (save-excursion
|
||||
(if (not comment-use-syntax)
|
||||
(progn
|
||||
(goto-char bol)
|
||||
(when (re-search-forward comment-start-skip eol t)
|
||||
(or (match-end 1) (match-beginning 0))))
|
||||
(goto-char eol)
|
||||
(while (and (doom-point-in-comment-p)
|
||||
(> (point) bol))
|
||||
(backward-char))
|
||||
(skip-chars-backward " " bol)
|
||||
(unless (or (eq (char-after) 32) (eolp))
|
||||
(forward-char))
|
||||
(point)))
|
||||
eol)))
|
||||
(list bol bot eot eol)))
|
||||
(save-excursion
|
||||
(when pos
|
||||
(goto-char pos))
|
||||
(let* ((bol (if visual-line-mode
|
||||
(save-excursion
|
||||
(beginning-of-visual-line)
|
||||
(point))
|
||||
(line-beginning-position)))
|
||||
(bot (save-excursion
|
||||
(goto-char bol)
|
||||
(skip-chars-forward " \t\r")
|
||||
(point)))
|
||||
(eol (if visual-line-mode
|
||||
(save-excursion (end-of-visual-line) (point))
|
||||
(line-end-position)))
|
||||
(eot (or (save-excursion
|
||||
(if (not comment-use-syntax)
|
||||
(progn
|
||||
(goto-char bol)
|
||||
(when (re-search-forward comment-start-skip eol t)
|
||||
(or (match-end 1) (match-beginning 0))))
|
||||
(goto-char eol)
|
||||
(while (and (doom-point-in-comment-p)
|
||||
(> (point) bol))
|
||||
(backward-char))
|
||||
(skip-chars-backward " " bol)
|
||||
(unless (or (eq (char-after) 32) (eolp))
|
||||
(forward-char))
|
||||
(point)))
|
||||
eol)))
|
||||
(list bol bot eot eol))))
|
||||
|
||||
(defvar doom--last-backward-pt nil)
|
||||
;;;###autoload
|
||||
|
@ -154,7 +157,7 @@ beginning of the line. The opposite of
|
|||
`doom/forward-to-last-non-comment-or-eol'."
|
||||
(interactive "d")
|
||||
(let ((pt (or point (point))))
|
||||
(cl-destructuring-bind (bol bot _eot eol)
|
||||
(cl-destructuring-bind (bol bot _eot _eol)
|
||||
(doom--bol-bot-eot-eol pt)
|
||||
(cond ((> pt bot)
|
||||
(goto-char bot))
|
||||
|
|
|
@ -134,10 +134,8 @@ one wants that.")
|
|||
(form))))
|
||||
|
||||
(defun doom-cli--generate-autoloads-autodefs (file buffer module &optional module-enabled-p)
|
||||
(with-current-buffer
|
||||
(or (get-file-buffer file)
|
||||
(autoload-find-file file))
|
||||
(goto-char (point-min))
|
||||
(with-temp-buffer
|
||||
(insert-file-contents file)
|
||||
(while (re-search-forward "^;;;###autodef *\\([^\n]+\\)?\n" nil t)
|
||||
(let* ((standard-output buffer)
|
||||
(form (read (current-buffer)))
|
||||
|
|
|
@ -80,14 +80,22 @@ DOOMDIR environment variable. e.g.
|
|||
(print! "Regenerating autoloads files")
|
||||
(doom-cli-reload-autoloads)
|
||||
|
||||
(if nofonts-p
|
||||
(print! (warn "Not installing fonts, as requested"))
|
||||
(when (or doom-auto-accept
|
||||
(y-or-n-p "Download and install all-the-icon's fonts?"))
|
||||
(require 'all-the-icons)
|
||||
(let ((window-system (cond (IS-MAC 'ns)
|
||||
(IS-LINUX 'x))))
|
||||
(all-the-icons-install-fonts 'yes))))
|
||||
(cond (nofonts-p)
|
||||
(IS-WINDOWS
|
||||
(print! (warn "Doom cannot install all-the-icons' fonts on Windows!\n"))
|
||||
(print-group!
|
||||
(print!
|
||||
(concat "You'll have to do so manually:\n\n"
|
||||
" 1. Launch Doom Emacs\n"
|
||||
" 2. Execute 'M-x all-the-icons-install-fonts' to download the fonts\n"
|
||||
" 3. Open the download location in windows explorer\n"
|
||||
" 4. Open each font file to install them"))))
|
||||
((or doom-auto-accept
|
||||
(y-or-n-p "Download and install all-the-icon's fonts?"))
|
||||
(require 'all-the-icons)
|
||||
(let ((window-system (cond (IS-MAC 'ns)
|
||||
(IS-LINUX 'x))))
|
||||
(all-the-icons-install-fonts 'yes))))
|
||||
|
||||
(when (file-exists-p "~/.emacs")
|
||||
(print! (warn "A ~/.emacs file was detected. This conflicts with Doom and should be deleted!")))
|
||||
|
|
|
@ -194,7 +194,7 @@ declaration) or dependency thereof that hasn't already been."
|
|||
(setq output (doom--commit-log-between ref target-ref)))
|
||||
(doom--same-commit-p target-ref (straight-vc-get-commit type local-repo)))
|
||||
|
||||
((print! (start "\033[K(%d/%d) Re-cloning %s...%s") i total local-repo esc)
|
||||
((print! (start "\033[K(%d/%d) Re-cloning %s...") i total local-repo esc)
|
||||
(let ((repo (straight--repos-dir local-repo)))
|
||||
(ignore-errors
|
||||
(delete-directory repo 'recursive))
|
||||
|
@ -212,8 +212,9 @@ declaration) or dependency thereof that hasn't already been."
|
|||
(puthash local-repo t repos-to-rebuild)
|
||||
(puthash package t packages-to-rebuild)
|
||||
(unless (string-empty-p output)
|
||||
(print-group! (print! (info "%s" output))))
|
||||
(print! (success "(%d/%d) %s updated (%s -> %s)")
|
||||
(print! (start "\033[K(%d/%d) Updating %s...") i total local-repo)
|
||||
(print-group! (print! (indent 2 output))))
|
||||
(print! (success "\033[K(%d/%d) %s updated (%s -> %s)")
|
||||
i total local-repo
|
||||
(doom--abbrev-commit ref)
|
||||
(doom--abbrev-commit target-ref)))
|
||||
|
|
|
@ -43,10 +43,11 @@ possible."
|
|||
(and buffer-file-name
|
||||
(not doom-large-file-p)
|
||||
(file-exists-p buffer-file-name)
|
||||
(> (nth 7 (file-attributes buffer-file-name))
|
||||
(* 1024 1024
|
||||
(assoc-default buffer-file-name doom-large-file-size-alist
|
||||
#'string-match-p)))))
|
||||
(ignore-errors
|
||||
(> (nth 7 (file-attributes buffer-file-name))
|
||||
(* 1024 1024
|
||||
(assoc-default buffer-file-name doom-large-file-size-alist
|
||||
#'string-match-p))))))
|
||||
(prog1 (apply orig-fn args)
|
||||
(if (memq major-mode doom-large-file-excluded-modes)
|
||||
(setq doom-large-file-p nil)
|
||||
|
|
|
@ -282,7 +282,7 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
|
|||
(setq window-resize-pixelwise t
|
||||
frame-resize-pixelwise t)
|
||||
|
||||
(unless EMACS27+
|
||||
(when (bound-and-true-p tool-bar-mode)
|
||||
;; We do this in early-init.el too, but in case the user is on Emacs 26 we do
|
||||
;; it here too: disable tool and scrollbars, as Doom encourages
|
||||
;; keyboard-centric workflows, so these are just clutter (the scrollbar also
|
||||
|
|
|
@ -134,6 +134,9 @@ users).")
|
|||
;;
|
||||
;;; Emacs core configuration
|
||||
|
||||
;; lo', longer logs ahoy, so we may reliably locate lapses in doom's logic
|
||||
(setq message-log-max 8192)
|
||||
|
||||
;; Reduce debug output, well, unless we've asked for it.
|
||||
(setq debug-on-error doom-debug-mode
|
||||
jka-compr-verbose doom-debug-mode)
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
;; core-editor.el
|
||||
(package! better-jumper :pin "6d240032ca")
|
||||
(package! dtrt-indent :pin "48221c928b")
|
||||
(package! helpful :pin "e511e8dbd3")
|
||||
(package! helpful :pin "c54e9ddbd6")
|
||||
(when IS-MAC
|
||||
(package! ns-auto-titlebar :pin "1efc30d385"))
|
||||
(package! pcre2el :pin "0b5b2a2c17")
|
||||
(package! smartparens :pin "9449ae0859")
|
||||
(package! smartparens :pin "be8d5c9a63")
|
||||
(package! so-long
|
||||
:built-in 'prefer ; included in Emacs 27+
|
||||
;; REVIEW so-long is slated to be published to ELPA eventually, but until then
|
||||
|
@ -37,11 +37,11 @@
|
|||
(package! xclip :pin "88003b782e"))
|
||||
|
||||
;; core-projects.el
|
||||
(package! projectile :pin "27a0da9cdc")
|
||||
(package! projectile :pin "84be1dada3")
|
||||
|
||||
;; core-keybinds.el
|
||||
(package! general :pin "f6e928622d")
|
||||
(package! which-key :pin "db3d003e90")
|
||||
(package! which-key :pin "cf44641485")
|
||||
|
||||
;; autoload/cache.el
|
||||
(package! persistent-soft :pin "a1e0ddf")
|
||||
|
|
|
@ -388,7 +388,7 @@ These are side-by-side comparisons, showing how to bind keys with and without
|
|||
*** package!
|
||||
#+BEGIN_SRC elisp :eval no
|
||||
;; To install a package that can be found on ELPA or any of the sources
|
||||
;; specified in `doom-core-package-sources':
|
||||
;; specified in `straight-recipe-repositories':
|
||||
(package! evil)
|
||||
(package! js2-mode)
|
||||
(package! rainbow-delimiters)
|
||||
|
|
|
@ -8,6 +8,7 @@ removing them from your ~doom!~ block (found in =$DOOMDIR/init.el=).
|
|||
|
||||
* Table of Contents :TOC:
|
||||
- [[#app][:app]]
|
||||
- [[#checkers][:checkers]]
|
||||
- [[#completion][:completion]]
|
||||
- [[#config][:config]]
|
||||
- [[#editor][:editor]]
|
||||
|
@ -24,20 +25,15 @@ Application modules are complex and opinionated modules that transform Emacs
|
|||
toward a specific purpose. They may have additional dependencies and should be
|
||||
loaded last, before =:config= modules.
|
||||
|
||||
| Module | Flags | Description |
|
||||
|----------+---------------------+--------------------------------------------------------------------------|
|
||||
| calendar | - | TODO |
|
||||
| irc | - | Turns Emacs into an IRC client, powered by circe |
|
||||
| rss | =+org= | An RSS reader client for Emacs, powered by elfeed |
|
||||
| twitter | - | A twitter client for Emacs, powered by twittering |
|
||||
| write | =+wordnut +langnut= | Transforms Emacs into an IDE For fiction, literary or scientific writers |
|
||||
|
||||
+ [[file:../modules/app/calendar/README.org][calendar]] - TODO
|
||||
+ [[file:../modules/app/irc/README.org][irc]] - how neckbeards socialize
|
||||
+ rss =+org= - an RSS client in Emacs
|
||||
+ [[file:../modules/app/twitter/README.org][twitter]] - A twitter client for Emacs
|
||||
+ [[file:../modules/app/write/README.org][write]] =+wordnut +langtool= - Transforms emacs into an IDE for writers, and for
|
||||
writing fiction, notes, papers and so on.
|
||||
|
||||
* :checkers
|
||||
+ syntax =+childframe= - Live error/warning highlights
|
||||
+ spell =+everywhere= - Spell checking
|
||||
+ grammar - TODO
|
||||
|
||||
* :completion
|
||||
Modules that provide new interfaces or frameworks for completion, including code
|
||||
|
@ -106,7 +102,7 @@ Modules that bring support for a language or group of languages to Emacs.
|
|||
+ elm - TODO
|
||||
+ emacs-lisp - TODO
|
||||
+ erlang - TODO
|
||||
+ [[file:../modules/lang/ess/README.org][ess]] - TODO
|
||||
+ [[file:../modules/lang/ess/README.org][ess]] =+lsp= - TODO
|
||||
+ [[file:../modules/lang/faust/README.org][faust]] - TODO
|
||||
+ [[file:../modules/lang/fsharp/README.org][fsharp]] - TODO
|
||||
+ [[file:../modules/lang/go/README.org][go]] =+lsp= - TODO
|
||||
|
@ -162,8 +158,6 @@ Small modules that give Emacs access to external tools & services.
|
|||
+ [[file:../modules/tools/editorconfig/README.org][editorconfig]] - TODO
|
||||
+ [[file:../modules/tools/ein/README.org][ein]] - TODO
|
||||
+ [[file:../modules/tools/eval/README.org][eval]] =+overlay= - REPL & code evaluation support for a variety of languages
|
||||
+ flycheck - Live error/warning highlights
|
||||
+ flyspell =+everywhere= - Spell checking
|
||||
+ gist - TODO
|
||||
+ [[file:../modules/tools/lookup/README.org][lookup]] =+dictionary +docsets= - Universal jump-to & documentation lookup
|
||||
backend
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
(defvar +calendar--wconf nil)
|
||||
|
||||
(defun +calendar--init ()
|
||||
(if-let* ((win (cl-loop for win in (doom-visible-windows)
|
||||
if (string-match-p "^\\*cfw:" (buffer-name (window-buffer win)))
|
||||
return win)))
|
||||
(if-let (win (cl-find-if (lambda (b) (string-match-p "^\\*cfw:" (buffer-name b)))
|
||||
(doom-visible-windows)
|
||||
:key #'window-buffer))
|
||||
(select-window win)
|
||||
(call-interactively +calendar-open-function)))
|
||||
|
||||
|
|
|
@ -94,3 +94,7 @@ e.g. proselint and langtool."
|
|||
((require 'flyspell-correct-popup nil t)
|
||||
(setq flyspell-popup-correct-delay 0.8)
|
||||
(define-key popup-menu-keymap [escape] #'keyboard-quit))))
|
||||
|
||||
|
||||
(use-package! flyspell-lazy
|
||||
:after flyspell)
|
||||
|
|
|
@ -7,3 +7,5 @@
|
|||
((featurep! :completion helm)
|
||||
(package! flyspell-correct-helm :pin "b0353a41a7"))
|
||||
((package! flyspell-correct-popup :pin "b0353a41a7")))
|
||||
|
||||
(package! flyspell-lazy :pin "3ebf68cc9e")
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; completion/company/packages.el
|
||||
|
||||
(package! company :pin "d5053561cb")
|
||||
(package! company :pin "9de9905ed2")
|
||||
(package! company-dict :pin "cd7b8394f6")
|
||||
(package! company-prescient :pin "7fd8c3b802")
|
||||
(when (featurep! +childframe)
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
(package! amx :pin "3af93ca066")
|
||||
(package! counsel-projectile :pin "cadc6de707")
|
||||
(package! ivy-rich :pin "7bfc7262fd")
|
||||
(package! wgrep :pin "379afd89eb")
|
||||
(package! wgrep :pin "e67e737184")
|
||||
|
||||
(if (featurep! +prescient)
|
||||
(package! ivy-prescient :pin "7fd8c3b802")
|
||||
|
|
|
@ -77,10 +77,9 @@
|
|||
:n "q" #'kill-current-buffer)
|
||||
|
||||
:m "gs" #'+evil/easymotion ; lazy-load `evil-easymotion'
|
||||
(:after org
|
||||
:map org-mode-map
|
||||
:prefix "<easymotion>"
|
||||
"h" #'+org/goto-visible)
|
||||
(:after evil-org
|
||||
:map evil-org-mode-map
|
||||
:m "gsh" #'+org/goto-visible)
|
||||
|
||||
(:when (featurep! :editor multiple-cursors)
|
||||
:prefix "gz"
|
||||
|
@ -615,7 +614,7 @@
|
|||
:desc "Indent style" "I" #'doom/toggle-indent-style
|
||||
:desc "Line numbers" "l" #'doom/toggle-line-numbers
|
||||
(:when (featurep! :lang org +present)
|
||||
:desc "org-tree-slide mode" "p" #'+org-present/start)
|
||||
:desc "org-tree-slide mode" "p" #'org-tree-slide-mode)
|
||||
:desc "Read-only mode" "r" #'read-only-mode
|
||||
(:when (featurep! :checkers spell)
|
||||
:desc "Flyspell" "s" #'flyspell-mode)
|
||||
|
|
|
@ -11,3 +11,33 @@
|
|||
(cl-destructuring-bind (beg . end)
|
||||
(bounds-of-thing-at-point 'defun)
|
||||
(evil-range beg end type)))
|
||||
|
||||
;;;###autoload (autoload '+evil:inner-url-txtobj "editor/evil/autoload/textobjects" nil nil)
|
||||
(evil-define-text-object +evil:inner-url-txtobj (count &optional _beg _end type)
|
||||
"Text object to select the inner url at point.
|
||||
|
||||
This excludes the protocol and querystring."
|
||||
(cl-destructuring-bind (beg . end)
|
||||
(bounds-of-thing-at-point 'url)
|
||||
(evil-range
|
||||
(save-excursion
|
||||
(goto-char beg)
|
||||
(re-search-forward "://" end t))
|
||||
(save-excursion
|
||||
(goto-char end)
|
||||
(- (if-let (pos (re-search-backward "[?#]" beg t))
|
||||
pos
|
||||
end)
|
||||
(if (evil-visual-state-p)
|
||||
1
|
||||
0)))
|
||||
type)))
|
||||
|
||||
;;;###autoload (autoload '+evil:outer-url-txtobj "editor/evil/autoload/textobjects" nil nil)
|
||||
(evil-define-text-object +evil:outer-url-txtobj (count &optional _beg _end type)
|
||||
"Text object to select the whole url at point."
|
||||
(cl-destructuring-bind (beg . end)
|
||||
(bounds-of-thing-at-point 'url)
|
||||
(evil-range
|
||||
beg (- end (if (evil-visual-state-p) 1 0))
|
||||
type)))
|
||||
|
|
|
@ -27,7 +27,6 @@ directives. By default, this only recognizes C directives.")
|
|||
(defvar evil-want-C-w-delete t)
|
||||
(defvar evil-want-Y-yank-to-eol t)
|
||||
(defvar evil-want-abbrev-expand-on-insert-exit nil)
|
||||
(defvar evil-respect-visual-line-mode t)
|
||||
|
||||
(use-package! evil
|
||||
:hook (doom-init-modules . evil-mode)
|
||||
|
@ -127,7 +126,7 @@ directives. By default, this only recognizes C directives.")
|
|||
(count-lines (point-min) (point-max))
|
||||
(buffer-size)))))
|
||||
|
||||
;; 'gq' moves the cursor to the beginning of selection. Disable this, since
|
||||
;; '=' moves the cursor to the beginning of selection. Disable this, since
|
||||
;; it's more disruptive than helpful.
|
||||
(defadvice! +evil--dont-move-cursor-a (orig-fn &rest args)
|
||||
:around #'evil-indent
|
||||
|
@ -157,6 +156,14 @@ directives. By default, this only recognizes C directives.")
|
|||
(advice-add #'evil-open-above :around #'+evil--insert-newline-above-and-respect-comments-a)
|
||||
(advice-add #'evil-open-below :around #'+evil--insert-newline-below-and-respect-comments-a)
|
||||
|
||||
;; REVIEW Fix #2493: dir-locals cannot target fundamental-mode when evil-mode
|
||||
;; is active. See https://github.com/hlissner/doom-emacs/issues/2493.
|
||||
;; Revert this if this is ever fixed upstream.
|
||||
(defadvice! fix-local-vars (&rest _)
|
||||
:before #'turn-on-evil-mode
|
||||
(when (eq major-mode 'fundamental-mode)
|
||||
(hack-local-variables)))
|
||||
|
||||
;; Recenter screen after most searches
|
||||
(dolist (fn '(evil-visualstar/begin-search-forward
|
||||
evil-visualstar/begin-search-backward
|
||||
|
@ -411,7 +418,7 @@ To change these keys see `+evil-repeat-keys'."
|
|||
(defadvice! +evil-collection-disable-blacklist-a (orig-fn)
|
||||
:around #'evil-collection-vterm-toggle-send-escape ; allow binding to ESC
|
||||
(let (evil-collection-key-blacklist)
|
||||
(apply orig-fn))))
|
||||
(funcall-interactively orig-fn))))
|
||||
|
||||
;; Keybinds that have no Emacs+evil analogues (i.e. don't exist):
|
||||
;; zq - mark word at point as good word
|
||||
|
@ -549,6 +556,7 @@ To change these keys see `+evil-repeat-keys'."
|
|||
:textobj "i" #'evil-indent-plus-i-indent #'evil-indent-plus-a-indent
|
||||
:textobj "j" #'evil-indent-plus-i-indent-up-down #'evil-indent-plus-a-indent-up-down
|
||||
:textobj "k" #'evil-indent-plus-i-indent-up #'evil-indent-plus-a-indent-up
|
||||
:textobj "u" #'+evil:inner-url-txtobj #'+evil:outer-url-txtobj
|
||||
:textobj "x" #'evil-inner-xml-attr #'evil-outer-xml-attr
|
||||
|
||||
;; evil-easymotion (see `+evil/easymotion')
|
||||
|
@ -557,11 +565,6 @@ To change these keys see `+evil-repeat-keys'."
|
|||
"a" (evilem-create #'evil-forward-arg)
|
||||
"A" (evilem-create #'evil-backward-arg)
|
||||
"s" #'evil-avy-goto-char-2
|
||||
"w" (evilem-create #'evil-snipe-repeat
|
||||
:pre-hook (save-excursion (call-interactively #'evil-snipe-f))
|
||||
:bind ((evil-snipe-scope 'visible)
|
||||
(evil-snipe-enable-highlight)
|
||||
(evil-snipe-enable-incremental-highlight)))
|
||||
"SPC" (λ!! #'evil-avy-goto-char-timer t)
|
||||
"/" #'evil-avy-goto-char-timer))
|
||||
|
||||
|
|
|
@ -27,7 +27,10 @@
|
|||
(save-excursion
|
||||
(ignore-errors
|
||||
(or (hs-looking-at-block-start-p)
|
||||
(hs-find-block-beginning)))))
|
||||
(hs-find-block-beginning)
|
||||
(unless (eolp)
|
||||
(end-of-line)
|
||||
(+fold--hideshow-fold-p))))))
|
||||
|
||||
(defun +fold--invisible-points (count)
|
||||
(let (points)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; editor/format/packages.el
|
||||
|
||||
(package! format-all :pin "d126830a73")
|
||||
(package! format-all :pin "f57a2a8abb")
|
||||
|
|
|
@ -7,4 +7,4 @@
|
|||
:recipe (:host github
|
||||
:repo "hlissner/doom-snippets"
|
||||
:files ("*.el" "*"))
|
||||
:pin "7ba920d1de")
|
||||
:pin "2781b782a3")
|
||||
|
|
|
@ -43,7 +43,7 @@ This module requires:
|
|||
|
||||
** MacOS
|
||||
#+BEGIN_SRC sh
|
||||
brew install mu --with-emacs
|
||||
brew install mu
|
||||
# And one of the following
|
||||
brew install isync # mbsync
|
||||
brew install offlineimap
|
||||
|
|
|
@ -110,7 +110,10 @@ This is ignored by ccls.")
|
|||
(label . 0))))
|
||||
|
||||
(when (listp c-default-style)
|
||||
(setf (alist-get 'other c-default-style) "doom")))
|
||||
(setf (alist-get 'other c-default-style) "doom"))
|
||||
|
||||
(after! ffap
|
||||
(add-to-list 'ffap-alist '(c-mode . ffap-c-mode))))
|
||||
|
||||
|
||||
(use-package! modern-cpp-font-lock
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
'(("^\\*sly-mrepl" :vslot 2 :size 0.3 :quit nil :ttl nil)
|
||||
("^\\*sly-compilation" :vslot 3 :ttl nil)
|
||||
("^\\*sly-traces" :vslot 4 :ttl nil)
|
||||
("^\\*sly-description" :vslot 5 :size 0.3 :ttl 0)
|
||||
;; Do not display debugger or inspector buffers in a popup window. These
|
||||
;; buffers are meant to be displayed with sufficient vertical space.
|
||||
("^\\*sly-\\(?:db\\|inspector\\)" :ignore t)))
|
||||
|
@ -70,7 +71,8 @@
|
|||
:map lisp-mode-map
|
||||
:desc "Sly" "'" #'sly
|
||||
:desc "Sly (ask)" ";" (λ!! #'sly '-)
|
||||
:desc "Expand macro" "m" #'macrostep-expand
|
||||
:desc "Expand macro" "m" #'sly-macroexpand-1-inplace
|
||||
:desc "Expand macro in popup" "M" #'sly-macroexpand-1
|
||||
(:prefix ("c" . "compile")
|
||||
:desc "Compile file" "c" #'sly-compile-file
|
||||
:desc "Compile/load file" "C" #'sly-compile-and-load-file
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
(after! elm-mode
|
||||
(add-hook 'elm-mode-hook #'rainbow-delimiters-mode)
|
||||
|
||||
(when (featurep! +lsp)
|
||||
(add-hook 'elm-mode-local-vars-hook #'lsp!))
|
||||
|
||||
(set-company-backend! 'elm-mode 'company-elm)
|
||||
(set-repl-handler! 'elm-mode #'run-elm-interactive)
|
||||
(set-pretty-symbols! 'elm-mode
|
||||
|
|
|
@ -88,7 +88,7 @@ library/userland functions"
|
|||
((and (symbolp (setq module (sexp-at-point)))
|
||||
(string-prefix-p "+" (symbol-name module)))
|
||||
(while (symbolp (sexp-at-point))
|
||||
(beginning-of-sexp))
|
||||
(thing-at-point--beginning-of-sexp))
|
||||
(setq flag module
|
||||
module (car (sexp-at-point)))
|
||||
(when (re-search-backward "\\_<:\\w+\\_>" nil t)
|
||||
|
@ -99,7 +99,7 @@ library/userland functions"
|
|||
(list category module flag))))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +emacs-lisp-lookup-definition (thing)
|
||||
(defun +emacs-lisp-lookup-definition (_thing)
|
||||
"Lookup definition of THING."
|
||||
(if-let (module (+emacs-lisp--module-at-point))
|
||||
(doom/help-modules (car module) (cadr module) 'visit-dir)
|
||||
|
|
|
@ -4,8 +4,15 @@ This module adds support for various statistics languages, including R, S-Plus,
|
|||
SAS, Julia and Stata.
|
||||
|
||||
* Table of Contents :TOC:
|
||||
- [[Appendix][Appendix]]
|
||||
- [[Keybindings][Keybindings]]
|
||||
- [[#prequisites][Prequisites]]
|
||||
- [[#appendix][Appendix]]
|
||||
- [[#keybindings][Keybindings]]
|
||||
|
||||
* Prequisites
|
||||
This module has several optional dependencies:
|
||||
|
||||
+ [[https://github.com/jimhester/lintr][lintr]]: Enables R linting.
|
||||
+ [[https://github.com/REditorSupport/languageserver][languageserver]]: Enables LSP support in an R buffer (with =+lsp= flag).
|
||||
|
||||
* Appendix
|
||||
** Keybindings
|
||||
|
|
|
@ -19,6 +19,10 @@
|
|||
ess-style 'DEFAULT
|
||||
ess-history-directory (expand-file-name "ess-history/" doom-cache-dir))
|
||||
|
||||
(set-docsets! 'ess-r-mode "R")
|
||||
(when (featurep! +lsp)
|
||||
(add-hook 'ess-r-mode-local-vars-hook #'lsp!))
|
||||
|
||||
(set-repl-handler! 'ess-r-mode #'+ess/open-r-repl)
|
||||
(set-repl-handler! 'ess-julia-mode #'+ess/open-julia-repl)
|
||||
(set-lookup-handlers! '(ess-r-mode ess-julia-mode)
|
||||
|
@ -34,25 +38,26 @@
|
|||
comment-line-break-function nil)
|
||||
|
||||
(map! (:after ess-help
|
||||
:map ess-help-mode-map
|
||||
:n "q" #'kill-current-buffer
|
||||
:n "Q" #'ess-kill-buffer-and-go
|
||||
:n "K" #'ess-display-help-on-object
|
||||
:n "go" #'ess-display-help-in-browser
|
||||
:n "gO" #'ess-display-help-apropos
|
||||
:n "gv" #'ess-display-vignettes
|
||||
:m "]]" #'ess-skip-to-next-section
|
||||
:m "[[" #'ess-skip-to-previous-section
|
||||
:map ess-doc-map
|
||||
"h" #'ess-display-help-on-object
|
||||
"p" #'ess-R-dv-pprint
|
||||
"t" #'ess-R-dv-ctable
|
||||
[C-return] #'ess-eval-line
|
||||
[up] #'comint-next-input
|
||||
[down] #'comint-previous-input)
|
||||
(:map ess-help-mode-map
|
||||
:n "q" #'kill-current-buffer
|
||||
:n "Q" #'ess-kill-buffer-and-go
|
||||
:n "K" #'ess-display-help-on-object
|
||||
:n "go" #'ess-display-help-in-browser
|
||||
:n "gO" #'ess-display-help-apropos
|
||||
:n "gv" #'ess-display-vignettes
|
||||
:m "]]" #'ess-skip-to-next-section
|
||||
:m "[[" #'ess-skip-to-previous-section)
|
||||
(:map ess-doc-map
|
||||
"h" #'ess-display-help-on-object
|
||||
"p" #'ess-R-dv-pprint
|
||||
"t" #'ess-R-dv-ctable
|
||||
[up] #'comint-next-input
|
||||
[down] #'comint-previous-input
|
||||
[C-return] #'ess-eval-line))
|
||||
|
||||
:localleader
|
||||
:map ess-mode-map
|
||||
:n [C-return] #'ess-eval-line
|
||||
:localleader
|
||||
"," #'ess-eval-region-or-function-or-paragraph-and-step
|
||||
"'" #'R
|
||||
[tab] #'ess-switch-to-inferior-or-script-buffer
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/haskell/packages.el
|
||||
|
||||
(package! haskell-mode :pin "3cf99d7f0e")
|
||||
(package! haskell-mode :pin "4a87d72589")
|
||||
|
||||
(when (featurep! +dante)
|
||||
(package! dante :pin "3e532e8d7e")
|
||||
(package! dante :pin "4955bc7363")
|
||||
(package! attrap :pin "4cf3e4a162"))
|
||||
(when (featurep! +lsp)
|
||||
(package! lsp-haskell :pin "6d481f97e6"))
|
||||
;; DEPRECATED
|
||||
(when (featurep! +intero)
|
||||
(package! intero :pin "30d8e7330c"))
|
||||
(package! intero :pin "fdb0550a2d"))
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
(add-hook 'idris-mode-hook #'turn-on-idris-simple-indent)
|
||||
(set-repl-handler! 'idris-mode 'idris-pop-to-repl)
|
||||
(set-lookup-handlers! 'idris-mode
|
||||
:documentation #'idris-docs-at-point
|
||||
:file #'idris-load-file)
|
||||
:documentation #'idris-docs-at-point)
|
||||
(map! :localleader
|
||||
:map idris-mode-map
|
||||
"r" #'idris-load-file
|
||||
|
|
|
@ -284,7 +284,13 @@ to tide."
|
|||
;;; Projects
|
||||
|
||||
(def-project-mode! +javascript-npm-mode
|
||||
:modes '(html-mode css-mode web-mode markdown-mode js-mode typescript-mode)
|
||||
:modes '(html-mode
|
||||
css-mode
|
||||
web-mode
|
||||
markdown-mode
|
||||
js-mode
|
||||
typescript-mode
|
||||
solidity-mode)
|
||||
:when (locate-dominating-file default-directory "package.json")
|
||||
:add-hooks '(+javascript-add-node-modules-path-h npm-mode))
|
||||
|
||||
|
|
|
@ -48,8 +48,11 @@ If no viewers are found, `latex-preview-pane' is used.")
|
|||
(setq-default TeX-master t)
|
||||
;; set-up chktex
|
||||
(setcar (cdr (assoc "Check" TeX-command-list)) "chktex -v6 -H %s")
|
||||
;; tell emacs how to parse tex files
|
||||
(setq-hook! 'TeX-mode-hook ispell-parser 'tex)
|
||||
(setq-hook! 'TeX-mode-hook
|
||||
;; tell emacs how to parse tex files
|
||||
ispell-parser 'tex
|
||||
;; Don't auto-fill in math blocks
|
||||
fill-nobreak-predicate (cons #'texmathp fill-nobreak-predicate))
|
||||
;; Enable word wrapping
|
||||
(add-hook 'TeX-mode-hook #'visual-line-mode)
|
||||
;; Fold TeX macros
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
(when (featurep! :completion company)
|
||||
(package! company-auctex :pin "48c42c58ce")
|
||||
(package! company-reftex :pin "33935e9654")
|
||||
(package! company-math :pin "600e494496"))
|
||||
(package! company-math :pin "a796053590"))
|
||||
(when (featurep! :completion ivy)
|
||||
(package! ivy-bibtex :pin "d4471232be"))
|
||||
(when (featurep! :completion helm)
|
||||
|
|
|
@ -1,23 +1,30 @@
|
|||
;;; lang/ledger/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###package ledger-mode
|
||||
(setq ledger-clear-whole-transactions 1)
|
||||
(use-package! ledger-mode
|
||||
:defer t
|
||||
:init
|
||||
(setq ledger-clear-whole-transactions 1
|
||||
ledger-mode-should-check-version nil)
|
||||
|
||||
(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)))
|
||||
:config
|
||||
(setq ledger-binary-path
|
||||
(if (executable-find "hledger")
|
||||
"hledger"
|
||||
"ledger"))
|
||||
|
||||
;; Restore leader key in ledger reports
|
||||
(map! :after ledger-mode
|
||||
:map ledger-report-mode-map
|
||||
"C-c C-c" #'ledger-report-edit-report
|
||||
"C-c C-r" #'ledger-report-redo
|
||||
"C-c C-s" #'ledger-report-save
|
||||
:map ledger-reconcile-mode-map
|
||||
[tab] #'ledger-reconcile-toggle)
|
||||
(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)))
|
||||
|
||||
(map! :map ledger-report-mode-map
|
||||
"C-c C-c" #'ledger-report-edit-report
|
||||
"C-c C-r" #'ledger-report-redo
|
||||
"C-c C-s" #'ledger-report-save
|
||||
:map ledger-reconcile-mode-map
|
||||
[tab] #'ledger-reconcile-toggle))
|
||||
|
||||
|
||||
(use-package! flycheck-ledger
|
||||
|
|
|
@ -46,7 +46,13 @@ capture, the end position, and the output buffer.")
|
|||
(set-flyspell-predicate! '(markdown-mode gfm-mode)
|
||||
#'+markdown-flyspell-word-p)
|
||||
(set-lookup-handlers! '(markdown-mode gfm-mode)
|
||||
:file #'markdown-follow-thing-at-point)
|
||||
;; `markdown-follow-thing-at-point' may open an external program or a
|
||||
;; buffer. No good way to tell, so pretend it's async.
|
||||
:file '(markdown-follow-thing-at-point :async t))
|
||||
|
||||
(setq-hook! 'markdown-mode-hook
|
||||
fill-nobreak-predicate (cons #'markdown-code-block-at-point-p
|
||||
fill-nobreak-predicate))
|
||||
|
||||
;; HACK Prevent mis-fontification of YAML metadata blocks in `markdown-mode'
|
||||
;; which occurs when the first line contains a colon in it. See
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
(package! edit-indirect :pin "935ded353b")
|
||||
|
||||
(when (featurep! +grip)
|
||||
(package! grip-mode :pin "cbf20fd131"))
|
||||
(package! grip-mode :pin "1a61bb71a7"))
|
||||
|
||||
(when (featurep! :editor evil +everywhere)
|
||||
(package! evil-markdown
|
||||
|
|
|
@ -39,3 +39,24 @@
|
|||
((user-error "No search engine is enabled. Enable helm or ivy!")))
|
||||
;; Tell lookup module to let us handle things from here
|
||||
'deferred)
|
||||
|
||||
;;;###autoload
|
||||
(defun +nix-shell-init-mode ()
|
||||
"Resolve a (cached-)?nix-shell shebang to the correct major mode."
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(save-match-data
|
||||
(when (re-search-forward "#! *\\(?:cached-\\)?nix-shell +-i +\\([^ \n]+\\)" 256 t)
|
||||
(let* ((interp (match-string 1))
|
||||
(mode
|
||||
(assoc-default
|
||||
interp
|
||||
(mapcar (lambda (e)
|
||||
(cons (format "\\`%s\\'" (car e))
|
||||
(cdr e)))
|
||||
interpreter-mode-alist)
|
||||
#'string-match-p)))
|
||||
(when mode
|
||||
(prog1 (set-auto-mode-0 mode)
|
||||
(when (eq major-mode 'sh-mode)
|
||||
(sh-set-shell interp)))))))))
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
;;; lang/nix/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(use-package! nix-mode
|
||||
:interpreter ("cached-nix-shell" . +nix-shell-init-mode)
|
||||
:interpreter ("nix-shell" . +nix-shell-init-mode)
|
||||
:mode "\\.nix\\'"
|
||||
:config
|
||||
(set-company-backend! 'nix-mode 'company-nixos-options)
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
|
||||
(after! tuareg
|
||||
(set-company-backend! 'tuareg-mode 'merlin-company-backend)
|
||||
(set-lookup-handlers! 'tuareg-mode
|
||||
(set-lookup-handlers! 'tuareg-mode :async t
|
||||
:definition #'merlin-locate
|
||||
:references #'merlin-occurrences
|
||||
:documentation #'merlin-document))
|
||||
|
|
|
@ -9,10 +9,13 @@
|
|||
if (buffer-local-value 'org-tree-slide-mode buf)
|
||||
return t)
|
||||
(org-tree-slide-mode -1)
|
||||
(remove-hook 'kill-buffer-hook #'+org-present--cleanup-org-tree-slides-mode)))
|
||||
(remove-hook 'kill-buffer-hook #'+org-present--cleanup-org-tree-slides-mode
|
||||
'local)))
|
||||
|
||||
(defun +org-present--make-invisible (beg end)
|
||||
(let ((overlay (make-overlay beg end)))
|
||||
(unless (assq '+org-present buffer-invisibility-spec)
|
||||
(add-to-invisibility-spec '(+org-present)))
|
||||
(let ((overlay (make-overlay beg (1+ end))))
|
||||
(push overlay +org-present--overlays)
|
||||
(overlay-put overlay 'invisible '+org-present)))
|
||||
|
||||
|
@ -21,19 +24,21 @@
|
|||
;;; Hooks
|
||||
|
||||
;;;###autoload
|
||||
(defun +org-present-add-overlays-h ()
|
||||
"TODO"
|
||||
(add-to-invisibility-spec '(+org-present))
|
||||
(defun +org-present-hide-blocks-h ()
|
||||
"Hide org #+ constructs."
|
||||
(save-excursion
|
||||
;; hide org-mode options starting with #+
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward "^[[:space:]]*\\(#\\+\\)\\(\\(?:BEGIN\\|END\\|ATTR\\)[^[:space:]]+\\).*" nil t)
|
||||
(+org-present--make-invisible
|
||||
(match-beginning 1)
|
||||
(match-end 0)))
|
||||
;; hide stars in headings
|
||||
(match-end 0)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +org-present-hide-leading-stars-h ()
|
||||
"Hide leading stars in headings."
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward "^\\(\\*+\\s-\\)" nil t)
|
||||
(while (re-search-forward "^\\(\\*+\\)" nil t)
|
||||
(+org-present--make-invisible (match-beginning 1) (match-end 1)))))
|
||||
|
||||
;;;###autoload
|
||||
|
@ -55,43 +60,35 @@
|
|||
(defvar cwm-left-fringe-ratio)
|
||||
(defvar cwm-centered-window-width)
|
||||
;;;###autoload
|
||||
(defun +org-present-init-org-tree-window-h ()
|
||||
(defun +org-present-prettify-slide-h ()
|
||||
"TODO"
|
||||
"Set up the org window for presentation."
|
||||
(doom/window-maximize-buffer)
|
||||
(let ((arg (if org-tree-slide-mode +1 -1)))
|
||||
(when (fboundp 'centered-window-mode)
|
||||
(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))
|
||||
(setq-local cwm-use-vertical-padding t)
|
||||
(setq-local cwm-frame-internal-border 100)
|
||||
(setq-local cwm-left-fringe-ratio -10)
|
||||
(setq-local cwm-centered-window-width 300)
|
||||
(centered-window-mode arg))
|
||||
(hide-mode-line-mode arg)
|
||||
(+org-pretty-mode arg)
|
||||
(cond (org-tree-slide-mode
|
||||
(org-indent-mode -1)
|
||||
(set-window-fringes nil 0 0)
|
||||
(when (bound-and-true-p solaire-mode)
|
||||
(solaire-mode -1)
|
||||
(fringe-mode 0))
|
||||
(when (bound-and-true-p flyspell-mode)
|
||||
(flyspell-mode -1))
|
||||
(add-hook 'kill-buffer-hook #'+org-present--cleanup-org-tree-slides-mode
|
||||
nil 'local)
|
||||
(text-scale-set +org-present-text-scale)
|
||||
(ignore-errors (org-latex-preview '(4)))
|
||||
(set-face-attribute 'org-level-2 nil :height 1.4))
|
||||
(ignore-errors (org-latex-preview '(4))))
|
||||
(t
|
||||
(org-indent-mode +1)
|
||||
(text-scale-set 0)
|
||||
(set-window-fringes nil fringe-mode fringe-mode)
|
||||
(org-clear-latex-preview)
|
||||
(set-face-attribute 'org-level-2 nil :height 1.0)
|
||||
(+org-present-remove-overlays-h)
|
||||
(org-remove-inline-images)))))
|
||||
|
||||
|
||||
;;
|
||||
;;; Commands
|
||||
|
||||
(defvar +org-present--overlays nil)
|
||||
;;;###autoload
|
||||
(defun +org-present/start ()
|
||||
"TODO"
|
||||
(interactive)
|
||||
(unless (derived-mode-p 'org-mode)
|
||||
(error "Not in an org buffer"))
|
||||
(call-interactively #'org-tree-slide-mode)
|
||||
(add-hook 'kill-buffer-hook #'+org-present--cleanup-org-tree-slides-mode))
|
||||
(org-remove-inline-images)
|
||||
(org-mode)))
|
||||
(redraw-display)))
|
||||
|
|
|
@ -988,4 +988,10 @@ compelling reason, so..."
|
|||
org-id-locations-file (concat org-directory ".orgids")
|
||||
org-id-locations-file-relative t)
|
||||
|
||||
;; HACK `org-id' doesn't check if `org-id-locations-file' exists or is
|
||||
;; writeable before trying to read/write to it.
|
||||
(defadvice! +org--fail-gracefully-a (&rest _)
|
||||
:before-while '(org-id-locations-save org-id-locations-load)
|
||||
(file-exists-p org-id-locations-file))
|
||||
|
||||
(add-hook 'org-open-at-point-functions #'doom-set-jump-h))
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
;;; lang/org/contrib/present.el -*- lexical-binding: t; -*-
|
||||
;;;###if (featurep! +present)
|
||||
|
||||
(defvar +org-present-text-scale 7
|
||||
(defvar +org-present-text-scale 6
|
||||
"The `text-scale-amount' for `org-tree-slide-mode'.")
|
||||
|
||||
(after! ox
|
||||
|
@ -24,31 +24,37 @@
|
|||
(setq org-tree-slide-skip-outline-level 2
|
||||
org-tree-slide-activate-message " "
|
||||
org-tree-slide-deactivate-message " "
|
||||
org-tree-slide-modeline-display nil)
|
||||
org-tree-slide-modeline-display nil
|
||||
org-tree-slide-heading-emphasis t)
|
||||
|
||||
(map! :map org-tree-slide-mode-map
|
||||
:n [right] #'org-tree-slide-move-next-tree
|
||||
:n [left] #'org-tree-slide-move-previous-tree)
|
||||
(add-hook 'org-tree-slide-mode-after-narrow-hook #'org-display-inline-images)
|
||||
(add-hook! 'org-tree-slide-mode-hook
|
||||
#'+org-present-hide-blocks-h
|
||||
#'+org-present-prettify-slide-h)
|
||||
|
||||
(add-hook! 'org-tree-slide-mode-after-narrow-hook
|
||||
#'+org-present-detect-slide-h
|
||||
#'+org-present-add-overlays-h
|
||||
#'org-display-inline-images)
|
||||
|
||||
(add-hook 'org-tree-slide-mode-hook #'+org-present-init-org-tree-window-h)
|
||||
(when (featurep! :editor evil)
|
||||
(map! :map org-tree-slide-mode-map
|
||||
:n [C-right] #'org-tree-slide-move-next-tree
|
||||
:n [C-left] #'org-tree-slide-move-previous-tree)
|
||||
(add-hook 'org-tree-slide-mode-hook #'evil-normalize-keymaps))
|
||||
|
||||
(defadvice! +org-present--narrow-to-subtree-a (orig-fn &rest args)
|
||||
"Narrow to the target subtree when you start the presentation."
|
||||
:around #'org-tree-slide--display-tree-with-narrow
|
||||
(cl-letf (((symbol-function #'org-narrow-to-subtree)
|
||||
(lambda () (save-excursion
|
||||
(save-match-data
|
||||
(org-with-limited-levels
|
||||
(narrow-to-region
|
||||
(progn (org-back-to-heading t)
|
||||
(forward-line 1)
|
||||
(point))
|
||||
(progn (org-end-of-subtree t t)
|
||||
(when (and (org-at-heading-p) (not (eobp))) (backward-char 1))
|
||||
(point)))))))))
|
||||
(lambda ()
|
||||
(save-excursion
|
||||
(save-match-data
|
||||
(org-with-limited-levels
|
||||
(narrow-to-region
|
||||
(progn
|
||||
(when (org-before-first-heading-p)
|
||||
(org-next-visible-heading 1))
|
||||
(ignore-errors (org-up-heading-all 99))
|
||||
(forward-line 1)
|
||||
(point))
|
||||
(progn (org-end-of-subtree t t)
|
||||
(when (and (org-at-heading-p) (not (eobp)))
|
||||
(backward-char 1))
|
||||
(point)))))))))
|
||||
(apply orig-fn args))))
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
:recipe (:host github
|
||||
:repo "emacs-straight/org-mode"
|
||||
:files ("*.el" "lisp/*.el" "contrib/lisp/*.el"))
|
||||
:pin "cd1014a75a")
|
||||
:pin "ec6d01fd49")
|
||||
;; ...And prevent other packages from pulling org; org-plus-contrib satisfies
|
||||
;; the dependency already: https://github.com/raxod502/straight.el/issues/352
|
||||
(package! org :recipe (:local-repo nil))
|
||||
|
@ -56,7 +56,7 @@
|
|||
(when (featurep! +brain)
|
||||
(package! org-brain :pin "8cb2efc860"))
|
||||
(when (featurep! +dragndrop)
|
||||
(package! org-download :pin "aad18aecef"))
|
||||
(package! org-download :pin "70401884e9"))
|
||||
(when (featurep! +gnuplot)
|
||||
(package! gnuplot :pin "a406143d52")
|
||||
(package! gnuplot-mode :pin "601f639298"))
|
||||
|
@ -71,9 +71,9 @@
|
|||
:recipe (:host github :repo "anler/centered-window-mode")
|
||||
:pin "24f7c5be9d")
|
||||
(package! org-tree-slide :pin "7bf09a02bd")
|
||||
(package! org-re-reveal :pin "29bc467201"))
|
||||
(package! org-re-reveal :pin "14df7542f2"))
|
||||
(when (featurep! +journal)
|
||||
(package! org-journal :pin "cf0f15386f"))
|
||||
(package! org-journal :pin "128f0533a7"))
|
||||
|
||||
;;; Babel
|
||||
(package! ob-async :pin "80a30b96a0")
|
||||
|
@ -100,6 +100,6 @@
|
|||
(when (featurep! +hugo)
|
||||
(package! ox-hugo
|
||||
:recipe (:host github :repo "kaushalmodi/ox-hugo" :nonrecursive t)
|
||||
:pin "0530645d73"))
|
||||
:pin "a80b250987"))
|
||||
(when (featurep! :lang rst)
|
||||
(package! ox-rst :pin "9158bfd180"))
|
||||
|
|
|
@ -28,8 +28,10 @@
|
|||
|
||||
(add-hook 'rustic-mode-hook #'rainbow-delimiters-mode)
|
||||
|
||||
(when (featurep! +lsp)
|
||||
(add-hook 'rustic-mode-local-vars-hook #'lsp!))
|
||||
(if (featurep! +lsp)
|
||||
(add-hook 'rustic-mode-local-vars-hook #'lsp!)
|
||||
(after! rustic-flycheck
|
||||
(add-to-list 'flycheck-checkers 'rustic-clippy)))
|
||||
|
||||
(map! :map rustic-mode-map
|
||||
:localleader
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/rust/packages.el
|
||||
|
||||
(package! rustic :pin "a6b8cd8db8")
|
||||
(package! rustic :pin "da3820de18")
|
||||
(unless (featurep! +lsp)
|
||||
(package! racer :pin "a0bdf778f0"))
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
:when (featurep! :checkers syntax)
|
||||
:after solidity-mode
|
||||
:config
|
||||
(set-docsets! 'solidity-mode "Solidity")
|
||||
(setq flycheck-solidity-solc-addstd-contracts t)
|
||||
(when (funcall flycheck-executable-find solidity-solc-path)
|
||||
(add-to-list 'flycheck-checkers 'solidity-checker nil #'eq))
|
||||
|
|
|
@ -6,33 +6,35 @@
|
|||
(defvar company-pcomplete-available 'unknown)
|
||||
|
||||
(defun company-pcomplete--prefix ()
|
||||
(let* ((pcomplete-stub)
|
||||
pcomplete-seen
|
||||
pcomplete-norm-func
|
||||
pcomplete-args
|
||||
pcomplete-last pcomplete-index
|
||||
(pcomplete-autolist pcomplete-autolist)
|
||||
(pcomplete-suffix-list pcomplete-suffix-list))
|
||||
(pcomplete-completions)
|
||||
(buffer-substring (pcomplete-begin) (point))))
|
||||
(with-no-warnings
|
||||
(let* ((pcomplete-stub)
|
||||
pcomplete-seen
|
||||
pcomplete-norm-func
|
||||
pcomplete-args
|
||||
pcomplete-last pcomplete-index
|
||||
(pcomplete-autolist pcomplete-autolist)
|
||||
(pcomplete-suffix-list pcomplete-suffix-list))
|
||||
(pcomplete-completions)
|
||||
(buffer-substring (pcomplete-begin) (point)))))
|
||||
|
||||
(defun company-pcomplete--candidates ()
|
||||
(let* ((pcomplete-stub)
|
||||
(pcomplete-show-list t)
|
||||
pcomplete-seen pcomplete-norm-func
|
||||
pcomplete-args pcomplete-last pcomplete-index
|
||||
(pcomplete-autolist pcomplete-autolist)
|
||||
(pcomplete-suffix-list pcomplete-suffix-list)
|
||||
(candidates (pcomplete-completions))
|
||||
(prefix (buffer-substring (pcomplete-begin) (point)))
|
||||
;; Collect all possible completions for the current stub
|
||||
(cnds (all-completions pcomplete-stub candidates))
|
||||
(bnds (completion-boundaries pcomplete-stub candidates nil ""))
|
||||
(skip (- (length pcomplete-stub) (car bnds))))
|
||||
;; Replace the stub at the beginning of each candidate by the prefix
|
||||
(mapcar (lambda (cand)
|
||||
(concat prefix (substring cand skip)))
|
||||
cnds)))
|
||||
(with-no-warnings
|
||||
(let* ((pcomplete-stub)
|
||||
(pcomplete-show-list t)
|
||||
pcomplete-seen pcomplete-norm-func
|
||||
pcomplete-args pcomplete-last pcomplete-index
|
||||
(pcomplete-autolist pcomplete-autolist)
|
||||
(pcomplete-suffix-list pcomplete-suffix-list)
|
||||
(candidates (pcomplete-completions))
|
||||
(prefix (buffer-substring (pcomplete-begin) (point)))
|
||||
;; Collect all possible completions for the current stub
|
||||
(cnds (all-completions pcomplete-stub candidates))
|
||||
(bnds (completion-boundaries pcomplete-stub candidates nil ""))
|
||||
(skip (- (length pcomplete-stub) (car bnds))))
|
||||
;; Replace the stub at the beginning of each candidate by the prefix
|
||||
(mapcar (lambda (cand)
|
||||
(concat prefix (substring cand skip)))
|
||||
cnds))))
|
||||
|
||||
;;;###autoload
|
||||
(defun company-pcomplete-available ()
|
||||
|
|
|
@ -13,10 +13,8 @@
|
|||
;; Prevent premature horizontal scrolling
|
||||
hscroll-margin 0)
|
||||
|
||||
(setq vterm-kill-buffer-on-exit t)
|
||||
|
||||
(add-hook 'vterm-mode-hook #'doom-mark-buffer-as-real-h)
|
||||
;; Automatically kill buffer when vterm exits.
|
||||
(add-hook! 'vterm-exit-functions
|
||||
(defun +vterm-kill-buffer-on-quit-fn (buffer event)
|
||||
(if buffer (kill-buffer buffer))))
|
||||
;; Modeline serves no purpose in vterm
|
||||
(add-hook 'vterm-mode-hook #'hide-mode-line-mode))
|
||||
|
|
|
@ -3,4 +3,4 @@
|
|||
|
||||
(package! vterm
|
||||
:built-in 'prefer
|
||||
:pin "a970b4f472")
|
||||
:pin "4fbf8f89ff")
|
||||
|
|
|
@ -1,69 +1,34 @@
|
|||
;;; tools/direnv/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(defvar +direnv--keywords
|
||||
(defvar +direnv-keywords
|
||||
'("direnv_layout_dir" "PATH_add" "path_add" "log_status" "log_error" "has"
|
||||
"join_args" "expand_path" "dotenv" "user_rel_path" "find_up" "source_env"
|
||||
"watch_file" "source_up" "direnv_load" "MANPATH_add" "load_prefix" "layout"
|
||||
"use" "rvm" "use_nix" "use_guix")
|
||||
"TODO")
|
||||
|
||||
|
||||
;;
|
||||
;;; Packages
|
||||
|
||||
(use-package! direnv
|
||||
:after-call after-find-file dired-initial-position-hook
|
||||
:hook (before-hack-local-variables . direnv--maybe-update-environment)
|
||||
:hook (flycheck-before-syntax-check . direnv--maybe-update-environment)
|
||||
:hook (direnv-envrc-mode . +direnv-envrc-fontify-keywords-h)
|
||||
:config
|
||||
(add-hook! 'direnv-mode-hook
|
||||
(defun +direnv-init-h ()
|
||||
"Instead of checking for direnv on `post-command-hook', check only once,
|
||||
when the file is first opened/major mode is activated. This is significantly
|
||||
less expensive, but is less sensitive to changes to .envrc done outside of
|
||||
Emacs."
|
||||
(direnv--disable)
|
||||
(funcall (if direnv-mode 'add-hook 'remove-hook)
|
||||
'after-change-major-mode-hook
|
||||
#'direnv--maybe-update-environment)))
|
||||
(add-to-list 'direnv-non-file-modes 'vterm-mode)
|
||||
|
||||
(defadvice! +direnv--make-process-environment-buffer-local-a (items)
|
||||
:filter-return #'direnv--export
|
||||
(when items
|
||||
(mapc 'kill-local-variable '(process-environment exec-path))
|
||||
(mapc 'make-local-variable '(process-environment exec-path)))
|
||||
items)
|
||||
(defun +direnv-envrc-fontify-keywords-h ()
|
||||
"Fontify special .envrc keywords; it's a good indication of whether or not
|
||||
we've typed them correctly."
|
||||
(font-lock-add-keywords
|
||||
nil `((,(regexp-opt +direnv-keywords 'symbols)
|
||||
(0 font-lock-keyword-face)))))
|
||||
|
||||
;; Fontify special .envrc keywords; it's a good indication of whether or not
|
||||
;; we've typed them correctly.
|
||||
(add-hook! 'direnv-envrc-mode-hook
|
||||
(defun +direnv-envrc-fontify-keywords-h ()
|
||||
(font-lock-add-keywords
|
||||
nil `((,(regexp-opt +direnv--keywords 'symbols)
|
||||
(0 font-lock-keyword-face)))))
|
||||
(defun +direnv-update-on-save-h ()
|
||||
(add-hook 'after-save-hook #'direnv--maybe-update-environment
|
||||
nil 'local)))
|
||||
|
||||
(defadvice! +direnv-update-a (&rest _)
|
||||
"Update direnv. Useful to advise functions that may run
|
||||
environment-sensitive logic like `flycheck-default-executable-find'. This fixes
|
||||
flycheck issues with direnv and on nix."
|
||||
:before #'flycheck-default-executable-find
|
||||
(direnv--maybe-update-environment))
|
||||
|
||||
(defadvice! +direnv--fail-gracefully-a (orig-fn)
|
||||
"Don't try to update direnv if the executable isn't present."
|
||||
:around #'direnv--maybe-update-environment
|
||||
(if (executable-find "direnv")
|
||||
(when (file-readable-p (or buffer-file-name default-directory))
|
||||
(funcall orig-fn))
|
||||
(doom-log "Couldn't find direnv executable")))
|
||||
|
||||
(defadvice! +direnv-update-async-shell-command-a (command &optional output-buffer _error-buffer)
|
||||
:before #'shell-command
|
||||
(when (string-match "[ \t]*&[ \t]*\\'" command)
|
||||
(let ((environment process-environment)
|
||||
(path exec-path)
|
||||
(shell shell-file-name))
|
||||
(with-current-buffer
|
||||
(get-buffer-create (or output-buffer "*Async Shell Command*"))
|
||||
(setq-local process-environment environment)
|
||||
(setq-local exec-path path)
|
||||
(setq-local shell-file-name shell)))))
|
||||
(defadvice! +direnv--fail-gracefully-a (&rest _)
|
||||
"Don't try to use direnv if the executable isn't present."
|
||||
:before-while #'direnv-update-directory-environment
|
||||
(or (executable-find "direnv")
|
||||
(ignore (doom-log "Couldn't find direnv executable"))))
|
||||
|
||||
(direnv-mode +1))
|
||||
|
|
|
@ -281,34 +281,16 @@ Otherwise, falls back on `find-file-at-point'."
|
|||
(if ffap-url-regexp "Find file or URL: " "Find file: ")
|
||||
(doom-thing-at-point-or-region))))))
|
||||
(require 'ffap)
|
||||
(cond ((not path)
|
||||
(call-interactively #'find-file-at-point))
|
||||
(cond ((and path
|
||||
buffer-file-name
|
||||
(file-equal-p path buffer-file-name)
|
||||
(user-error "Already here")))
|
||||
|
||||
((ffap-url-p path)
|
||||
(find-file-at-point path))
|
||||
((+lookup--jump-to :file path))
|
||||
|
||||
((not (+lookup--jump-to :file path))
|
||||
(let ((fullpath (doom-path path)))
|
||||
(when (and buffer-file-name (file-equal-p fullpath buffer-file-name))
|
||||
(user-error "Already here"))
|
||||
(let* ((insert-default-directory t)
|
||||
(project-root (doom-project-root))
|
||||
(ffap-file-finder
|
||||
(cond ((not (doom-glob fullpath))
|
||||
#'find-file)
|
||||
((ignore-errors (file-in-directory-p fullpath project-root))
|
||||
(lambda (dir)
|
||||
(let* ((default-directory dir)
|
||||
projectile-project-name
|
||||
projectile-project-root
|
||||
(projectile-project-root-cache (make-hash-table :test 'equal))
|
||||
(file (projectile-completing-read "Find file: "
|
||||
(projectile-current-project-files)
|
||||
:initial-input path)))
|
||||
(find-file (expand-file-name file (doom-project-root)))
|
||||
(run-hooks 'projectile-find-file-hook))))
|
||||
(#'doom-project-browse))))
|
||||
(find-file-at-point path))))))
|
||||
((stringp path) (find-file-at-point path))
|
||||
|
||||
((call-interactively #'find-file-at-point))))
|
||||
|
||||
|
||||
;;
|
||||
|
@ -335,7 +317,7 @@ Otherwise, falls back on `find-file-at-point'."
|
|||
((user-error "No dictionary backend is available"))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +lookup/synonyms (identifier &optional arg)
|
||||
(defun +lookup/synonyms (identifier &optional _arg)
|
||||
"Look up and insert a synonym for the word at point (or selection)."
|
||||
(interactive
|
||||
(list (doom-thing-at-point-or-region 'word) ; TODO actually use this
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
(package! helm))
|
||||
|
||||
;;
|
||||
(package! dumb-jump :pin "738d40ceb7")
|
||||
(package! dumb-jump :pin "daddd9ba6a")
|
||||
(when (featurep! :completion ivy)
|
||||
(package! ivy-xref :pin "3d4c35fe2b"))
|
||||
(when (featurep! :completion helm)
|
||||
|
@ -26,7 +26,7 @@
|
|||
(package! osx-dictionary :pin "1b79ff64c7")
|
||||
(package! define-word :pin "d8c76d503b")
|
||||
(package! powerthesaurus :pin "81a262ec0c")
|
||||
(package! request :pin "4be823a89b")
|
||||
(package! request)
|
||||
(when (featurep! +offline)
|
||||
(package! wordnut :pin "feac531404")
|
||||
(package! synosaurus :pin "14d34fc92a"))))
|
||||
|
|
|
@ -118,7 +118,12 @@ This also logs the resolved project root, if found, so we know where we are."
|
|||
(lsp--flymake-setup))
|
||||
((require 'flycheck nil t)
|
||||
(require 'lsp-ui-flycheck)
|
||||
(lsp-ui-flycheck-enable t)))))
|
||||
(let ((old-checker flycheck-checker))
|
||||
(lsp-ui-flycheck-enable t)
|
||||
(when old-checker
|
||||
(setq-local flycheck-checker old-checker)
|
||||
(kill-local-variable 'flycheck-check-syntax-automatically)))))))
|
||||
|
||||
:config
|
||||
(setq lsp-prefer-flymake nil
|
||||
lsp-ui-doc-max-height 8
|
||||
|
|
|
@ -1,24 +1,39 @@
|
|||
;;; ui/doom/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(defvar +doom-solaire-themes
|
||||
'((doom-challenger-deep . t)
|
||||
'((doom-acario-dark . t)
|
||||
(doom-acario-light . t)
|
||||
(doom-challenger-deep . t)
|
||||
(doom-city-lights . t)
|
||||
(doom-dark+ . t)
|
||||
(doom-dracula . t)
|
||||
(doom-molokai)
|
||||
(doom-fairy-floss . t)
|
||||
(doom-gruvbox . t)
|
||||
(doom-horizon . t)
|
||||
(doom-laserwave . t)
|
||||
(doom-losvkem . t)
|
||||
(doom-manegarm . t)
|
||||
(doom-material . t)
|
||||
(doom-molokai . t)
|
||||
(doom-moonlight . t)
|
||||
(doom-nord . t)
|
||||
(doom-nord-light . t)
|
||||
(doom-nova)
|
||||
(doom-nova . t)
|
||||
(doom-oceanic-next . t)
|
||||
(doom-one . t)
|
||||
(doom-one-light . t)
|
||||
(doom-outrun-electric . t)
|
||||
(doom-opera . t)
|
||||
(doom-palenight . t)
|
||||
(doom-peacock . t)
|
||||
(doom-snazzy . t)
|
||||
(doom-solarized-dark . t)
|
||||
(doom-solarized-light)
|
||||
(doom-sourcerer . t)
|
||||
(doom-spacegrey . t)
|
||||
(doom-tomorrow-day . t)
|
||||
(doom-tomorrow-night . t)
|
||||
(doom-vibrant))
|
||||
(doom-vibrant . t))
|
||||
"An alist of themes that support `solaire-mode'. If CDR is t, then
|
||||
`solaire-mode-swap-bg' will be used automatically, when the theme is loaded.")
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; ui/doom/packages.el
|
||||
|
||||
(package! doom-themes :pin "d48df7b02e")
|
||||
(package! doom-themes :pin "7131b60161")
|
||||
(package! solaire-mode :pin "4ac324ccb0")
|
||||
|
|
|
@ -21,14 +21,10 @@ Meant for `doom-change-font-size-hook'."
|
|||
(setq +modeline--old-bar-height doom-modeline-height))
|
||||
(let ((default-height +modeline--old-bar-height)
|
||||
(scale (or (frame-parameter nil 'font-scale) 0)))
|
||||
(if (> scale 0)
|
||||
(let ((font-size (string-to-number
|
||||
(aref (doom--font-name (frame-parameter nil 'font)
|
||||
(selected-frame))
|
||||
xlfd-regexp-pixelsize-subnum)))
|
||||
(scale (frame-parameter nil 'font-scale)))
|
||||
(setq doom-modeline-height (+ default-height (* scale doom-font-increment))))
|
||||
(setq doom-modeline-height default-height))))
|
||||
(setq doom-modeline-height
|
||||
(if (> scale 0)
|
||||
(+ default-height (* scale doom-font-increment))
|
||||
default-height))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +modeline-update-env-in-all-windows-h (&rest _)
|
||||
|
|
|
@ -58,19 +58,6 @@
|
|||
(doom-modeline-set-project-modeline)
|
||||
(hide-mode-line-mode))))
|
||||
|
||||
;; Remove unused segments & extra padding
|
||||
(doom-modeline-def-modeline 'main
|
||||
'(bar window-number matches buffer-info remote-host buffer-position selection-info)
|
||||
'(objed-state misc-info persp-name irc mu4e github debug input-method buffer-encoding lsp major-mode process vcs checker))
|
||||
|
||||
(doom-modeline-def-modeline 'special
|
||||
'(bar window-number matches buffer-info-simple buffer-position selection-info)
|
||||
'(objed-state misc-info persp-name debug input-method irc-buffers buffer-encoding lsp major-mode process checker))
|
||||
|
||||
(doom-modeline-def-modeline 'project
|
||||
'(bar window-number buffer-default-directory)
|
||||
'(misc-info mu4e github debug battery " " major-mode process))
|
||||
|
||||
;; Some functions modify the buffer, causing the modeline to show a false
|
||||
;; modified state, so force them to behave.
|
||||
(defadvice! +modeline--inhibit-modification-hooks-a (orig-fn &rest args)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
;;; ui/modeline/packages.el
|
||||
|
||||
(unless (featurep! +light)
|
||||
(package! doom-modeline :pin "21ac606325"))
|
||||
(package! doom-modeline :pin "31a5ae99b8"))
|
||||
(package! anzu :pin "592f8ee6d0")
|
||||
(when (featurep! :editor evil)
|
||||
(package! evil-anzu :pin "9bca6ca14d"))
|
||||
|
|
|
@ -68,13 +68,14 @@ error if NAME doesn't exist."
|
|||
"Return a list of workspace structs (satisifes `+workspace-p')."
|
||||
;; We don't use `hash-table-values' because it doesn't ensure order in older
|
||||
;; versions of Emacs
|
||||
(cdr (cl-loop for persp being the hash-values of *persp-hash*
|
||||
collect persp)))
|
||||
(cl-loop for name in persp-names-cache
|
||||
if (gethash name *persp-hash*)
|
||||
collect it))
|
||||
|
||||
;;;###autoload
|
||||
(defun +workspace-list-names ()
|
||||
"Return the list of names of open workspaces."
|
||||
(mapcar #'safe-persp-name (+workspace-list)))
|
||||
persp-names-cache)
|
||||
|
||||
;;;###autoload
|
||||
(defun +workspace-buffer-list (&optional persp)
|
||||
|
@ -403,6 +404,31 @@ the next."
|
|||
|
||||
((+workspace-error "Can't delete last workspace" t)))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +workspace/swap-left (&optional count)
|
||||
"Swap the current workspace with the COUNTth workspace on its left."
|
||||
(interactive "p")
|
||||
(let* ((current-name (+workspace-current-name))
|
||||
(count (or count 1))
|
||||
(index (- (cl-position current-name persp-names-cache :test #'equal)
|
||||
count))
|
||||
(names (remove current-name persp-names-cache)))
|
||||
(unless names
|
||||
(user-error "Only one workspace"))
|
||||
(let ((index (min (max 0 index) (length names))))
|
||||
(setq persp-names-cache
|
||||
(append (cl-subseq names 0 index)
|
||||
(list current-name)
|
||||
(cl-subseq names index))))
|
||||
(when (called-interactively-p 'any)
|
||||
(+workspace/display))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +workspace/swap-right (&optional count)
|
||||
"Swap the current workspace with the COUNTth workspace on its right."
|
||||
(interactive "p")
|
||||
(funcall-interactively #'+workspace/swap-left (- count)))
|
||||
|
||||
|
||||
;;
|
||||
;;; Tabs display in minibuffer
|
||||
|
|
|
@ -76,10 +76,13 @@ stored in `persp-save-dir'.")
|
|||
"Ensure a main workspace exists."
|
||||
(when persp-mode
|
||||
(let (persp-before-switch-functions)
|
||||
;; The default perspective persp-mode creates (`persp-nil-name') is
|
||||
;; special and doesn't represent a real persp object, so buffers can't
|
||||
;; really be assigned to it, among other quirks. We create a *real* main
|
||||
;; workspace to fill this role.
|
||||
;; The default perspective persp-mode creates is special and doesn't
|
||||
;; represent a real persp object, so buffers can't really be assigned
|
||||
;; to it, among other quirks. We hide the nil persp...
|
||||
(when (equal (car persp-names-cache) persp-nil-name)
|
||||
(pop persp-names-cache))
|
||||
;; ...and create a *real* main workspace to fill this role, and hide
|
||||
;; the nil perspective.
|
||||
(unless (or (persp-get-by-name +workspaces-main)
|
||||
;; Start from 2 b/c persp-mode counts the nil workspace
|
||||
(> (hash-table-count *persp-hash*) 2))
|
||||
|
|
|
@ -20,7 +20,8 @@
|
|||
(defun +zen-enable-text-scaling-mode-h ()
|
||||
"Enable `mixed-pitch-mode' when in `+zen-mixed-pitch-modes'."
|
||||
(when (/= +zen-text-scale 0)
|
||||
(text-scale-set (if writeroom-mode +zen-text-scale 0)))))
|
||||
(text-scale-set (if writeroom-mode +zen-text-scale 0))
|
||||
(visual-fill-column-adjust))))
|
||||
|
||||
;; Adjust margins when text size is changed
|
||||
(advice-add #'text-scale-adjust :after #'visual-fill-column-adjust))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue