You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using this tip, you will be able to simulate some vim digraphs using sxhkd and xdotool, meaning it would work in any terminal application (including the shell) and not just in vim.
Here is an example. When you need to add digraphs you will find symbols in this file: /usr/include/rfb/keysym.h, potentially with the help of :UnicodeTable (a vim plugin) and or :he digraphs in vim.
# poor man's vim digraphs w/ sxhkd:
shift + ctrl + k ; {a,e,i,o,u} ; {apostrophe,exclam,greater,colon}
xdotool key --clearmodifiers {a,e,i,o,u}{acute,grave,circumflex,diaeresis}
# for uppercase, there might be better ways. A difference here
# with vim is that you will have to keep shift pressed throughout
# the end of the sequence (notice apostrophe becoming
# quotedbl, other characters are already using the shift key)
shift + ctrl + k ; shift + {a,e,i,o,u} ; {quotedbl,exclam,greater,colon}
xdotool key {A,E,I,O,U}{acute,grave,circumflex,diaeresis}
shift + ctrl + k ; c ; comma
xdotool key ccedilla
shift + ctrl + k ; shift + c ; less
xdotool key Ccedilla
shift + ctrl + k ; d ; g
xdotool key degree
shift + ctrl + k ; s ; s
xdotool key ssharp
shift + ctrl + k ; a ; e
xdotool key ae
shift + ctrl + k ; o ; e
xdotool key oe
shift + ctrl + k ; shift + o ; {_, shift + } e
xdotool key --clearmodifiers OE
Remarks:
you can not use native Ctrl+k as in vim, or you will lose the digraphs ability in vim. The above example therefore used shift + ctrl + k.
you will have to manually enter all digraphs you need in your sxhkdrc file. I only include a few a them here.
using a shell to run xdotool each time one of those digraph character is output may seem costly. I recommend it for occasional use only.
For uppercase version of Eacute, Agrave, ... you will need to maintain the shift key pressed through the end of the sequence (see comment in above snippet). There might be other ways.
The timing seems important, sometimes it won't work if you are to fast or too slow, I am not sure how to improve this.
Maybe due to the way of sxhkd's way of working with ; it seems that this randomly works or doesn't work. It may also be my mappings. Might also be related to xdotool ( #86 ) (fixed with xdotool --clearmodifiers, seemingly the shift in Shift + Ctrl + k ; a ; exclam (i.e. **Shift** + 1 ) was intercepted by xdotool when typing e.g. egrave, resulting in something like EGRAVE (-> i.e. not working most of the time) or Egrave (-> i.e. working only sometimes) based on your timing).
I will leave this idea open and maybe someone with a better understanding of sxhkd can help us improve this. For my occasional use of this, it works quite well enough.
The text was updated successfully, but these errors were encountered:
grepsuzette
changed the title
[Tip] Poor man's vim digraphs simulation with sxhkd
[Tip] Poor man's vim digraphs emulation with sxhkd
Dec 14, 2019
grepsuzette
changed the title
[Tip] Poor man's vim digraphs emulation with sxhkd
[Tip] Poor man's vim digraphs emulation with sxhkd and xdotool
Dec 14, 2019
grepsuzette
changed the title
[Tip] Poor man's vim digraphs emulation with sxhkd and xdotool
[Tip in progress] Poor man's vim digraphs emulation with sxhkd and xdotool
Dec 15, 2019
grepsuzette
changed the title
[Tip in progress] Poor man's vim digraphs emulation with sxhkd and xdotool
[Tip in progress] Poor man's vim digraphs emulation with sxhkd and xdotool in the terminal and elsewhere
Dec 15, 2019
Using this tip, you will be able to simulate some vim digraphs using sxhkd and xdotool, meaning it would work in any terminal application (including the shell) and not just in vim.
Here is an example. When you need to add digraphs you will find symbols in this file:
/usr/include/rfb/keysym.h
, potentially with the help of:UnicodeTable
(a vim plugin) and or:he digraphs
in vim.Remarks:
Ctrl+k
as in vim, or you will lose the digraphs ability in vim. The above example therefore usedshift + ctrl + k
.sxhkdrc
file. I only include a few a them here.Maybe due to the way of sxhkd's way of working with(fixed with;
it seems that this randomly works or doesn't work. It may also be my mappings. Might also be related to xdotool ( #86 )xdotool --clearmodifiers
, seemingly the shift inShift + Ctrl + k ; a ; exclam (i.e. **Shift** + 1 )
was intercepted by xdotool when typing e.g. egrave, resulting in something like EGRAVE (-> i.e. not working most of the time) or Egrave (-> i.e. working only sometimes) based on your timing).I will leave this idea open and maybe someone with a better understanding of sxhkd can help us improve this. For my occasional use of this, it works quite well enough.
The text was updated successfully, but these errors were encountered: