7
7
Terminal window support *terminal*
8
8
9
9
10
- WARNING: THIS IS ONLY PARTLY IMPLEMENTED, ANYTHING CAN STILL CHANGE
11
-
12
10
The terminal feature is optional, use this to check if your Vim has it: >
13
11
echo has('terminal')
14
12
If the result is "1" you have it.
@@ -40,7 +38,6 @@ If the result is "1" you have it.
40
38
41
39
{Vi does not have any of these commands}
42
40
{only available when compiled with the | +terminal | feature}
43
-
44
41
The terminal feature requires the | +multi_byte | , | +job | and | +channel | features.
45
42
46
43
==============================================================================
@@ -481,7 +478,7 @@ program window A terminal window for the executed program. When "run" is
481
478
482
479
The current window is used to show the source code. When gdb pauses the
483
480
source file location will be displayed, if possible. A sign is used to
484
- highlight the current position ( using highlight group debugPC) .
481
+ highlight the current position, using highlight group debugPC.
485
482
486
483
If the buffer in the current window is modified, another window will be opened
487
484
to display the current gdb position.
@@ -506,6 +503,7 @@ You should now have three windows:
506
503
source - where you started, has a window toolbar with buttons
507
504
gdb - you can type gdb commands here
508
505
program - the executed program will use this window
506
+
509
507
You can use CTRL-W CTRL-W or the mouse to move focus between windows.
510
508
Put focus on the gdb window and type: >
511
509
break ex_help
@@ -526,6 +524,8 @@ displayed:
526
524
This way you can inspect the value of local variables. You can also focus the
527
525
gdb window and use a "print" command, e.g.: >
528
526
print *eap
527
+ If mouse pointer movements are working, Vim will also show a balloon when the
528
+ mouse rests on text that can be evaluated by gdb.
529
529
530
530
Now go back to the source window and put the cursor on the first line after
531
531
the for loop, then type: >
@@ -561,38 +561,42 @@ Put focus on the gdb window to type commands there. Some common ones are:
561
561
- frame N go to the N th stack frame
562
562
- continue continue execution
563
563
564
- In the window showing the source code these commands can used to control gdb:
565
- :Run [args] run the program with [args] or the previous arguments
566
- :Arguments {args} set arguments for the next :Run
564
+ In the window showing the source code these commands can be used to control gdb:
565
+ ` :Run ` [args] run the program with [args] or the previous arguments
566
+ ` :Arguments ` {args} set arguments for the next ` :Run `
567
567
568
- :Break set a breakpoint at the current line; a sign will be displayed
569
- :Delete delete a breakpoint at the current line
568
+ ` :Break ` set a breakpoint at the current line; a sign will be displayed
569
+ `: Clear ` delete the breakpoint at the current line
570
570
571
- :Step execute the gdb "step" command
572
- :Over execute the gdb "next" command (:Next is a Vim command)
573
- :Finish execute the gdb "finish" command
574
- :Continue execute the gdb "continue" command
575
- :Stop interrupt the program
571
+ ` :Step ` execute the gdb "step" command
572
+ ` :Over ` execute the gdb "next" command (` :Next ` is a Vim command)
573
+ ` :Finish ` execute the gdb "finish" command
574
+ ` :Continue ` execute the gdb "continue" command
575
+ ` :Stop ` interrupt the program
576
576
577
577
If 'mouse' is set the plugin adds a window toolbar with these entries:
578
- Step :Step
579
- Next :Over
580
- Finish :Finish
581
- Cont :Continue
582
- Stop :Stop
583
- Eval :Evaluate
578
+ Step ` :Step `
579
+ Next ` :Over `
580
+ Finish ` :Finish `
581
+ Cont ` :Continue `
582
+ Stop ` :Stop `
583
+ Eval ` :Evaluate `
584
584
This way you can use the mouse to perform the most common commands. You need
585
585
to have the 'mouse' option set to enable mouse clicks.
586
586
587
+ You can add the window toolbar in other windows you open with: >
588
+ :Winbar
589
+
587
590
588
591
Inspecting variables ~
589
592
*termdebug-variables*
590
- :Evaluate evaluate the expression under the cursor
591
- K same
592
- :Evaluate {expr} evaluate {expr}
593
- :'<,'>Evaluate evaluate the Visually selected text
593
+ ` :Evaluate ` evaluate the expression under the cursor
594
+ `K` same
595
+ ` :Evaluate ` {expr} evaluate {expr}
596
+ ` :' <,' >Evaluate ` evaluate the Visually selected text
594
597
595
598
This is similar to using "print" in the gdb window.
599
+ You can usually shorten `:Evaluate ` to `:Ev` .
596
600
597
601
598
602
Other commands ~
@@ -609,17 +613,21 @@ will break the debugger.
609
613
610
614
611
615
Customizing ~
612
- *termdebug-customizing*
616
+
617
+ GDB command *termdebug-customizing*
618
+
613
619
To change the name of the gdb command, set the "termdebugger" variable before
614
620
invoking `:Termdebug ` : >
615
621
let termdebugger = "mygdb"
616
- < *gdb-version*
622
+ < *gdb-version*
617
623
Only debuggers fully compatible with gdb will work. Vim uses the GDB/MI
618
624
interface. This probably requires gdb version 7.12. if you get this error:
619
625
Undefined command: "new-ui". Try "help".~
620
626
Then your gdb is too old.
621
627
622
- *hl-debugPC* *hl-debugBreakpoint*
628
+
629
+ Colors *hl-debugPC* *hl-debugBreakpoint*
630
+
623
631
The color of the signs can be adjusted with these highlight groups:
624
632
- debugPC the current position
625
633
- debugBreakpoint a breakpoint
@@ -632,6 +640,20 @@ When 'background' is "dark":
632
640
hi debugPC term=reverse ctermbg=darkblue guibg=darkblue
633
641
hi debugBreakpoint term=reverse ctermbg=red guibg=red
634
642
643
+
644
+ Popup menu *termdebug_popup*
645
+
646
+ By default the Termdebug plugin sets 'mousemodel' to "popup_setpos" and adds
647
+ these entries to the popup menu:
648
+ Set breakpoint `:Break `
649
+ Clear breakpoint `:Clear `
650
+ Evaluate `:Evaluate `
651
+ If you don't want this then disable it with: >
652
+ let g:termdebug_popup = 0
653
+
654
+
655
+ Vim window width *termdebug_wide*
656
+
635
657
To change the width of the Vim window when debugging starts, and use a
636
658
vertical split: >
637
659
let g:termdebug_wide = 163
0 commit comments