I’m looking for a way to paste from different sources without having to dig through the menu.
I dug through the scheme files to find the procedure that does it. I wanted to map C-S-V V
to paste text verbatim, C-S-V L
to paste from LaTex, and so on. I added this to my init scheme file which has other keybindings that work.
(kbd-map
("C-S-V v" (clipboard-paste-import "verbatim" "primary"))
)
The above code didn’t work. I assumed that since C-S-V
is already used by texmacs, it’s not possible to remap it, even with extensions such as C-S-V P
that are not used. My first question is, is it not possible to remap default keybindings?
I further dug through the scheme files and found /usr/share/TeXmacs/progs/generic/generic-kbd.scm
. It seems that the way to do it is with code below. The pastefrom
implies C-S-V
. While this is not intuitive, at least there’s a way to do it. So, my next move was to take the code below and put it inside my init scheme file. For some reason that I cannot understand, it doesn’t work. The only way the the code below runs is when it is inside /usr/share/TeXmacs/progs/generic/generic-kbd.scm
., which requires su privileges and can be overwritten by a new version. Any ideas why this code cannot run from inside my init scheme file?
(kbd-map
("pastefrom v" (clipboard-paste-import "verbatim" "primary"))
)