1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-18 13:54:36 -05:00

Add default shortcuts: Shift+BackSpace to delete previous char, Ctrl+Left/Right for word movements (#790)

* Support Shift+BackSpace by default to delete previous char

* Support Ctrl+Arrow for word movements
This commit is contained in:
Maxim Baz 2018-06-13 14:15:31 +02:00 committed by Dave Davenport
parent bdb6abef4a
commit ff9b0f5ccd
6 changed files with 50 additions and 50 deletions

View file

@ -161,7 +161,7 @@ Type `Shift-/Left/Right` to switch between active modi.
## Key bindings
| Key | Action |
|:----------------------------|:-------------------------------------------------------------------|
|:-------------------------------------|:-------------------------------------------------------------------|
|`Ctrl-v, Insert` | Paste from clipboard |
|`Ctrl-Shift-v, Shift-Insert` | Paste primary selection |
|`Ctrl-w` | Clear the line |
@ -169,12 +169,12 @@ Type `Shift-/Left/Right` to switch between active modi.
|`Ctrl-a` | Move to beginning of line |
|`Ctrl-e` | Move to end of line |
|`Ctrl-f, Right` | Move forward one character |
|`Alt-f` | Move forward one word |
|`Alt-f, Ctrl-Right` | Move forward one word |
|`Ctrl-b, Left` | Move back one character |
|`Alt-b` | Move back one word |
|`Alt-b, Ctrl-Left` | Move back one word |
|`Ctrl-d, Delete` | Delete character |
|`Ctrl-Alt-d` | Delete word |
|`Ctrl-h, Backspace` | Backspace (delete previous character) |
|`Ctrl-h, Backspace, Shift-Backspace` | Backspace (delete previous character) |
|`Ctrl-Alt-h` | Delete previous word |
|`Ctrl-j,Ctrl-m,Enter` | Accept entry |
|`Ctrl-n,Down` | Select next entry |

View file

@ -1278,13 +1278,13 @@ Transparency can be used within \fBrofi\fR, for example if the selected backgrou
\fBCtrl\-f, Right\fR: Forward one character
.
.IP "\(bu" 4
\fBAlt\-f\fR: Forward one word
\fBAlt\-f, Ctrl\-Right\fR: Forward one word
.
.IP "\(bu" 4
\fBCtrl\-b, Left\fR: Back one character
.
.IP "\(bu" 4
\fBAlt\-b\fR: Back one word
\fBAlt\-b, Ctrl\-Left\fR: Back one word
.
.IP "\(bu" 4
\fBCtrl\-d, Delete\fR: Delete character
@ -1293,7 +1293,7 @@ Transparency can be used within \fBrofi\fR, for example if the selected backgrou
\fBCtrl\-Alt\-d\fR: Delete word
.
.IP "\(bu" 4
\fBCtrl\-h, Backspace\fR: Backspace (delete previous character)
\fBCtrl\-h, Backspace, Shift\-Backspace\fR: Backspace (delete previous character)
.
.IP "\(bu" 4
\fBCtrl\-Alt\-h\fR: Delete previous word

View file

@ -766,12 +766,12 @@ of the window will be visible through it.
* `Ctrl-a`: Beginning of line
* `Ctrl-e`: End of line
* `Ctrl-f, Right`: Forward one character
* `Alt-f`: Forward one word
* `Alt-f, Ctrl-Right`: Forward one word
* `Ctrl-b, Left`: Back one character
* `Alt-b`: Back one word
* `Alt-b, Ctrl-Left`: Back one word
* `Ctrl-d, Delete`: Delete character
* `Ctrl-Alt-d`: Delete word
* `Ctrl-h, Backspace`: Backspace (delete previous character)
* `Ctrl-h, Backspace, Shift-Backspace`: Backspace (delete previous character)
* `Ctrl-Alt-h`: Delete previous word
* `Ctrl-j,Ctrl-m,Enter`: Accept entry
* `Ctrl-n,Down`: Select next entry

View file

@ -127,9 +127,9 @@ rofi.kb-move-front: Control+a
! "End of line" Set from: File
rofi.kb-move-end: Control+e
! "Move back one word" Set from: File
rofi.kb-move-word-back: Alt+b
rofi.kb-move-word-back: Alt+b,Ctrl+Left
! "Move forward one word" Set from: File
rofi.kb-move-word-forward: Alt+f
rofi.kb-move-word-forward: Alt+f,Ctrl+Right
! "Move back one char" Set from: File
rofi.kb-move-char-back: Left,Control+b
! "Move forward one char" Set from: File
@ -141,7 +141,7 @@ rofi.kb-remove-word-forward: Control+Alt+d
! "Delete next char" Set from: File
rofi.kb-remove-char-forward: Delete,Control+d
! "Delete previous char" Set from: File
rofi.kb-remove-char-back: BackSpace,Control+h
rofi.kb-remove-char-back: BackSpace,Shift+BackSpace,Control+h
! "Delete till the end of line" Set from: File
rofi.kb-remove-to-eol: Control+k
! "Delete till the start of line" Set from: File

View file

@ -50,14 +50,14 @@ ActionBindingEntry rofi_bindings[] =
{ .id = CLEAR_LINE, .name = "kb-clear-line", .binding = "Control+w", .comment = "Clear input line" },
{ .id = MOVE_FRONT, .name = "kb-move-front", .binding = "Control+a", .comment = "Beginning of line" },
{ .id = MOVE_END, .name = "kb-move-end", .binding = "Control+e", .comment = "End of line" },
{ .id = MOVE_WORD_BACK, .name = "kb-move-word-back", .binding = "Alt+b", .comment = "Move back one word" },
{ .id = MOVE_WORD_FORWARD, .name = "kb-move-word-forward", .binding = "Alt+f", .comment = "Move forward one word" },
{ .id = MOVE_WORD_BACK, .name = "kb-move-word-back", .binding = "Alt+b,Control+Left", .comment = "Move back one word" },
{ .id = MOVE_WORD_FORWARD, .name = "kb-move-word-forward", .binding = "Alt+f,Control+Right", .comment = "Move forward one word" },
{ .id = MOVE_CHAR_BACK, .name = "kb-move-char-back", .binding = "Left,Control+b", .comment = "Move back one char" },
{ .id = MOVE_CHAR_FORWARD, .name = "kb-move-char-forward", .binding = "Right,Control+f", .comment = "Move forward one char" },
{ .id = REMOVE_WORD_BACK, .name = "kb-remove-word-back", .binding = "Control+Alt+h,Control+BackSpace", .comment = "Delete previous word" },
{ .id = REMOVE_WORD_FORWARD, .name = "kb-remove-word-forward", .binding = "Control+Alt+d", .comment = "Delete next word" },
{ .id = REMOVE_CHAR_FORWARD, .name = "kb-remove-char-forward", .binding = "Delete,Control+d", .comment = "Delete next char" },
{ .id = REMOVE_CHAR_BACK, .name = "kb-remove-char-back", .binding = "BackSpace,Control+h", .comment = "Delete previous char" },
{ .id = REMOVE_CHAR_BACK, .name = "kb-remove-char-back", .binding = "BackSpace,Shift+BackSpace,Control+h", .comment = "Delete previous char" },
{ .id = REMOVE_TO_EOL, .name = "kb-remove-to-eol", .binding = "Control+k", .comment = "Delete till the end of line" },
{ .id = REMOVE_TO_SOL, .name = "kb-remove-to-sol", .binding = "Control+u", .comment = "Delete till the start of line" },
{ .id = ACCEPT_ENTRY, .name = "kb-accept-entry", .binding = "Control+j,Control+m,Return,KP_Enter", .comment = "Accept entry" },

View file

@ -778,15 +778,15 @@ int textbox_keybinding ( textbox *tb, KeyBindingAction action )
case REMOVE_CHAR_FORWARD:
textbox_cursor_del ( tb );
return 1;
// Alt-B
// Alt-B, Ctrl-Left
case MOVE_WORD_BACK:
textbox_cursor_dec_word ( tb );
return 2;
// Alt-F
// Alt-F, Ctrl-Right
case MOVE_WORD_FORWARD:
textbox_cursor_inc_word ( tb );
return 2;
// BackSpace, Ctrl-h
// BackSpace, Shift-BackSpace, Ctrl-h
case REMOVE_CHAR_BACK:
textbox_cursor_bkspc ( tb );
return 1;