mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
feat(navigation): Improve narrowing with recursive-narrow package
Additionally allow `recursive-narrow-or-widen-dwin` to also trigger `org-edit-src-code` within org buffers. This technically does not use narrowing, but it does "focus" on the source code block for editing, so it at least in spirit embodies the intent of narrowing. This behavior was inspired by: https://endlessparentheses.com/emacs-narrow-or-widen-dwim.html
This commit is contained in:
@@ -62,6 +62,7 @@
|
||||
(require 'siren-helm-ag)
|
||||
(require 'siren-helm-open-github)
|
||||
(require 'siren-helm-swoop)
|
||||
(require 'siren-recursive-narrow)
|
||||
(require 'siren-scroll-half-screen)
|
||||
|
||||
;; Project management
|
||||
|
||||
24
modules/navigation/siren-recursive-narrow.el
Normal file
24
modules/navigation/siren-recursive-narrow.el
Normal file
@@ -0,0 +1,24 @@
|
||||
;;; siren-recursive-narrow.el --- jimeh's Emacs Siren: recursive-narrow configuration.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Basic configuration for recursive-narrow.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(use-package recursive-narrow
|
||||
:bind
|
||||
("C-x C-n" . recursive-narrow-or-widen-dwim)
|
||||
("C-x n w" . recursive-widen)
|
||||
("C-x n n" . recursive-narrow-or-widen-dwim)
|
||||
|
||||
:config
|
||||
(add-hook 'recursive-narrow-dwim-functions
|
||||
'siren-recursive-narrow-org-edit-src-code)
|
||||
|
||||
:init
|
||||
(defun siren-recursive-narrow-org-edit-src-code()
|
||||
(ignore-errors (org-edit-src-code) t)))
|
||||
|
||||
(provide 'siren-recursive-narrow)
|
||||
;;; siren-recursive-narrow.el ends here
|
||||
@@ -13,16 +13,21 @@
|
||||
(require 'siren-smartparens)
|
||||
|
||||
(use-package org
|
||||
:bind (:map org-mode-map
|
||||
("C-j" . org-return-indent)
|
||||
("RET" . org-return-indent)
|
||||
("M-{" . org-promote-subtree)
|
||||
("M-}" . org-demote-subtree)
|
||||
("M-P" . org-metaup)
|
||||
("M-N" . org-metadown)
|
||||
("C-M-n" . outline-next-visible-heading)
|
||||
("C-M-p" . outline-previous-visible-heading))
|
||||
:hook (org-mode . siren-org-mode-setup)
|
||||
:bind
|
||||
(:map org-mode-map
|
||||
("C-j" . org-return-indent)
|
||||
("RET" . org-return-indent)
|
||||
("M-{" . org-promote-subtree)
|
||||
("M-}" . org-demote-subtree)
|
||||
("M-P" . org-metaup)
|
||||
("M-N" . org-metadown)
|
||||
("C-M-n" . outline-next-visible-heading)
|
||||
("C-M-p" . outline-previous-visible-heading))
|
||||
(:map org-src-mode-map
|
||||
("C-c C-c" . org-edit-src-exit))
|
||||
|
||||
:hook
|
||||
(org-mode . siren-org-mode-setup)
|
||||
|
||||
:custom
|
||||
(org-blank-before-new-entry '((heading . auto) (plain-list-item . nil)))
|
||||
|
||||
Reference in New Issue
Block a user