Swapping caps lock and escape on xfce

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
Black Swordsman
Level 2
Level 2
Posts: 74
Joined: Thu Feb 22, 2018 8:48 pm
Location: Syracuse, Indiana

Swapping caps lock and escape on xfce

Post by Black Swordsman »

I am working on teaching myself some Vim and I have realized that you must use the escape key a lot when using it. I know that on cinnamon it was easy enough to swap caps lock and escape in the settings>keyboard area but I have no clue where I should go in order to change it for XFCE

Level 13
Level 13
Posts: 4833
Joined: Sun Mar 27, 2016 6:58 pm

Re: Swapping caps lock and escape on xfce

Post by rene »

Not sure you can set this through graphical Xfce configuration, although it's always possible on any DE to add an xmodmap command to the startup applications. What however is also always possible and I feel better is configuring this at the X level. I.e., create /etc/X11/xorg.conf.d/swapescape.conf consisting of

Code: Select all

Section "InputClass"
	Identifier "Swap CapsLock and Escape"
        MatchIsKeyboard "on"
        Option "XkbOptions" "caps:swapescape"
and.... reboot, or just log out and in; not sure right now if LightDM restarts the X server on logout and can't test at the moment; reboot certainly works. Note that you will on a vanilla system need to in fact create the directory /etc/X11/xorg.conf.d first; by default, there is no manual X11 configuration present at all.

Tip: (also) try "neovim" rather than "vim". Its available directly from the repositories, or you can add it via PPA: https://launchpad.net/~neovim-ppa/+arch ... ntu/stable. Then get used to simply typing "vi" rather than "vim" again :)

Post Reply

Return to “Newbie Questions”