1
- *terminal.txt* For Vim version 8.2. Last change: 2022 Apr 06
1
+ *terminal.txt* For Vim version 8.2. Last change: 2022 Jun 09
2
2
3
3
4
4
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -101,7 +101,7 @@ The special key combination CTRL-\ CTRL-N can be used to switch to Normal
101
101
mode, just like this works in any other mode.
102
102
*t_CTRL-W_CTRL-C*
103
103
CTRL-W CTRL-C can be typed to forcefully end the job. On MS-Windows a
104
- CTRL-B REAK will also kill the job.
104
+ CTRL-B reak will also kill the job.
105
105
106
106
If you type CTRL-C the effect depends on what the pty has been configured to
107
107
do. For simple commands this causes a SIGINT to be sent to the job, which
@@ -1285,6 +1285,8 @@ Put focus on the gdb window to type commands there. Some common ones are:
1285
1285
- next execute the current line and stop at the next line
1286
1286
- step execute the current line and stop at the next statement,
1287
1287
entering functions
1288
+ - until execute until past the current cursor line or past a specified
1289
+ position or the current stack frame returns
1288
1290
- finish execute until leaving the current function
1289
1291
- where show the stack
1290
1292
- frame N go to the N th stack frame
@@ -1303,6 +1305,7 @@ gdb:
1303
1305
1304
1306
*:Step* execute the gdb "step" command
1305
1307
*:Over* execute the gdb "next" command (`:Next ` is a Vim command)
1308
+ *:Until* execute the gdb "until" command
1306
1309
*:Finish* execute the gdb "finish" command
1307
1310
*:Continue* execute the gdb "continue" command
1308
1311
*:Stop* interrupt the program
@@ -1364,7 +1367,7 @@ Four autocommands can be used: >
1364
1367
*TermdebugStartPre*
1365
1368
TermdebugStartPre Before starting debugging.
1366
1369
Not triggered if the debugger is already
1367
- running or | g:termdebugger | cannot be
1370
+ running or the debugger command cannot be
1368
1371
executed.
1369
1372
*TermdebugStartPost*
1370
1373
TermdebugStartPost After debugging has initialized.
@@ -1395,18 +1398,24 @@ in a buffer with 'buftype' set to "prompt". This works slightly differently:
1395
1398
1396
1399
*termdebug_use_prompt*
1397
1400
Prompt mode can be used even when the | +terminal | feature is present with: >
1401
+ let g:termdebug_config['use_prompt'] = 1
1402
+ Or if there is no g:termdebug_config: >
1398
1403
let g:termdebug_use_prompt = 1
1399
1404
<
1400
1405
*termdebug_map_K*
1401
1406
The K key is normally mapped to :Evaluate. If you do not want this use: >
1407
+ let g:termdebug_config['map_K'] = 0
1408
+ Or if there is no g:termdebug_config: >
1402
1409
let g:termdebug_map_K = 0
1403
-
1404
1410
<
1405
1411
*termdebug_disasm_window*
1406
- If you want the Asm window shown by default, set this to 1. Setting to
1407
- any value greater than 1 will set the Asm window height to that value: >
1412
+ If you want the Asm window shown by default, set the flag to 1.
1413
+ the "disasm_window_height" entry can be used to set the window height: >
1414
+ let g:termdebug_config['disasm_window'] = 1
1415
+ let g:termdebug_config['disasm_window_height'] = 15
1416
+ or, if there is no g:termdebug_config: >
1408
1417
let g:termdebug_disasm_window = 15
1409
- <
1418
+ Any value greater than 1 will set the Asm window height to that value: >
1410
1419
1411
1420
Communication ~
1412
1421
*termdebug-communication*
@@ -1423,24 +1432,45 @@ communication channel.
1423
1432
1424
1433
1425
1434
Customizing ~
1435
+ *termdebug-customizing* *g:termdebug_config*
1436
+ In the past several global variables were used for configuration. These are
1437
+ deprecated, using the g:termdebug_config dictionary is preferred. When
1438
+ g:termdebug_config exists the other global variables will not be used.
1426
1439
1427
- GDB command *termdebug-customizing*
1440
+
1441
+ GDB command ~
1428
1442
*g:termdebugger*
1429
- To change the name of the gdb command, set the "g:termdebugger" variable before
1430
- invoking `:Termdebug ` : >
1443
+ To change the name of the gdb command, set "debugger" entry in
1444
+ g:termdebug_config or the "g:termdebugger" variable before invoking
1445
+ `:Termdebug ` : >
1446
+ let g:termdebug_config['command'] = "mygdb"
1447
+ Or if there is no g:termdebug_config: >
1431
1448
let g:termdebugger = "mygdb"
1449
+
1432
1450
If the command needs an argument use a List: >
1451
+ let g:termdebug_config['command'] = ['rr', 'replay', '--']
1452
+ Or if there is no g:termdebug_config: >
1433
1453
let g:termdebugger = ['rr', 'replay', '--']
1434
- < *gdb-version*
1454
+
1455
+ Several arguments will be added to make gdb work well for the debugger.
1456
+ If you want to modify them, add a function to filter the argument list: >
1457
+ let g:termdebug_config['command_filter'] = MyDebugFilter
1458
+
1459
+ If you do not want the arguments to be added, but you do need to set the
1460
+ "pty", use a function to add the necessary arguments: >
1461
+ let g:termdebug_config['command_add_args'] = MyAddArguments
1462
+ The function will be called with the list of arguments so far, and a second
1463
+ argument that is the name of the pty.
1464
+ *gdb-version*
1435
1465
Only debuggers fully compatible with gdb will work. Vim uses the GDB/MI
1436
1466
interface. The "new-ui" command requires gdb version 7.12 or later. if you
1437
1467
get this error:
1438
1468
Undefined command: "new-ui". Try "help".~
1439
1469
Then your gdb is too old.
1440
1470
1441
1471
1442
- Colors *hl-debugPC* *hl-debugBreakpoint*
1443
-
1472
+ Colors~
1473
+ *hl-debugPC* *hl-debugBreakpoint*
1444
1474
The color of the signs can be adjusted with these highlight groups:
1445
1475
- debugPC the current position
1446
1476
- debugBreakpoint a breakpoint
@@ -1470,22 +1500,26 @@ these entries to the popup menu:
1470
1500
Clear breakpoint `:Clear `
1471
1501
Evaluate `:Evaluate `
1472
1502
If you don't want this then disable it with: >
1503
+ let g:termdebug_config['popup'] = 0
1504
+ or if there is no g:termdebug_config: >
1473
1505
let g:termdebug_popup = 0
1474
1506
1475
1507
1476
1508
Vim window width *termdebug_wide*
1477
1509
1478
1510
To change the width of the Vim window when debugging starts and use a vertical
1479
1511
split: >
1512
+ let g:termdebug_config['wide'] = 163
1513
+ Or if there is no g:termdebug_config: >
1480
1514
let g:termdebug_wide = 163
1481
1515
1482
1516
This will set 'columns' to 163 when `:Termdebug ` is used. The value is
1483
1517
restored when quitting the debugger.
1484
1518
1485
- If g:termdebug_wide is set and 'columns' is already a greater value, then a
1519
+ If the wide value is set and 'columns' is already a greater value, then a
1486
1520
vertical split will be used without modifying 'columns' .
1487
1521
1488
- Set g:termdebug_wide to 1 to use a vertical split without ever changing
1522
+ Set the wide value to 1 to use a vertical split without ever changing
1489
1523
'columns' . This is useful when the terminal can't be resized by Vim.
1490
1524
1491
1525
0 commit comments