77Terminal window support *terminal*
88
99
10- WARNING: THIS IS ONLY PARTLY IMPLEMENTED, ANYTHING CAN STILL CHANGE
11-
1210The terminal feature is optional, use this to check if your Vim has it: >
1311 echo has('terminal')
1412 If the result is "1" you have it.
@@ -40,7 +38,6 @@ If the result is "1" you have it.
4038
4139{Vi does not have any of these commands}
4240{only available when compiled with the | +terminal | feature}
43-
4441The terminal feature requires the | +multi_byte | , | +job | and | +channel | features.
4542
4643==============================================================================
@@ -481,7 +478,7 @@ program window A terminal window for the executed program. When "run" is
481478
482479The current window is used to show the source code. When gdb pauses the
483480source 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.
485482
486483If the buffer in the current window is modified, another window will be opened
487484to display the current gdb position.
@@ -506,6 +503,7 @@ You should now have three windows:
506503 source - where you started, has a window toolbar with buttons
507504 gdb - you can type gdb commands here
508505 program - the executed program will use this window
506+
509507You can use CTRL-W CTRL-W or the mouse to move focus between windows.
510508Put focus on the gdb window and type: >
511509 break ex_help
@@ -526,6 +524,8 @@ displayed:
526524This way you can inspect the value of local variables. You can also focus the
527525gdb window and use a "print" command, e.g.: >
528526 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.
529529
530530Now go back to the source window and put the cursor on the first line after
531531the for loop, then type: >
@@ -561,38 +561,42 @@ Put focus on the gdb window to type commands there. Some common ones are:
561561- frame N go to the N th stack frame
562562- continue continue execution
563563
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 `
567567
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
570570
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
576576
577577If '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 `
584584This way you can use the mouse to perform the most common commands. You need
585585to have the 'mouse' option set to enable mouse clicks.
586586
587+ You can add the window toolbar in other windows you open with: >
588+ :Winbar
589+
587590
588591Inspecting variables ~
589592 *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
594597
595598This is similar to using "print" in the gdb window.
599+ You can usually shorten `:Evaluate ` to `:Ev` .
596600
597601
598602Other commands ~
@@ -609,17 +613,21 @@ will break the debugger.
609613
610614
611615Customizing ~
612- *termdebug-customizing*
616+
617+ GDB command *termdebug-customizing*
618+
613619To change the name of the gdb command, set the "termdebugger" variable before
614620invoking `:Termdebug ` : >
615621 let termdebugger = "mygdb"
616- < *gdb-version*
622+ < *gdb-version*
617623Only debuggers fully compatible with gdb will work. Vim uses the GDB/MI
618624interface. This probably requires gdb version 7.12. if you get this error:
619625 Undefined command: "new-ui". Try "help".~
620626Then your gdb is too old.
621627
622- *hl-debugPC* *hl-debugBreakpoint*
628+
629+ Colors *hl-debugPC* *hl-debugBreakpoint*
630+
623631The color of the signs can be adjusted with these highlight groups:
624632- debugPC the current position
625633- debugBreakpoint a breakpoint
@@ -632,6 +640,20 @@ When 'background' is "dark":
632640 hi debugPC term=reverse ctermbg=darkblue guibg=darkblue
633641 hi debugBreakpoint term=reverse ctermbg=red guibg=red
634642
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+
635657To change the width of the Vim window when debugging starts, and use a
636658vertical split: >
637659 let g:termdebug_wide = 163
0 commit comments