Closed uqix closed 6 months ago
This is great, thanks! On the next release I'll add this to the readme
Here's my latest config:
(keymap-set yaml-pro-ts-mode-map "C-M-n" #'yaml-pro-ts-next-subtree) ; was forward-list
(keymap-set yaml-pro-ts-mode-map "C-M-p" #'yaml-pro-ts-prev-subtree) ; was backward-list
(keymap-set yaml-pro-ts-mode-map "C-M-u" #'yaml-pro-ts-up-level) ; was backward-up-list
(keymap-set yaml-pro-ts-mode-map "C-M-d" #'yaml-pro-ts-down-level) ; was down-list
(keymap-set yaml-pro-ts-mode-map "C-M-k" #'yaml-pro-ts-kill-subtree) ; was kill-sexp
(keymap-set yaml-pro-ts-mode-map "C-M-<backspace>" #'yaml-pro-ts-kill-subtree) ; was backward-kill-sexp
(keymap-set yaml-pro-ts-mode-map "C-M-a" #'yaml-pro-ts-first-sibling) ; was beginning-of-defun
(keymap-set yaml-pro-ts-mode-map "C-M-e" #'yaml-pro-ts-last-sibling) ; was end-of-defun
(defvar-keymap my/yaml-pro/tree-repeat-map
:repeat t
"n" #'yaml-pro-ts-next-subtree
"p" #'yaml-pro-ts-prev-subtree
"u" #'yaml-pro-ts-up-level
"d" #'yaml-pro-ts-down-level
"m" #'yaml-pro-ts-mark-subtree
"k" #'yaml-pro-ts-kill-subtree
"a" #'yaml-pro-ts-first-sibling
"e" #'yaml-pro-ts-last-sibling
"SPC" #'my/yaml-pro/set-mark)
(defun my/yaml-pro/set-mark ()
(interactive)
(my/region/set-mark 'my/yaml-pro/set-mark))
(defun my/region/set-mark (command-name)
(if (eq last-command command-name)
(if (region-active-p)
(progn
(deactivate-mark)
(message "Mark deactivated"))
(activate-mark)
(message "Mark activated"))
(set-mark-command nil)))
BTW, I tried combobulate, but it's too strict about the current point position, that's why I really like yaml-pro
that just dwim.