|
1 | | -*terminal.txt* For Vim version 8.0. Last change: 2017 Sep 10 |
| 1 | +*terminal.txt* For Vim version 8.0. Last change: 2017 Sep 17 |
2 | 2 |
|
3 | 3 |
|
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -38,7 +38,7 @@ output from the job, also while editing in another window. |
38 | 38 |
|
39 | 39 |
|
40 | 40 | Typing ~ |
41 | | - |
| 41 | + *terminal-typing* |
42 | 42 | When the keyboard focus is in the terminal window, typed keys will be sent to |
43 | 43 | the job. This uses a pty when possible. You can click outside of the |
44 | 44 | terminal window to move keyboard focus elsewhere. |
@@ -79,15 +79,24 @@ do. For simple commands this causes a SIGINT to be sent to the job, which |
79 | 79 | would end it. Other commands may ignore the SIGINT or handle the CTRL-C |
80 | 80 | themselves (like Vim does). |
81 | 81 |
|
| 82 | +To change the keys you type use terminal mode mappings, see |:tmap|. |
| 83 | +These are defined like any mapping, but apply only when typing keys that are |
| 84 | +sent to the job running in the terminal. |
| 85 | + |
82 | 86 |
|
83 | 87 | Size and color ~ |
84 | 88 |
|
85 | 89 | See option 'termsize' for controlling the size of the terminal window. |
86 | 90 | (TODO: scrolling when the terminal is larger than the window) |
87 | 91 |
|
88 | | -The terminal uses the 'background' option to decide whether the terminal |
89 | | -window will start with a white or black background. The job running in the |
90 | | -terminal can change the colors. |
| 92 | +The job running in the terminal can change the colors. The default foreground |
| 93 | +and background colors are taken from Vim, the Normal highlight group. |
| 94 | + |
| 95 | +For a color terminal the 'background' option is used to decide whether the |
| 96 | +terminal window will start with a white or black background. |
| 97 | + |
| 98 | +To use a different color the Terminal highlight group can be used: > |
| 99 | + hi Terminal ctermbg=lightgrey ctermfg=blue guibg=lightgrey guifg=blue |
91 | 100 |
|
92 | 101 |
|
93 | 102 | Syntax ~ |
@@ -216,12 +225,16 @@ mode. |
216 | 225 | Use CTRL-W N (or 'termkey' N) to switch to Terminal-Normal mode. Now the |
217 | 226 | contents of the terminal window is under control of Vim, the job output is |
218 | 227 | suspended. CTRL-\ CTRL-N does the same. |
| 228 | + |
| 229 | +Terminal-Job mode is where |:tmap| mappings are applied. Keys sent by |
| 230 | +|term_sendkeys()| are not subject to tmap, but keys from |feedkeys()| are. |
| 231 | + |
219 | 232 | *E946* |
220 | 233 | In Terminal-Normal mode you can move the cursor around with the usual Vim |
221 | 234 | commands, Visually mark text, yank text, etc. But you cannot change the |
222 | 235 | contents of the buffer. The commands that would start insert mode, such as |
223 | 236 | 'i' and 'a', return to Terminal-Job mode. The window will be updated to show |
224 | | -the contents of the terminal. |
| 237 | +the contents of the terminal. |:startinsert| is ineffective. |
225 | 238 |
|
226 | 239 | In Terminal-Normal mode the statusline and window title show "(Terminal)". If |
227 | 240 | the job ends while in Terminal-Normal mode this changes to |
@@ -296,7 +309,7 @@ inspects the resulting screen state. |
296 | 309 |
|
297 | 310 | Functions ~ |
298 | 311 |
|
299 | | -term_sendkeys() send keystrokes to a terminal |
| 312 | +term_sendkeys() send keystrokes to a terminal (not subject to tmap) |
300 | 313 | term_wait() wait for screen to be updated |
301 | 314 | term_scrape() inspect terminal screen |
302 | 315 |
|
@@ -359,6 +372,14 @@ In the window showing the source code some commands can used to control gdb: |
359 | 372 | :Finish execute the gdb "finish" command |
360 | 373 | :Continue execute the gdb "continue" command |
361 | 374 |
|
| 375 | +The plugin adds a window toolbar with these entries: |
| 376 | + Step :Step |
| 377 | + Next :Over |
| 378 | + Finish :Finish |
| 379 | + Cont :Continue |
| 380 | + Eval :Evaluate |
| 381 | +This way you can use the mouse to perform the most common commands. |
| 382 | + |
362 | 383 |
|
363 | 384 | Inspecting variables ~ |
364 | 385 |
|
@@ -403,6 +424,12 @@ When 'background' is "dark": |
403 | 424 | hi debugPC term=reverse ctermbg=darkblue guibg=darkblue |
404 | 425 | hi debugBreakpoint term=reverse ctermbg=red guibg=red |
405 | 426 |
|
| 427 | +To change the width of the Vim window when debugging starts, and use a |
| 428 | +vertical split: > |
| 429 | + let g:termdebug_wide = 163 |
| 430 | +This will set &columns to 163 when :Termdebug is used. The value is restored |
| 431 | +when quitting the debugger. |
| 432 | + |
406 | 433 |
|
407 | 434 |
|
408 | 435 | vim:tw=78:ts=8:ft=help:norl: |
0 commit comments