Map Ctrl+Escape to Caps Lock

master
Pierre Neidhardt 2017-05-27 16:41:36 +02:00
parent 4c00ce9364
commit b561cbd3e5
7 changed files with 21 additions and 19 deletions

View File

@ -3,13 +3,16 @@ fzf_key_bindings
## Emacs bindings
# bind \cT transpose-chars
# bind \e\ct fzf-file-widget
# bind \ec capitalize-word
# bind \eC fzf-cd-widget
bind -M insert \et fzf-file-widget
bind t fzf-file-widget
bind R fzf-history-widget
bind -m insert C fzf-cd-widget
## Emacs binding that is also useful in vi.
bind -M insert \ec capitalize-word
bind -m insert \ec fzf-cd-widget
# bind -M insert \et fzf-file-widget
# Add to normal mode too.
bind \cT fzf-file-widget
# bind R fzf-history-widget
# bind -m insert C fzf-cd-widget
function fzf-select -d 'Eval commandline, fzf result and print out selection'
set -l cmd (commandline -j)

View File

@ -345,11 +345,9 @@ quit
scroll-page 0 1
<ctrl-f>
<alt-f>
scroll-page 0 -1
<ctrl-b>
<alt-b>
scroll-page 0 0.5
<ctrl-d>
@ -472,7 +470,6 @@ run-macro
open-editor
<ctrl-e>
<alt-e>
insert-text {primary}
<ctrl-v>

View File

@ -242,6 +242,7 @@ To view where the bindings are set in your config files, lookup
(require 'tool-evil))
;; God mode
;; TODO: Evil largely replaces god-mode. Remove?
;; (add-to-list 'package-selected-packages 'god-mode)
;; (when (require 'god-mode nil t)
;; (require 'tool-god))

View File

@ -13,3 +13,4 @@ sdlmame-wout-toolkits
tespeed-git
texlive-dummy
translate-git
xcape

View File

@ -351,7 +351,6 @@ xclip
xdg-user-dirs
xdg-utils
xdotool
xf86-input-synaptics
xf86-video-vesa
xfsprogs
xloadimage

View File

@ -3,7 +3,8 @@
//------------------------------------------------------------------------------
//
// Description: This keyboard layout is based on Xorg's "us" and inspired by
// "us(intl)". We switch Caps Lock and Escape.
// "us(intl)". Caps Lock is Ctrl and LShift+RShift is Caps Lock. For best
// vi-style experience, set the new Ctrl to be Esc when not used as a modifier.
//
// User setup: run
//
@ -17,10 +18,10 @@
//
// $ setxkbmap usim
//
// ┏━━━━━━
// ┃Caps
// ┃Lock ⇬
// ┡━━━━━┯┹───┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┲━━━━━━━━━┓
// ┏━━━━━━┓
// ┃
// ┃Esc
// ┡━━━━━┯┹───┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┲━━━━━━━━━┓
// │ ~ ~ │ ! ¡ │ @ ˝ │ # ¯ │ $ ¤ │ % ¢ │ ^ ^ │ & ¼ │ * ¾ │ ( ˘ │ ) ÷ │ _ × │ + ± ┃ ⌫ Back ┃
// │ ` ` │ 1 ¹ │ 2 ² │ 3 ³ │ 4 £ │ 5 € │ 6 ¥ │ 7 ½ │ 8 „ │ 9 “ │ 0 ” │ - ⋅ │ = ≠ ┃ space ┃
// ┢━━━━━┷━┱───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┺━┳━━━━━━━┫
@ -28,7 +29,7 @@
// ┃Tab ↹ ┃ q à │ w è │ e é │ r ® │ t © │ y ù │ u ú │ i í │ o ó │ p å │ [ « │ ] » ┃ ⏎ ┃
// ┣━━━━━━━┻┱────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┺┓ ┃
// ┃ ┃ A Á │ S § │ D  │ F Ê │ G Î │ H Ô │ J Û │ K Œ │ L Æ │ : ° │ " ¨ │ | ¦ ┃ ┃
// ┃Esc ┃ a á │ s ß │ d â │ f ê │ g î │ h ô │ j û │ k œ │ l æ │ ; ° │ ' ´ │ \ ¬ ┃ ┃
// ┃Ctrl ┃ a á │ s ß │ d â │ f ê │ g î │ h ô │ j û │ k œ │ l æ │ ; ° │ ' ´ │ \ ¬ ┃ ┃
// ┣━━━━━━━┳┹────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┲┷━━━━━┻━━━━━━┫
// ┃ ┃ > ≥ │ Z Ä │ X Ë │ C Ï │ V Ö │ B Ü │ N Ñ │ M Ø │ < Ç │ > µ │ ? ¿ ┃ ┃
// ┃Shift ⇧┃ < ≤ │ z ä │ x ë │ c ï │ v ö │ b ü │ n ñ │ m ø │ , ç │ . … │ / ¶ ┃Shift ⇧ ┃
@ -96,8 +97,7 @@ partial alphanumeric_keys xkb_symbols "usim" {
key <SPCE> { [ space, space, nobreakspace, nobreakspace ] };
key <LSGT> { [ less, greater, lessthanequal, greaterthanequal ] };
key <CAPS> { [ Escape ] };
key <ESC> { [ Caps_Lock ] };
include "level3(ralt_switch)"
include "ctrl(nocaps)"
include "shift(both_capslock)"
};

View File

@ -23,6 +23,7 @@ EOF
## Load custom keymap and configure input devices.
xkbcomp -I"$HOME/.xkb" "$HOME/.xkb/usim.xkb" $DISPLAY
xcape -e 'Control_L=Escape'
numlockx on
# xinput disable "SynPS/2 Synaptics TouchPad"