Home Explore Blog CI



neovim

10th chunk of `runtime/doc/terminal.txt`
3d703dac6b616840207b89e7740a2762dee82bc76172764f0000000100000baf
 called with the list of arguments so far, and a second
argument that is the name of the pty.
							*gdb-version*
Only debuggers fully compatible with gdb will work.  Vim uses the GDB/MI
interface.  The "new-ui" command requires gdb version 7.12 or later.  If you
get this error:
	Undefined command: "new-ui". Try "help".~
Then your gdb is too old.


Colors ~
					*hl-debugPC* *hl-debugBreakpoint*
The color of the signs can be adjusted with these highlight groups:
- debugPC		the current position
- debugBreakpoint	a breakpoint

The defaults are, when 'background' is "light":
  hi debugPC term=reverse ctermbg=lightblue guibg=lightblue
  hi debugBreakpoint term=reverse ctermbg=red guibg=red

When 'background' is "dark":
  hi debugPC term=reverse ctermbg=darkblue guibg=darkblue
  hi debugBreakpoint term=reverse ctermbg=red guibg=red


Shortcuts ~
							*termdebug_shortcuts*
You can define your own shortcuts (mappings) to control gdb, that can work in
any window, using the TermDebugSendCommand() function.  Example: >vim
	map ,w :call TermDebugSendCommand('where')<CR>
The argument is the gdb command.


Popup menu ~
							*termdebug_popup*
By default the Termdebug plugin sets 'mousemodel' to "popup_setpos" and adds
these entries to the popup menu:
	Set breakpoint		`:Break`
	Clear breakpoint	`:Clear`
	Evaluate		`:Evaluate`
If you don't want this then disable it with: >vim
	let g:termdebug_config['popup'] = 0
If there is no g:termdebug_config you can use: >vim
	let g:termdebug_popup = 0


Change default signs ~
							*termdebug_signs*
Termdebug uses the hex number of the breakpoint ID in the signcolumn to
represent breakpoints. If it is greater than "0xFF", then it will be displayed
as "F+", due to we really only have two screen cells for the sign.
You may also use decimal breakpoint signs instead, in which case IDs greater
than 99 will be displayed as "9+".

If you want to customize the breakpoint signs to show `>>` in the signcolumn: >vim
	let g:termdebug_config['sign'] = '>>'
If you would like to use decimal (base 10) breakpoint signs: >vim
	let g:termdebug_config['sign_decimal'] = 1
If the variable g:termdebug_config does not yet exist, you can use: >vim
	let g:termdebug_config = {'sign': '>>'}
Likewise, to enable decimal signs: >vim
	let g:termdebug_config = {'sign_decimal': 1}


Vim window width ~
							*termdebug_wide*
To change the width of the Vim window when debugging starts and use a vertical
split: >vim
	let g:termdebug_config['wide'] = 163
If there is no g:termdebug_config you can use: >vim
	let g:termdebug_wide = 163

This will set 'columns' to 163 when `:Termdebug` is used.  The value is
restored when quitting the debugger.

If the wide value is set and 'columns' is already a greater value, then a
vertical split will be used without modifying 'columns'.

Set the wide value to 1 to use a vertical split without ever changing
'columns'.  This is useful when the terminal can't be resized by Vim.


 vim:tw=78:ts=8:noet:ft=help:norl:

Title: Customizing Termdebug: GDB Compatibility, Colors, Shortcuts, Popup Menu, Signs, and Window Width
Summary
This section provides details on configuring Termdebug, including ensuring GDB compatibility (version 7.12+ for "new-ui"). It describes customizing highlight groups for debug position and breakpoints. It explains how to define custom shortcuts via TermDebugSendCommand(). The section covers enabling/disabling the default popup menu entries for breakpoints and evaluation. It details customizing breakpoint signs in the sign column, including using decimal signs. It also shows how to control the Vim window width when debugging starts, allowing a vertical split.