Home Explore Blog CI



neovim

7th chunk of `runtime/doc/terminal.txt`
6cc0a94ceccb320f1c52298199cefbf348aecaffe28b13930000000100000fa2
 if the debugger is already
				running or the debugger command cannot be
				executed.
						*TermdebugStartPost*
TermdebugStartPost		After debugging has initialized.
				If a "!" bang is passed to `:Termdebug` or
				`:TermdebugCommand` the event is triggered
				before running the provided command in gdb.
						*TermdebugStopPre*
TermdebugStopPre		Before debugging ends, when gdb is terminated,
				most likely after issuing a "quit" command in
				the gdb window.
						*TermdebugStopPost*
TermdebugStopPost		After debugging has ended, gdb-related windows
				are closed, debug buffers wiped out and
				the state before the debugging was restored.


Customizing ~
				*termdebug-customizing* *g:termdebug_config*
In the past several global variables were used for configuration.  These are
deprecated and using the g:termdebug_config dictionary is preferred.  When
g:termdebug_config exists the other global variables will NOT be used.
The recommended way is to start with an empty dictionary: >vim
	let g:termdebug_config = {}

Then you can add entries to the dictionary as mentioned below.  The
deprecated global variable names are mentioned for completeness.  If you are
switching over to using g:termdebug_config you can find the old variable name
and take over the value, then delete the deprecated variable.


Prompt mode ~
						*termdebug-prompt*
When on MS-Windows, gdb will run in a buffer with 'buftype' set to "prompt".
This works slightly differently:
- The gdb window will be in Insert mode while typing commands.  Go to Normal
  mode with <Esc>, then you can move around in the buffer, copy/paste, etc.
  Go back to editing the gdb command with any command that starts Insert mode,
  such as `a` or `i`.
- A separate :terminal window will be opened to run the debugged program in.

						*termdebug_use_prompt*
Prompt mode can be used with: >vim
	let g:termdebug_config['use_prompt'] = 1
If there is no g:termdebug_config you can use: >vim
	let g:termdebug_use_prompt = 1
<
Mappings ~
The termdebug plugin enables a few default mappings.  All those mappings
are reset to their original values once the termdebug session concludes.

					*termdebug_map_K* *termdebug-mappings*
The K key is normally mapped to |:Evaluate| unless a buffer local (|:map-local|)
mapping to K already exists.  If you do not want this use: >vim
	let g:termdebug_config['map_K'] = 0
If there is no g:termdebug_config you can use: >vim
	let g:termdebug_map_K = 0
<
						*termdebug_map_minus*
The - key is normally mapped to |:Down| unless a buffer local mapping to the -
key already exists.  If you do not want this use: >vim
	let g:termdebug_config['map_minus'] = 0
<
						*termdebug_map_plus*
The + key is normally mapped to |:Up| unless a buffer local mapping to the +
key already exists.  If you do not want this use: >vim
	let g:termdebug_config['map_plus'] = 0
<
						*termdebug_disasm_window*
If you want the Asm window shown by default, set the "disasm_window" flag to
1.  The "disasm_window_height" entry can be used to set the window height: >vim
	let g:termdebug_config['disasm_window'] = 1
	let g:termdebug_config['disasm_window_height'] = 15
If there is no g:termdebug_config you can use: >vim
	let g:termdebug_disasm_window = 15
Any value greater than 1 will set the Asm window height to that value.
If the current window has enough horizontal space, it will be vertically split
and the Asm window will be shown side by side with the source code window (and
the height option won't be used).

						*termdebug_variables_window*
If you want the Var window shown by default, set the "variables_window" flag
to 1.  The "variables_window_height" entry can be used to set the window
height: >vim
	let g:termdebug_config['variables_window'] = 1
	let g:termdebug_config['variables_window_height'] = 15
If there is no g:termdebug_config you can use: >vim
	let g:termdebug_variables_window = 15
Any value greater than 1 will set the Var window height to that value.
If the current window has enough

Title: Termdebug Events, Customization, Prompt Mode, and Mappings
Summary
This section describes the Termdebug autocommands (`TermdebugStartPre`, `TermdebugStartPost`, `TermdebugStopPre`, `TermdebugStopPost`) that trigger at various stages of the debugging process. It further details how to customize Termdebug using the `g:termdebug_config` dictionary, including enabling prompt mode for MS-Windows and managing default mappings for keys like `K`, `-`, and `+`. It also covers options for displaying the Assembly (Asm) and Variables (Var) windows by default and setting their heights.