Skip to content

Commit

Permalink
Adding reflow patch (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
bakkeby authored Mar 13, 2024
1 parent 9a41526 commit 3b87b07
Show file tree
Hide file tree
Showing 21 changed files with 2,347 additions and 82 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Refer to [https://st.suckless.org/](https://st.suckless.org/) for details on the
### Changelog:
2024-03-09 - Added the reflow patch
2024-03-07 - Improved sixel support, removed VIM browse patch
2022-10-24 - Added the fullscreen patch
Expand Down Expand Up @@ -231,6 +233,10 @@ Refer to [https://st.suckless.org/](https://st.suckless.org/) for details on the
~and 07 in order to facilitate the use of theme setting scripts like~
[~theme.sh~](https://github.com/lemnos/theme.sh) ~which expect these colours to be distinct~
- reflow
- allows st to be resized without cutting off text when the terminal window is made larger again
- text wraps when the terminal window is made smaller
- [relativeborder](https://st.suckless.org/patches/relativeborder/)
- allows you to specify a border that is relative in size to the width of a cell in the
terminal
Expand Down
21 changes: 20 additions & 1 deletion config.def.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ static float chscale = 1.0;
*/
wchar_t *worddelimiters = L" ";

#if KEYBOARDSELECT_PATCH && REFLOW_PATCH
/* Word delimiters for short and long jumps in the keyboard select patch */
wchar_t *kbds_sdelim = L"!\"#$%&'()*+,-./:;<=>?@[\\]^`{|}~ ";
wchar_t *kbds_ldelim = L" ";
#endif // KEYBOARDSELECT_PATCH

/* selection timeouts (in milliseconds) */
static unsigned int doubleclicktimeout = 300;
static unsigned int tripleclicktimeout = 600;
Expand Down Expand Up @@ -221,6 +227,11 @@ unsigned int selectionbg = 259;
/* Else if 1 keep original foreground-color of each cell => more colors :) */
static int ignoreselfg = 1;
#endif // SELECTION_COLORS_PATCH
#if KEYBOARDSELECT_PATCH && REFLOW_PATCH
/* Foreground and background color of search results */
unsigned int highlightfg = 15;
unsigned int highlightbg = 160;
#endif // KEYBOARDSELECT_PATCH

#if BLINKING_CURSOR_PATCH
/*
Expand Down Expand Up @@ -321,6 +332,10 @@ ResourcePref resources[] = {
#if ALPHA_FOCUS_HIGHLIGHT_PATCH
{ "alphaUnfocused",FLOAT, &alphaUnfocused },
#endif // ALPHA_FOCUS_HIGHLIGHT_PATCH
#if KEYBOARDSELECT_PATCH && REFLOW_PATCH
{ "highlightfg", INTEGER, &highlightfg },
{ "highlightbg", INTEGER, &highlightbg },
#endif // KEYBOARDSELECT_PATCH
};
#endif // XRESOURCES_PATCH

Expand Down Expand Up @@ -352,7 +367,7 @@ static MouseShortcut mshortcuts[] = {
{ ShiftMask, Button4, ttysend, {.s = "\033[5;2~"} },
{ ShiftMask, Button5, ttysend, {.s = "\033[6;2~"} },
#endif // SCROLLBACK_MOUSE_PATCH
#if SCROLLBACK_MOUSE_ALTSCREEN_PATCH
#if SCROLLBACK_MOUSE_ALTSCREEN_PATCH || REFLOW_PATCH
{ XK_NO_MOD, Button4, kscrollup, {.i = 1}, 0, S_PRI },
{ XK_NO_MOD, Button5, kscrolldown, {.i = 1}, 0, S_PRI },
{ XK_ANY_MOD, Button4, ttysend, {.s = "\031"}, 0, S_ALT },
Expand Down Expand Up @@ -432,6 +447,10 @@ static Shortcut shortcuts[] = {
#if KEYBOARDSELECT_PATCH
{ TERMMOD, XK_Escape, keyboard_select, { 0 } },
#endif // KEYBOARDSELECT_PATCH
#if KEYBOARDSELECT_PATCH && REFLOW_PATCH
{ TERMMOD, XK_F, searchforward, { 0 } },
{ TERMMOD, XK_B, searchbackward, { 0 } },
#endif // KEYBOARDSELECT_PATCH
#if ISO14755_PATCH
{ TERMMOD, XK_I, iso14755, {.i = 0} },
#endif // ISO14755_PATCH
Expand Down
29 changes: 29 additions & 0 deletions patch/keyboardselect_reflow.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Shortcuts in keyboard selection mode:

h, j, k, l: move cursor left/down/up/right (also with arrow keys)
H, M, L: move cursor to the top/middle/bottom of the screen
Home, End: move cursor to the top/bottom of the screen
Backspace or 0, $ or A: move cursor to the beginning/end of the line
^ or I: move cursor to the beginning of the indented line
!: move cursor to the middle of the row
_: move cursor to the right edge of the screen
*: move cursor to the center of the screen
w, W jump forward to the start of a word
e, E jump forward to the end of a word
b, B jump backward to the start of a word
g, G: go to the first/last line
z: center the screen on the cursor
PgUp or K, PgDown or J: scroll the page up/down
/, ?: activate input mode and search up/down
n, N: repeat last search and search forward/backward
f, F: jump forward/backward to the given character
t, T: jump forward/backward to before the given character
; or r repeat previous f, t, F or T movement and move forward
, or R repeat previous f, t, F or T movement and move backward
v: toggle selection mode
V: toggle line selection mode
s: toggle regular/rectangular selection type
y: yank (copy) selected text
0 - 9: set the quantifier
Return: quit keyboard_select, yank and keep the highlight of the selection
Escape, q: quit keyboard_select/exit input mode/exit selection mode/reset quantifier
Loading

0 comments on commit 3b87b07

Please sign in to comment.