Merge branch 'develop' of https://github.com/hlissner/doom-emacs into add-lsp-command-map
This commit is contained in:
commit
fb3c6f9d78
205 changed files with 2592 additions and 1819 deletions
|
@ -39,7 +39,7 @@
|
|||
:desc "Delete trailing whitespace" "w" #'delete-trailing-whitespace
|
||||
:desc "Delete trailing newlines" "W" #'doom/delete-trailing-newlines
|
||||
:desc "List errors" "x" #'flymake-show-diagnostics-buffer
|
||||
(:when (featurep! :tools flycheck)
|
||||
(:when (featurep! :checkers syntax)
|
||||
:desc "List errors" "x" #'flycheck-list-errors)
|
||||
(:when (featurep! :tools lsp)
|
||||
:desc "LSP Code actions" "a" #'lsp-execute-code-action
|
||||
|
@ -159,7 +159,7 @@
|
|||
:desc "Switch to buffer" "b" #'org-roam-switch-to-buffer
|
||||
:desc "Org Roam Capture" "c" #'org-roam-capture
|
||||
:desc "Find file" "f" #'org-roam-find-file
|
||||
:desc "Show graph" "g" #'org-roam-graph-show
|
||||
:desc "Show graph" "g" #'org-roam-graph
|
||||
:desc "Insert" "i" #'org-roam-insert
|
||||
:desc "Org Roam" "r" #'org-roam
|
||||
(:prefix ("d" . "by date")
|
||||
|
@ -182,7 +182,7 @@
|
|||
:desc "Find file in project sidebar" "P" #'+neotree/find-this-file)
|
||||
(:when (featurep! :ui treemacs)
|
||||
:desc "Project sidebar" "p" #'+treemacs/toggle
|
||||
:desc "Find file in project rsidebar" "P" #'+treemacs/find-file)
|
||||
:desc "Find file in project rsidebar" "P" #'treemacs-find-file)
|
||||
(:when (featurep! :term shell)
|
||||
:desc "Toggle shell popup" "t" #'+shell/toggle
|
||||
:desc "Open shell here" "T" #'+shell/here)
|
||||
|
@ -249,14 +249,14 @@
|
|||
:desc "Indent style" "I" #'doom/toggle-indent-style
|
||||
:desc "Line numbers" "l" #'doom/toggle-line-numbers
|
||||
:desc "Word-wrap mode" "w" #'+word-wrap-mode
|
||||
(:when (featurep! :tools flycheck)
|
||||
(:when (featurep! :checkers syntax)
|
||||
:desc "Flycheck" "f" #'flycheck-mode)
|
||||
(:when (featurep! :ui indent-guides)
|
||||
:desc "Indent guides" "i" #'highlight-indent-guides-mode)
|
||||
(:when (featurep! :lang org +present)
|
||||
:desc "org-tree-slide mode" "p" #'+org-present/start)
|
||||
:desc "Read-only mode" "r" #'read-only-mode
|
||||
(:when (featurep! :tools flyspell)
|
||||
(:when (featurep! :checkers spell)
|
||||
:desc "Flyspell" "s" #'flyspell-mode)
|
||||
(:when (featurep! :lang org +pomodoro)
|
||||
:desc "Pomodoro timer" "t" #'org-pomodoro)
|
||||
|
@ -543,14 +543,4 @@
|
|||
;;; treemacs
|
||||
(:when (featurep! :ui treemacs)
|
||||
"<f9>" #'+treemacs/toggle
|
||||
"<C-f9>" #'+treemacs/find-file)
|
||||
|
||||
;;; yasnippet
|
||||
(:after yasnippet
|
||||
:map yas-keymap ; keymap while editing an inserted snippet
|
||||
"C-e" #'+snippets/goto-end-of-field
|
||||
"C-a" #'+snippets/goto-start-of-field
|
||||
"<S-tab>" #'yas-prev-field
|
||||
"<M-backspace>" #'+snippets/delete-to-start-of-field
|
||||
[backspace] #'+snippets/delete-backward-char
|
||||
[delete] #'+snippets/delete-forward-char-or-field))
|
||||
"<C-f9>" #'treemacs-find-file))
|
||||
|
|
|
@ -4,9 +4,12 @@
|
|||
;; NOTE SPC u replaces C-u as the universal argument.
|
||||
|
||||
;; Minibuffer
|
||||
(define-key! evil-ex-completion-map
|
||||
(define-key! :keymaps '(evil-ex-completion-map evil-ex-search-keymap)
|
||||
"C-a" #'evil-beginning-of-line
|
||||
"C-b" #'evil-backward-char)
|
||||
"C-b" #'evil-backward-char
|
||||
"C-f" #'evil-forward-char
|
||||
"C-j" #'next-complete-history-element
|
||||
"C-k" #'previous-complete-history-element)
|
||||
|
||||
(define-key! :keymaps +default-minibuffer-maps
|
||||
[escape] #'abort-recursive-edit
|
||||
|
@ -15,16 +18,20 @@
|
|||
"C-u" #'evil-delete-back-to-indentation
|
||||
"C-v" #'yank
|
||||
"C-w" #'doom/delete-backward-word
|
||||
"C-z" (λ! (ignore-errors (call-interactively #'undo)))
|
||||
;; Scrolling lines
|
||||
"C-j" #'next-line
|
||||
"C-k" #'previous-line
|
||||
"C-S-j" #'scroll-up-command
|
||||
"C-S-k" #'scroll-down-command)
|
||||
"C-z" (λ! (ignore-errors (call-interactively #'undo))))
|
||||
|
||||
(define-key! read-expression-map
|
||||
"C-j" #'next-line-or-history-element
|
||||
"C-k" #'previous-line-or-history-element))
|
||||
(when (featurep! :editor evil +everywhere)
|
||||
(define-key! :keymaps +default-minibuffer-maps
|
||||
"C-j" #'next-line
|
||||
"C-k" #'previous-line
|
||||
"C-S-j" #'scroll-up-command
|
||||
"C-S-k" #'scroll-down-command)
|
||||
(define-key! :states 'insert :keymaps +default-minibuffer-maps
|
||||
"C-j" #'next-line
|
||||
"C-k" #'previous-line)
|
||||
(define-key! read-expression-map
|
||||
"C-j" #'next-line-or-history-element
|
||||
"C-k" #'previous-line-or-history-element)))
|
||||
|
||||
|
||||
;;
|
||||
|
@ -186,9 +193,9 @@
|
|||
|
||||
;;; :ui
|
||||
(map! (:when (featurep! :ui popup)
|
||||
:n "C-`" #'+popup/toggle
|
||||
:n "C-~" #'+popup/raise
|
||||
:g "C-x p" #'+popup/other)
|
||||
"C-`" #'+popup/toggle
|
||||
"C-~" #'+popup/raise
|
||||
"C-x p" #'+popup/other)
|
||||
|
||||
(:when (featurep! :ui workspaces)
|
||||
:n "C-t" #'+workspace/new
|
||||
|
@ -489,7 +496,7 @@
|
|||
:desc "Switch to buffer" "b" #'org-roam-switch-to-buffer
|
||||
:desc "Org Roam Capture" "c" #'org-roam-capture
|
||||
:desc "Find file" "f" #'org-roam-find-file
|
||||
:desc "Show graph" "g" #'org-roam-graph-show
|
||||
:desc "Show graph" "g" #'org-roam-graph
|
||||
:desc "Insert" "i" #'org-roam-insert
|
||||
:desc "Org Roam" "r" #'org-roam
|
||||
(:prefix ("d" . "by date")
|
||||
|
@ -522,7 +529,7 @@
|
|||
:desc "Find file in project sidebar" "P" #'+neotree/find-this-file)
|
||||
(:when (featurep! :ui treemacs)
|
||||
:desc "Project sidebar" "p" #'+treemacs/toggle
|
||||
:desc "Find file in project sidebar" "P" #'+treemacs/find-file)
|
||||
:desc "Find file in project sidebar" "P" #'treemacs-find-file)
|
||||
(:when (featurep! :term shell)
|
||||
:desc "Toggle shell popup" "t" #'+shell/toggle
|
||||
:desc "Open shell here" "T" #'+shell/here)
|
||||
|
|
|
@ -27,11 +27,15 @@
|
|||
;;;###autoload
|
||||
(defun +default/browse-notes ()
|
||||
"Browse files from `org-directory'."
|
||||
(interactive) (doom-project-browse org-directory))
|
||||
(interactive)
|
||||
(require 'org)
|
||||
(doom-project-browse org-directory))
|
||||
;;;###autoload
|
||||
(defun +default/find-in-notes ()
|
||||
"Find a file under `org-directory', recursively."
|
||||
(interactive) (doom-project-find-file org-directory))
|
||||
(interactive)
|
||||
(require 'org)
|
||||
(doom-project-find-file org-directory))
|
||||
|
||||
;;;###autoload
|
||||
(defun +default/find-file-under-here ()
|
||||
|
|
|
@ -25,7 +25,8 @@ If prefix ARG is set, prompt for a directory to search from."
|
|||
"Conduct a text search in the current project root.
|
||||
If prefix ARG is set, prompt for a known project to search from."
|
||||
(interactive "P")
|
||||
(let* ((disabled-command-function nil)
|
||||
(let* ((projectile-project-root nil)
|
||||
(disabled-command-function nil)
|
||||
(default-directory
|
||||
(if arg
|
||||
(if-let (projects (projectile-relevant-known-projects))
|
||||
|
@ -51,13 +52,14 @@ If prefix ARG is set, prompt for a known project to search from."
|
|||
(interactive
|
||||
(list (rxt-quote-pcre (or (doom-thing-at-point-or-region) ""))
|
||||
current-prefix-arg))
|
||||
(let ((default-directory
|
||||
(if arg
|
||||
(if-let (projects (projectile-relevant-known-projects))
|
||||
(completing-read "Switch to project: " projects
|
||||
nil t nil nil (doom-project-root))
|
||||
(user-error "There are no known projects"))
|
||||
default-directory)))
|
||||
(let* ((projectile-project-root nil)
|
||||
(default-directory
|
||||
(if arg
|
||||
(if-let (projects (projectile-relevant-known-projects))
|
||||
(completing-read "Switch to project: " projects
|
||||
nil t nil nil (doom-project-root))
|
||||
(user-error "There are no known projects"))
|
||||
default-directory)))
|
||||
(cond ((featurep! :completion ivy)
|
||||
(+ivy/project-search nil symbol))
|
||||
((featurep! :completion helm)
|
||||
|
|
|
@ -50,21 +50,6 @@ If `buffer-file-name' isn't set, uses `default-directory'."
|
|||
(abbreviate-file-name path)
|
||||
(file-name-nondirectory path)))))
|
||||
|
||||
;;;###autoload
|
||||
(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
|
||||
languages with weak native comment continuation support (like C-family
|
||||
languages)."
|
||||
(interactive)
|
||||
(if (and (sp-point-in-comment)
|
||||
comment-line-break-function)
|
||||
(funcall comment-line-break-function nil)
|
||||
(delete-horizontal-space t)
|
||||
(newline nil t)
|
||||
(indent-according-to-mode)))
|
||||
|
||||
|
||||
(defun doom--backward-delete-whitespace-to-column ()
|
||||
"Delete back to the previous column of whitespace, or as much whitespace as
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
;;; config/default/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(defvar +default-want-RET-continue-comments t
|
||||
"If non-nil, RET will continue commented lines.")
|
||||
|
||||
(defvar +default-minibuffer-maps
|
||||
(append '(minibuffer-local-map
|
||||
minibuffer-local-ns-map
|
||||
|
@ -31,7 +34,10 @@
|
|||
(after! epa
|
||||
;; With GPG 2.1+, this forces gpg-agent to use the Emacs minibuffer to prompt
|
||||
;; for the key passphrase.
|
||||
(setq epa-pinentry-mode 'loopback)
|
||||
(set (if EMACS27+
|
||||
'epg-pinentry-mode
|
||||
'epa-pinentry-mode) ; DEPRECATED `epa-pinentry-mode'
|
||||
'loopback)
|
||||
;; Default to the first secret key available in your keyring.
|
||||
(setq-default
|
||||
epa-file-encrypt-to
|
||||
|
@ -217,8 +223,28 @@
|
|||
;; f) do none of this when inside a string
|
||||
(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-a))
|
||||
;; HACK Makes `newline-and-indent' continue comments (and more reliably).
|
||||
;; Consults `doom-point-in-comment-functions' to detect a commented
|
||||
;; region and uses that mode's `comment-line-break-function' to continue
|
||||
;; comments. If neither exists, it will fall back to the normal behavior
|
||||
;; of `newline-and-indent'.
|
||||
;;
|
||||
;; We use an advice here instead of a remapping because many modes define
|
||||
;; and remap to their own newline-and-indent commands, and tackling all
|
||||
;; those cases was judged to be more work than dealing with the edge
|
||||
;; cases on a case by case basis.
|
||||
(defadvice! +default--newline-indent-and-continue-comments-a (&rest _)
|
||||
"A replacement for `newline-and-indent'.
|
||||
|
||||
Continues comments if executed from a commented line. Consults
|
||||
`doom-point-in-comment-functions' to determine if in a comment."
|
||||
:before-until #'newline-and-indent
|
||||
(interactive "*")
|
||||
(when (and +default-want-RET-continue-comments
|
||||
(doom-point-in-comment-p)
|
||||
(fboundp comment-line-break-function))
|
||||
(funcall comment-line-break-function nil)
|
||||
t)))
|
||||
|
||||
|
||||
;;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; config/default/packages.el
|
||||
|
||||
(package! avy :pin "3bf83140fa")
|
||||
(package! drag-stuff :pin "6d06d846cd")
|
||||
(package! link-hint :pin "0d9cabcdb7")
|
||||
(package! avy :pin "509471bad0e8094b8639729ec39ca141fae7d4bd")
|
||||
(package! drag-stuff :pin "6d06d846cd37c052d79acd0f372c13006aa7e7c8")
|
||||
(package! link-hint :pin "7440704cacb5c0fab35fff8ec59d30fbea17f44a")
|
||||
|
||||
(unless (featurep! :editor evil)
|
||||
(package! expand-region :pin "ea6b4cbb99"))
|
||||
(package! expand-region :pin "ea6b4cbb9985ddae532bd2faf9bb00570c9f2781"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue