lang/org: clear src block results on TAB
When cursor is inside a src block. e.g. #+BEGIN_SRC elisp <-- not here (message "hi") <-- in here #+END_SRC <-- not here
This commit is contained in:
parent
f8ff50565e
commit
b9f90b3a1a
2 changed files with 13 additions and 2 deletions
|
@ -406,6 +406,14 @@ with `org-cycle')."
|
||||||
(org-cycle-internal-local)
|
(org-cycle-internal-local)
|
||||||
t)))))
|
t)))))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun +org-clear-babel-results-h ()
|
||||||
|
"Remove the results block for the org babel block at point."
|
||||||
|
(when (and (org-in-src-block-p t)
|
||||||
|
(org-babel-where-is-src-block-result))
|
||||||
|
(org-babel-remove-result)
|
||||||
|
t))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +org-unfold-to-2nd-level-or-point-h ()
|
(defun +org-unfold-to-2nd-level-or-point-h ()
|
||||||
"My version of the 'overview' #+STARTUP option: expand first-level headings.
|
"My version of the 'overview' #+STARTUP option: expand first-level headings.
|
||||||
|
|
|
@ -850,8 +850,11 @@ compelling reason, so..."
|
||||||
(defvar evil-org-use-additional-insert t)
|
(defvar evil-org-use-additional-insert t)
|
||||||
:config
|
:config
|
||||||
(evil-org-set-key-theme)
|
(evil-org-set-key-theme)
|
||||||
;; Only fold the current tree, rather than recursively
|
(add-hook! 'org-tab-first-hook :append
|
||||||
(add-hook 'org-tab-first-hook #'+org-cycle-only-current-subtree-h 'append)
|
;; Only fold the current tree, rather than recursively
|
||||||
|
#'+org-cycle-only-current-subtree-h
|
||||||
|
;; Clear babel results if point is inside a src block
|
||||||
|
#'+org-clear-babel-results-h)
|
||||||
(map! :map evil-org-mode-map
|
(map! :map evil-org-mode-map
|
||||||
:ni [C-return] #'+org/insert-item-below
|
:ni [C-return] #'+org/insert-item-below
|
||||||
:ni [C-S-return] #'+org/insert-item-above
|
:ni [C-S-return] #'+org/insert-item-above
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue