.
.TP
\fBUp\fR
-Move the cursor to theprevious line\.
+Move the cursor to the previous line\.
.
.TP
\fBDown\fR
Move the cursor to the next line\.
.
.TP
+\fBCtrl+Up\fR
+Move the current line or selection up a line\.
+.
+.TP
+\fBCtrl+Down\fR
+Move the current line or selection down a line\.
+.
+.TP
\fBCtrl+Left\fR
Move the cursor to the beginning of the word to the left\.
.
.
.TP
\fBCtrl+x\fR
-Cut the selected text to the X11 CLIPBOARD selection\.
+Cut the selected text to the X11 CLIPBOARD selection\. If no text is selected then the current line is cut\.
.
.TP
\fBCtrl+c\fR
-Copy the selected text to the X11 CLIPBOARD selection\.
+Copy the selected text to the X11 CLIPBOARD selection\. If no text is selected then the current line is copied\.
.
.TP
\fBCtrl+v\fR
Move the cursor one character to the right.
* `Up`:
- Move the cursor to theprevious line.
+ Move the cursor to the previous line.
* `Down`:
Move the cursor to the next line.
+
+* `Ctrl+Up`:
+ Move the current line or selection up a line.
+
+* `Ctrl+Down`:
+ Move the current line or selection down a line.
* `Ctrl+Left`:
Move the cursor to the beginning of the word to the left.
Redo the previously undone change on the active region.
* `Ctrl+x`:
- Cut the selected text to the X11 CLIPBOARD selection.
+ Cut the selected text to the X11 CLIPBOARD selection. If no text is selected
+ then the current line is cut.
* `Ctrl+c`:
- Copy the selected text to the X11 CLIPBOARD selection.
+ Copy the selected text to the X11 CLIPBOARD selection. If no text is selected
+ then the current line is copied.
* `Ctrl+v`:
Paste the contents of the X11 CLIPBOARD selection to the active region.
view_eol(win_view(FOCUSED), false);
}
+static void move_line_up(void) {
+ if (!view_selsize(win_view(FOCUSED)))
+ select_line();
+ cut();
+ view_byline(win_view(FOCUSED), UP, false);
+ paste();
+}
+
+static void move_line_dn(void) {
+ if (!view_selsize(win_view(FOCUSED)))
+ select_line();
+ cut();
+ cursor_eol();
+ view_byrune(win_view(FOCUSED), RIGHT, false);
+ paste();
+}
+
static void cursor_home(void) {
bool extsel = x11_keymodsset(ModShift);
if (x11_keymodsset(ModCtrl))
static void cursor_up(void) {
bool extsel = x11_keymodsset(ModShift);
- view_byline(win_view(FOCUSED), UP, extsel);
+ if (x11_keymodsset(ModCtrl))
+ move_line_up();
+ else
+ view_byline(win_view(FOCUSED), UP, extsel);
}
static void cursor_dn(void) {
bool extsel = x11_keymodsset(ModShift);
- view_byline(win_view(FOCUSED), DOWN, extsel);
+ if (x11_keymodsset(ModCtrl))
+ move_line_dn();
+ else
+ view_byline(win_view(FOCUSED), DOWN, extsel);
}
static void cursor_left(void) {