Skip to content

Instantly share code, notes, and snippets.

@sluger
Forked from keckelt/Backtick Behaviour.md
Created September 27, 2018 13:47
Show Gist options
  • Save sluger/628074fb9fb40ab8103a2a065571156a to your computer and use it in GitHub Desktop.
Save sluger/628074fb9fb40ab8103a2a065571156a to your computer and use it in GitHub Desktop.
Avoid typing backticks twice (on Linux)

The backtick is called grave If the backtick is not typed on your first keyboard button press, but on the second it is a dead grave.

So, find the backtick button keycode for your layout:

xmodmap -pke | grep "grave"

which returns (for my german keyboard layout):

keycode  21 = dead_acute dead_grave dead_acute dead_grave
keycode  49 = dead_circumflex degree asciicircum degree U2032 U2033 notsign notsign grave asciitilde
keycode  51 = numbersign apostrophe numbersign apostrophe rightsinglequotemark dead_breve rightsinglequotemark grave backslash bar

The first entry (keycode 21) is the correct one (the one I physically use), with the acute (forwardtick?) and grave (backtick) symbols. Both have a dead_ prefix, meaning they wait for another keypress.

So all you have to do, is to change the symbols for this keycode. I will keep the dead behaviour for acute (to write Café), but not for grave, so:

xmodmap -e 'keycode 21 = dead_acute grave'

Note that your keycode may be different (e.g., 49 on uk/us keyboards). If you want to have consistent behaviour, remove the dead prefix from acute aswell.

@pohlt
Copy link

pohlt commented Jan 27, 2023

If you came here to avoid typing any tick/backtick key twice, just select a keyboard layout saying "no dead keys".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment