diff options
author | Mountain Man <43313373+MountainMan1312@users.noreply.github.com> | 2023-05-30 00:33:06 -0400 |
---|---|---|
committer | Mountain Man <43313373+MountainMan1312@users.noreply.github.com> | 2023-05-30 00:33:06 -0400 |
commit | d592251ebdf5aae44e8833120ce44d17c56ce137 (patch) | |
tree | 3283a61b2ed77c07b09103dc7f9af4011a20f6ab | |
parent | Add function and keybinds to list all bindings for KEY (diff) | |
download | mmosmacs-d592251ebdf5aae44e8833120ce44d17c56ce137.tar.gz mmosmacs-d592251ebdf5aae44e8833120ce44d17c56ce137.tar.bz2 mmosmacs-d592251ebdf5aae44e8833120ce44d17c56ce137.zip |
Implement IJKL movement keybinds
-rw-r--r-- | init.el | 64 |
1 files changed, 61 insertions, 3 deletions
@@ -1070,11 +1070,69 @@ | |||
1070 | ;; text (i.e. follow indentation) | 1070 | ;; text (i.e. follow indentation) |
1071 | ;; --------------------------------- | 1071 | ;; --------------------------------- |
1072 | 1072 | ||
1073 | ;; Make home key respect indentation | ||
1074 | (global-set-key (kbd "<home>") 'beginning-of-line-text) | ||
1075 | 1073 | ||
1076 | ;; Use Shift + HOME for old behavior | 1074 | ;; --------------------------------- |
1075 | ;; Movement | ||
1076 | ;; -------- | ||
1077 | ;; MMOSMacs uses IJKL movement. | ||
1078 | ;; Movement all requires use of the | ||
1079 | ;; Super key. | ||
1080 | ;; | ||
1081 | ;; U and O are used as equivalents | ||
1082 | ;; of Home/PgUp and End/PgDown | ||
1083 | ;; respectively. | ||
1084 | ;; --------------------------------- | ||
1085 | |||
1086 | ;; Move by character | ||
1087 | (global-set-key (kbd "s-i") (kbd "<up>")) | ||
1088 | (global-set-key (kbd "s-I") (kbd "<S-up>")) | ||
1089 | (global-set-key (kbd "s-k") (kbd "<down>")) | ||
1090 | (global-set-key (kbd "s-K") (kbd "<S-down>")) | ||
1091 | (global-set-key (kbd "s-j") (kbd "<left>")) | ||
1092 | (global-set-key (kbd "s-J") (kbd "<S-left>")) | ||
1093 | (global-set-key (kbd "s-l") (kbd "<right>")) | ||
1094 | (global-set-key (kbd "s-L") (kbd "<S-right>")) | ||
1095 | |||
1096 | ;; Move left/right by word | ||
1097 | (global-set-key (kbd "s-C-j") (kbd "<C-left>")) | ||
1098 | (global-set-key (kbd "s-C-S-j") (kbd "<C-S-left>")) | ||
1099 | (global-set-key (kbd "s-C-l") (kbd "<C-right>")) | ||
1100 | (global-set-key (kbd "s-C-S-l") (kbd "<C-S-right>")) | ||
1101 | |||
1102 | ;; Move up/down by paragraph | ||
1103 | (global-set-key (kbd "s-C-i") (kbd "<C-up>")) | ||
1104 | (global-set-key (kbd "s-C-S-i") (kbd "<C-S-up>")) | ||
1105 | (global-set-key (kbd "s-C-k") (kbd "<C-down>")) | ||
1106 | (global-set-key (kbd "s-C-S-k") (kbd "<C-S-down>")) | ||
1107 | |||
1108 | ;; Home | ||
1109 | (global-set-key (kbd "<home>") 'beginning-of-line-text) | ||
1110 | (global-set-key (kbd "s-u") (kbd "<home>")) | ||
1111 | (global-set-key (kbd "s-U") (kbd "S-<home>")) | ||
1077 | (global-set-key (kbd "C-<home>") 'beginning-of-visual-line) | 1112 | (global-set-key (kbd "C-<home>") 'beginning-of-visual-line) |
1113 | (global-set-key (kbd "s-C-u") (kbd "C-<home>")) | ||
1114 | (global-set-key (kbd "s-C-S-u") (kbd "C-S-<home>")) | ||
1115 | |||
1116 | ;; End | ||
1117 | (global-set-key (kbd "s-o") (kbd "<end>")) | ||
1118 | (global-set-key (kbd "s-O") (kbd "S-<end>")) | ||
1119 | (global-set-key (kbd "C-<end>") (kbd "<end>")) | ||
1120 | (global-set-key (kbd "C-S-<end>") (kbd "S-<end>")) | ||
1121 | (global-set-key (kbd "s-C-o") (kbd "C-<end>")) | ||
1122 | (global-set-key (kbd "s-C-S-o") (kbd "C-S-<end>")) | ||
1123 | |||
1124 | ;; PgUp / PgDown | ||
1125 | (global-set-key (kbd "s-M-u") (kbd "<prior>")) | ||
1126 | (global-set-key (kbd "s-M-U") (kbd "<S-prior>")) | ||
1127 | (global-set-key (kbd "s-M-o") (kbd "<next>")) | ||
1128 | (global-set-key (kbd "s-M-O") (kbd "<S-next>")) | ||
1129 | |||
1130 | ;; ;; Backspace / Delete | ||
1131 | (global-set-key (kbd "s-SPC") (kbd "<backspace>")) | ||
1132 | (global-set-key (kbd "C-SPC") (kbd "<delete>")) | ||
1133 | |||
1134 | ;; TAB | ||
1135 | (global-set-key (kbd "<s-tab>") (kbd "<tab>")) | ||
1078 | 1136 | ||
1079 | 1137 | ||
1080 | ;; --------------------------------- | 1138 | ;; --------------------------------- |