Home Explore Blog CI



neovim

9th chunk of `runtime/doc/terminal.txt`
a53bd1da38e12a49faf247845c56999b2536fdf4c615245200000001000007e8
 g:termdebug_config['command'] = "mygdb"
If there is no g:termdebug_config you can use: >vim
	let g:termdebugger = "mygdb"

If the command needs an argument use a List: >vim
	let g:termdebug_config['command'] = ['rr', 'replay', '--']
If there is no g:termdebug_config you can use: >vim
	let g:termdebugger = ['rr', 'replay', '--']

If you are a mouse person, you can also define a mapping using your right
click to one of the terminal command like evaluate the variable under the
cursor: >vim
	nnoremap <RightMouse> :Evaluate<CR>
or set/unset a breakpoint: >vim
	nnoremap <RightMouse> :Break<CR>


Several arguments will be added to make gdb work well for the debugger.
If you want to modify them, add a function to filter the argument list: >vim
	let g:termdebug_config['command_filter'] = MyDebugFilter

If you do not want the arguments to be added, but you do need to set the
"pty", use a function to add the necessary arguments: >vim
	let g:termdebug_config['command_add_args'] = MyAddArguments
The function will be 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()

Title: Customizing GDB Command, Mouse Mappings, Argument Filtering, and Highlighting in Termdebug
Summary
This section explains how to customize the GDB command used by Termdebug, including specifying arguments using a list. It also shows how to map mouse clicks to Termdebug commands like evaluating a variable or setting breakpoints. The section further explains how to filter or add arguments to the GDB command line using functions. It notes the required GDB version for the "new-ui" command and how to customize the colors for the current position and breakpoints. Finally, it briefly mentions defining custom shortcuts using TermDebugSendCommand().