[wiki] [sites] add nano_shortcuts_support patch || syl

From: <git_AT_suckless.org>
Date: Mon, 04 Apr 2022 10:28:59 +0200

commit 791f0a3321caf9c02b85a157922dc2143378d719
Author: syl <59789740+sylphenix_AT_users.noreply.github.com>
Date: Mon Apr 4 16:28:45 2022 +0800

    add nano_shortcuts_support patch

diff --git a/st.suckless.org/patches/nano_shortcuts_support/index.md b/st.suckless.org/patches/nano_shortcuts_support/index.md
new file mode 100644
index 00000000..62866909
--- /dev/null
+++ b/st.suckless.org/patches/nano_shortcuts_support/index.md
_AT_@ -0,0 +1,20 @@
+nano shortcuts support
+======
+
+Description
+-----------
+When use nano editor with st, some shortcuts (e.g. alt+del, ctrl+end, alt+ins
+alt+PgUp ... ) would not work. This patch gets those shortcuts fully supported.
+
+Notes:
+------
+This patch actually adds and changes a few key definitions. It has included
+st [delkey](/patches/delkey) patch.
+
+Download
+--------
+* [st-nano-shortcuts-support-0.8.5.diff](st-nano-shortcuts-support-0.8.5.diff)
+
+Authors
+-------
+* Shi Yanling - <sylphenix_AT_outlook.com>
diff --git a/st.suckless.org/patches/nano_shortcuts_support/st-nano-shortcuts-support-0.8.5.diff b/st.suckless.org/patches/nano_shortcuts_support/st-nano-shortcuts-support-0.8.5.diff
new file mode 100644
index 00000000..4eed184a
--- /dev/null
+++ b/st.suckless.org/patches/nano_shortcuts_support/st-nano-shortcuts-support-0.8.5.diff
_AT_@ -0,0 +1,96 @@
+diff --git a/config.def.h b/config.def.h
+index 91ab8ca..2e35192 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -242,6 +242,7 @@ static uint ignoremod = Mod2Mask|XK_SWITCH_MOD;
+ */
+ static Key key[] = {
+ /* keysym mask string appkey appcursor */
++ { XK_KP_Home, ControlMask, "", 0, 0},
+ { XK_KP_Home, ShiftMask, "", 0, -1},
+ { XK_KP_Home, ShiftMask, "", 0, +1},
+ { XK_KP_Home, XK_ANY_MOD, "", 0, -1},
+_AT_@ -258,6 +259,7 @@ static Key key[] = {
+ { XK_KP_Right, XK_ANY_MOD, "Ov", +1, 0},
+ { XK_KP_Right, XK_ANY_MOD, "", 0, -1},
+ { XK_KP_Right, XK_ANY_MOD, "OC", 0, +1},
++ { XK_KP_Prior, Mod1Mask, "[5;3~", 0, 0},
+ { XK_KP_Prior, ShiftMask, "[5;2~", 0, 0},
+ { XK_KP_Prior, XK_ANY_MOD, "[5~", 0, 0},
+ { XK_KP_Begin, XK_ANY_MOD, "", 0, 0},
+_AT_@ -266,19 +268,22 @@ static Key key[] = {
+ { XK_KP_End, ShiftMask, "", -1, 0},
+ { XK_KP_End, ShiftMask, "", +1, 0},
+ { XK_KP_End, XK_ANY_MOD, "[4~", 0, 0},
++ { XK_KP_Next, Mod1Mask, "[6;3~", 0, 0},
+ { XK_KP_Next, ShiftMask, "[6;2~", 0, 0},
+ { XK_KP_Next, XK_ANY_MOD, "[6~", 0, 0},
+ { XK_KP_Insert, ShiftMask, "[2;2~", +1, 0},
+ { XK_KP_Insert, ShiftMask, "", -1, 0},
++ { XK_KP_Insert, Mod1Mask, "[2;3~", 0, 0},
+ { XK_KP_Insert, ControlMask, "", -1, 0},
+ { XK_KP_Insert, ControlMask, "[2;5~", +1, 0},
+ { XK_KP_Insert, XK_ANY_MOD, "", -1, 0},
+ { XK_KP_Insert, XK_ANY_MOD, "[2~", +1, 0},
+- { XK_KP_Delete, ControlMask, "", -1, 0},
++ { XK_KP_Delete, ControlMask, "[3;5~", -1, 0},
+ { XK_KP_Delete, ControlMask, "[3;5~", +1, 0},
++ { XK_KP_Delete, Mod1Mask, "[3;3~", 0, 0},
+ { XK_KP_Delete, ShiftMask, "", -1, 0},
+ { XK_KP_Delete, ShiftMask, "[3;2~", +1, 0},
+- { XK_KP_Delete, XK_ANY_MOD, "", -1, 0},
++ { XK_KP_Delete, XK_ANY_MOD, "[3~", -1, 0},
+ { XK_KP_Delete, XK_ANY_MOD, "[3~", +1, 0},
+ { XK_KP_Multiply, XK_ANY_MOD, "Oj", +2, 0},
+ { XK_KP_Add, XK_ANY_MOD, "Ok", +2, 0},
+_AT_@ -338,18 +343,21 @@ static Key key[] = {
+ { XK_Return, XK_ANY_MOD, " ", 0, 0},
+ { XK_Insert, ShiftMask, "", -1, 0},
+ { XK_Insert, ShiftMask, "[2;2~", +1, 0},
++ { XK_Insert, Mod1Mask, "[2;3~", 0, 0},
+ { XK_Insert, ControlMask, "", -1, 0},
+ { XK_Insert, ControlMask, "[2;5~", +1, 0},
+ { XK_Insert, XK_ANY_MOD, "", -1, 0},
+ { XK_Insert, XK_ANY_MOD, "[2~", +1, 0},
+- { XK_Delete, ControlMask, "", -1, 0},
++ { XK_Delete, ControlMask, "[3;5~", -1, 0},
+ { XK_Delete, ControlMask, "[3;5~", +1, 0},
++ { XK_Delete, Mod1Mask, "[3;3~", 0, 0},
+ { XK_Delete, ShiftMask, "", -1, 0},
+ { XK_Delete, ShiftMask, "[3;2~", +1, 0},
+- { XK_Delete, XK_ANY_MOD, "", -1, 0},
++ { XK_Delete, XK_ANY_MOD, "[3~", -1, 0},
+ { XK_Delete, XK_ANY_MOD, "[3~", +1, 0},
+ { XK_BackSpace, XK_NO_MOD, "\177", 0, 0},
+ { XK_BackSpace, Mod1Mask, "\177", 0, 0},
++ { XK_Home, ControlMask, "", 0, 0},
+ { XK_Home, ShiftMask, "", 0, -1},
+ { XK_Home, ShiftMask, "", 0, +1},
+ { XK_Home, XK_ANY_MOD, "", 0, -1},
+_AT_@ -360,9 +368,11 @@ static Key key[] = {
+ { XK_End, ShiftMask, "", +1, 0},
+ { XK_End, XK_ANY_MOD, "[4~", 0, 0},
+ { XK_Prior, ControlMask, "[5;5~", 0, 0},
++ { XK_Prior, Mod1Mask, "[5;3~", 0, 0},
+ { XK_Prior, ShiftMask, "[5;2~", 0, 0},
+ { XK_Prior, XK_ANY_MOD, "[5~", 0, 0},
+ { XK_Next, ControlMask, "[6;5~", 0, 0},
++ { XK_Next, Mod1Mask, "[6;3~", 0, 0},
+ { XK_Next, ShiftMask, "[6;2~", 0, 0},
+ { XK_Next, XK_ANY_MOD, "[6~", 0, 0},
+ { XK_F1, XK_NO_MOD, "OP" , 0, 0},
+diff --git a/st.info b/st.info
+index 8201ad6..7c9de94 100644
+--- a/st.info
++++ b/st.info
+_AT_@ -62,8 +62,10 @@ st-mono| simpleterm monocolor,
+ kcuf1=\EOC,
+ kcuu1=\EOA,
+ kDC=\E[3;2~,
++ kDC5=\E[3;5~
+ kent=\EOM,
+ kEND=\E[1;2F,
++ kEND5=\E[1;5F,
+ kIC=\E[2;2~,
+ kNXT=\E[6;2~,
+ kPRV=\E[5;2~,
Received on Mon Apr 04 2022 - 10:28:59 CEST

This archive was generated by hypermail 2.3.0 : Mon Apr 04 2022 - 10:36:51 CEST