dev: merge branch 'master'
This commit is contained in:
commit
ad8f5470b0
39 changed files with 433 additions and 661 deletions
|
@ -412,7 +412,7 @@
|
|||
:desc "Rename workspace" "r" #'+workspace/rename
|
||||
:desc "Create workspace" "c" #'+workspace/new
|
||||
:desc "Create named workspace" "C" #'+workspace/new-named
|
||||
:desc "Delete workspace" "k" #'+workspace/delete
|
||||
:desc "Delete workspace" "k" #'+workspace/kill
|
||||
:desc "Save workspace" "S" #'+workspace/save
|
||||
:desc "Switch to other workspace" "o" #'+workspace/other
|
||||
:desc "Switch to left workspace" "p" #'+workspace/switch-left
|
||||
|
|
|
@ -46,7 +46,8 @@
|
|||
(doom-lookup-key (kbd "TAB") overriding-terminal-local-map))
|
||||
cmd)
|
||||
,@(when (modulep! :editor snippets)
|
||||
'(((+yas-active-p)
|
||||
'(((memq (bound-and-true-p yas--active-field-overlay)
|
||||
(overlays-in (1- (point)) (1+ (point))))
|
||||
#'yas-next-field-or-maybe-expand)
|
||||
((yas-maybe-expand-abbrev-key-filter 'yas-expand)
|
||||
#'yas-expand)))
|
||||
|
@ -379,8 +380,8 @@
|
|||
:desc "New named workspace" "N" #'+workspace/new-named
|
||||
:desc "Load workspace from file" "l" #'+workspace/load
|
||||
:desc "Save workspace to file" "s" #'+workspace/save
|
||||
:desc "Delete session" "x" #'+workspace/kill-session
|
||||
:desc "Delete this workspace" "d" #'+workspace/delete
|
||||
:desc "Kill session" "x" #'+workspace/kill-session
|
||||
:desc "Kill this workspace" "d" #'+workspace/kill
|
||||
:desc "Rename workspace" "r" #'+workspace/rename
|
||||
:desc "Restore last session" "R" #'+workspace/restore-last-session
|
||||
:desc "Next workspace" "]" #'+workspace/switch-right
|
||||
|
@ -484,6 +485,8 @@
|
|||
:desc "Browse emacs.d" "E" #'doom/browse-in-emacsd
|
||||
:desc "Find file" "f" #'find-file
|
||||
:desc "Find file from here" "F" #'+default/find-file-under-here
|
||||
(:when (modulep! :config literate)
|
||||
:desc "Open heading in literate config" "h" #'+literate/find-heading)
|
||||
:desc "Locate file" "l" #'locate
|
||||
:desc "Find file in private config" "p" #'doom/find-file-in-private-config
|
||||
:desc "Browse private config" "P" #'doom/open-private-config
|
||||
|
@ -522,7 +525,7 @@
|
|||
:desc "Magit fetch" "F" #'magit-fetch
|
||||
:desc "Magit buffer log" "L" #'magit-log-buffer-file
|
||||
:desc "Git stage this file" "S" #'magit-stage-buffer-file
|
||||
:desc "Git unstage this file" "U" #'magit-unstage-file
|
||||
:desc "Git unstage this file" "U" #'magit-unstage-buffer-file
|
||||
(:prefix ("f" . "find")
|
||||
:desc "Find file" "f" #'magit-find-file
|
||||
:desc "Find gitconfig file" "g" #'magit-find-git-config-file
|
||||
|
|
|
@ -106,6 +106,41 @@
|
|||
;;;###autoload
|
||||
(defalias '+literate/reload #'doom/reload)
|
||||
|
||||
(defun +literate--flatten-imenu-index (index &optional prefix)
|
||||
"Flatten an org-mode imenu index."
|
||||
(let ((flattened '()))
|
||||
(dolist (item index flattened)
|
||||
(let* ((name (propertize (car item) 'face (intern (format "org-level-%d" (if prefix (+ 2 (cl-count ?/ prefix)) 1)))))
|
||||
(prefix (if prefix (concat prefix "/" name) name)))
|
||||
(if (imenu--subalist-p item)
|
||||
(setq flattened (append flattened (+literate--flatten-imenu-index (cdr item) prefix)))
|
||||
(push (cons prefix (cdr item)) flattened))))
|
||||
(nreverse flattened)))
|
||||
|
||||
(defvar imenu-auto-rescan)
|
||||
;;;###autoload
|
||||
(defun +literate/find-heading (&optional level)
|
||||
"Jump to a heading in your literate org config file."
|
||||
(interactive "P")
|
||||
(let* ((buffer (or (find-buffer-visiting +literate-config-file)
|
||||
(find-file-noselect +literate-config-file t))))
|
||||
(with-current-buffer buffer
|
||||
(let* ((imenu-auto-rescan t)
|
||||
(org-imenu-depth (or level 8))
|
||||
(index (+literate--flatten-imenu-index (imenu--make-index-alist))))
|
||||
(let ((c (current-window-configuration))
|
||||
(result nil))
|
||||
(unwind-protect
|
||||
(progn
|
||||
(switch-to-buffer buffer)
|
||||
(if (modulep! :completion vertico)
|
||||
(setq result (consult-outline level))
|
||||
(let ((entry (assoc (completing-read "Go to heading: " index nil t) index)))
|
||||
(setq result entry)
|
||||
(imenu entry))))
|
||||
(unless result
|
||||
(set-window-configuration c))))))))
|
||||
|
||||
|
||||
;;
|
||||
;;; Hooks
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue