I am trying to apply following solutions's key binding to overwrite all mode's key bindings for C-c >
and C-c <
.
From the answer for Can we do C-c >
and >
and >
to continue indentation:
(defhydra python-indent (global-map "C-c")
"Adjust python indentation."
(">" python-indent-shift-right "right")
("<" python-indent-shift-left "left"))
which works for the python-mode
; but it does not overwrite into the global bindings and such as in shell-mode
, its bind remain as to sh-learn-line-indent
.
Is there any way to force to overwrite the key binding for C-c >
and C-c <
?
I have also tried following with the help of (https://emacs.stackexchange.com/a/68029/18414), which did not work:
(with-eval-after-load "sh-script"
(defhydra python-indent (sh-mode-map "C-c")
(">" python-indent-shift-right "right")
("<" python-indent-shift-left "left"))
python-indent-shift-right/left
is using) isindent-rigidly
, which already provides a transient when called interactively. There is alsoindent-rigidly-right-to-tab-stop
(andleft
), which might be a better command to use if you would like to have differenttab offset
's (besides its name making more sense when using this globally).indent-rigidly
, providesindent-rigidly-right-to-tab-stop
(andleft
) under capitalL/H
, (so probably it is a little redundant to mention that you could use thetransient
package (instead of hydra) if you would like a way to set the offset interactively via the transient).