Skip to content

Commit 14fe46a

Browse files
committed
Make Usage info in README a bit more verbose
1 parent 2edd637 commit 14fe46a

File tree

1 file changed

+37
-14
lines changed

1 file changed

+37
-14
lines changed

README.md

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,42 @@ You'll need to install and configure a debug adapter per language. See
3838

3939
A typical debug flow consists of:
4040

41-
- Setting breakpoints via `:lua require'dap'.toggle_breakpoint()`.
42-
- Launching debug sessions and resuming execution via `:lua require'dap'.continue()`.
43-
- Stepping through code via `:lua require'dap'.step_over()` and `:lua require'dap'.step_into()`.
44-
- Inspecting the state via the built-in REPL: `:lua require'dap'.repl.open()`
45-
or using the widget UI (`:help dap-widgets`)
41+
- Setting breakpoints via `:DapToggleBreakpoint` or `:lua
42+
require'dap'.toggle_breakpoint()`.
43+
- Launching debug sessions and resuming execution via `:DapNew` and
44+
`:DapContinue` or `:lua require'dap'.continue()`.
45+
- Stepping through code via `:DapStepOver`, `:DapStepInto` or the corresponding
46+
functions `:lua require'dap'.step_over()` and `:lua
47+
require'dap'.step_into()`.
48+
- Inspecting the state:
49+
- Via the built-in REPL: `:lua require'dap'.repl.open()`
50+
- Try typing an expression followed by ENTER to evaluate it.
51+
- Try commands like `.help`, `.frames`, `.threads`.
52+
- Variables with structure can be expanded and collapsed with ENTER on the
53+
corresponding line.
54+
- Via the widget UI (`:help dap-widgets`). Typically you'd inspect values,
55+
threads, stacktrace ad-hoc when needed instead of showing the information
56+
all the time, but you can also create sidebars for a permanent display
57+
- Via UI extensions:
58+
- IDE like: [nvim-dap-ui][15]
59+
- Middle ground between the IDE like nvim-dap-ui and the built-in widgets: [nvim-dap-view][nvim-dap-view]
60+
- Show inline values: [nvim-dap-virtual-text][7]
4661

4762
See [:help dap.txt](doc/dap.txt), `:help dap-mapping` and `:help dap-api`.
4863

64+
**Tip:**
65+
66+
The arrow keys are good candidates for keymaps to step through code as their
67+
direction resembles the direction you'll step to.
68+
69+
- Down: Step over
70+
- Right: Step into
71+
- Left: Step out
72+
- Up: Restart frame
73+
74+
You can setup keymaps temporary during a debug session using event listeners.
75+
See `:help dap-listeners`.
76+
4977
## Supported languages
5078

5179
In theory all of the languages for which a debug adapter exists should be
@@ -74,14 +102,9 @@ older version. Please update the wiki if you discover outdated examples.
74102
to extend the debugging experience. Either by improving the UI or by making
75103
it easier to debug parts of an application.
76104

77-
- Examples of UI/UX extensions are [nvim-dap-virtual-text][7] and [nvim-dap-ui][15]
78-
- Examples for language specific extensions include [nvim-jdtls][8] and [nvim-dap-python][9]
79-
80-
## Extensions
81-
82-
All known extensions are listed in the [Wiki][10]. The wiki is community
83-
maintained. Please add new extensions if you built one or if you discovered one
84-
that's not listed.
105+
All known extensions are listed in the [Wiki][10]. The wiki is community
106+
maintained. Please add new extensions if you built one or if you discovered
107+
one that's not listed.
85108

86109
## Non-Goals
87110

@@ -147,4 +170,4 @@ time.
147170
[13]: https://microsoft.github.io/debug-adapter-protocol/implementors/adapters/
148171
[15]: https://github.com/rcarriga/nvim-dap-ui
149172
[demo]: https://user-images.githubusercontent.com/38700/124292938-669a7100-db56-11eb-93b8-77b66994fc8a.gif
150-
173+
[nvim-dap-view]: https://github.com/igorlfs/nvim-dap-view

0 commit comments

Comments
 (0)