|
1 | | -*terminal.txt* For Vim version 8.0. Last change: 2017 Jul 28 |
| 1 | +*terminal.txt* For Vim version 8.0. Last change: 2017 Jul 30 |
2 | 2 |
|
3 | 3 |
|
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -33,24 +33,39 @@ Or to run a debugger: > |
33 | 33 | The job runs asynchronously from Vim, the window will be updated to show |
34 | 34 | output from the job, also while editing in any other window. |
35 | 35 |
|
| 36 | + |
36 | 37 | Typing ~ |
37 | 38 |
|
38 | 39 | When the keyboard focus is in the terminal window, typed keys will be send to |
39 | 40 | the job. This uses a pty when possible. You can click outside of the |
40 | 41 | terminal window to move keyboard focus elsewhere. |
41 | 42 |
|
42 | | -Navigate between windows with CTRL-W commands. E.g. CTRL-W CTRL-W moves focus |
43 | | -to the next window. Use "CTRL-W :" to edit an Ex command. Use "CTRL-W ." to |
44 | | -send a CTRL-W to the job in the terminal. |
| 43 | +CTRL-W can be used to navigate between windows and other CTRL-W commands, e.g.: |
| 44 | + CTRL-W CTRL-W move focus to the next window |
| 45 | + CTRL-W : enter an Ex command |
| 46 | +See |CTRL-W| for more commands. |
| 47 | + |
| 48 | +Special in the terminal window: *CTRL-W_.* *CTRL-W_N* |
| 49 | + CTRL-W . send a CTRL-W to the job in the terminal |
| 50 | + CTRL-W N go to Terminal Normal mode, see |Terminal-mode| |
| 51 | + |
| 52 | +See option 'termkey' for specifying another key instead of CTRL-W that |
| 53 | +will work like CTRL-W. However, typing 'termkey' twice sends 'termkey' to |
| 54 | +the job. For example: |
| 55 | + 'termkey' CTRL-W move focus to the next window |
| 56 | + 'termkey' : enter an Ex command |
| 57 | + 'termkey' 'termkey' send 'termkey' to the job in the terminal |
| 58 | + 'termkey' . send a CTRL-W to the job in the terminal |
| 59 | + 'termkey' N go to terminal Normal mode, see below |
| 60 | + 'termkey' CTRL-N same as CTRL-W N |
45 | 61 |
|
46 | | -See option 'termkey' for specifying another key that precedes a Vim command. |
47 | | -Typing 'termkey' twice sends 'termkey' to the job. |
48 | 62 |
|
49 | 63 | Size ~ |
50 | 64 |
|
51 | 65 | See option 'termsize' for controlling the size of the terminal window. |
52 | 66 | (TODO: scrolling when the terminal is larger than the window) |
53 | 67 |
|
| 68 | + |
54 | 69 | Syntax ~ |
55 | 70 |
|
56 | 71 | :ter[minal] [command] *:ter* *:terminal* |
@@ -99,6 +114,25 @@ terminal. |term_setsize()| can be used only when in the first or second mode, |
99 | 114 | not when 'termsize' is "rowsXcols". |
100 | 115 |
|
101 | 116 |
|
| 117 | +Terminal Normal mode ~ |
| 118 | + *Terminal-mode* |
| 119 | +When the job is running the contents of the terminal is under control of the |
| 120 | +job. That includes the cursor position. The terminal contents can change at |
| 121 | +any time. |
| 122 | + |
| 123 | +Use CTRL-W N (or 'termkey' N) to go to Terminal Normal mode. Now the contents |
| 124 | +of the terminal window is under control of Vim, the job output is suspended. |
| 125 | + *E946* |
| 126 | +In this mode you can move the cursor around with the usual Vim commands, |
| 127 | +Visually mark text, yank text, etc. But you cannot change the contents of the |
| 128 | +buffer. The commands that would start insert mode, such as 'i' and 'a', |
| 129 | +return control of the window to the job. Any pending output will now be |
| 130 | +displayed. |
| 131 | + |
| 132 | +In Terminal mode the statusline and window title show "(Terminal)". If the |
| 133 | +job ends while in Terminal mode this changes to "(Terminal-finished)". |
| 134 | + |
| 135 | + |
102 | 136 | Unix ~ |
103 | 137 |
|
104 | 138 | On Unix a pty is used to make it possible to run all kinds of commands. You |
|
0 commit comments