lang/org: expand snippet on TAB in visual mode
This commit is contained in:
parent
bacf4c7a6a
commit
b4b85569b4
1 changed files with 9 additions and 6 deletions
|
@ -400,12 +400,15 @@ another level of headings on each invocation."
|
||||||
(defun +org|yas-expand-maybe ()
|
(defun +org|yas-expand-maybe ()
|
||||||
"Tries to expand a yasnippet snippet, if one is available. Made for
|
"Tries to expand a yasnippet snippet, if one is available. Made for
|
||||||
`org-tab-first-hook'."
|
`org-tab-first-hook'."
|
||||||
(when (and (or (not (bound-and-true-p evil-mode))
|
(when (bound-and-true-p yas-minor-mode)
|
||||||
|
(cond ((and (or (not (bound-and-true-p evil-mode))
|
||||||
(eq evil-state 'insert))
|
(eq evil-state 'insert))
|
||||||
(bound-and-true-p yas-minor-mode)
|
|
||||||
(yas--templates-for-key-at-point))
|
(yas--templates-for-key-at-point))
|
||||||
(call-interactively #'yas-expand)
|
(call-interactively #'yas-expand)
|
||||||
t))
|
t)
|
||||||
|
((use-region-p)
|
||||||
|
(call-interactively #'yas-insert-snippet)
|
||||||
|
t))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +org|cycle-only-current-subtree (&optional arg)
|
(defun +org|cycle-only-current-subtree (&optional arg)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue