How to modify the arrow keys?

My keyboard’s arrow keys (i.e. up, down, right, left) is somehow unconvenient to use.

I already know how to modify keys by modify the my-init-texmcacs.scm with (kbd-map <xxx>).

However, I didn’t figure out how to map other keys combos to arrow keys.

I prefer to use Ctrl- (WASD or HJKL) for basic text navigation.

I have tried

(kbd-map ("C-a" (kbd-left)))
(kbd-map ("C-f" (kbd-right)))
(kbd-map ("C-s" (kbd-up)))
(kbd-map ("C-d" (kbd-down)))

in a Scheme session and it worked in a simple test with text; I do not know if the (kbd-left) etc. commands correspond to arrows movement or they only do the same thing while in text, but maybe someone will correct or improve my answer.

It should work also if you put them in your TeXmacs initialization file my-init-texmacs.scm .

Following Change system’s default shortcut for symbols, to make sure that you are overwriting possible default definitions you should prepend to these commands (lazy-keyboard-force) and wrap everything inside a delayed form:

(delayed
(lazy-keyboard-force)
(kbd-map ("C-a" (kbd-left)))
(kbd-map ("C-f" (kbd-right)))
(kbd-map ("C-s" (kbd-up)))
(kbd-map ("C-d" (kbd-down))))

G.

Of course you need to make sure “Save” is assigned to something else :slight_smile:

2 Likes