Skip to content

Commit db5b39c

Browse files
committed
Merge branch 'main' into feat/disable-term-for-adapters
2 parents faf5e39 + b13b86f commit db5b39c

File tree

4 files changed

+85
-0
lines changed

4 files changed

+85
-0
lines changed

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@
33

44
# nvim-dap-view
55

6+
<!--toc:start-->
7+
- [nvim-dap-view](#nvim-dap-view)
8+
- [Installation](#installation)
9+
- [Via lazy.nvim](#via-lazynvim)
10+
- [Features](#features)
11+
- [Documentation](#documentation)
12+
- [Configuration](#configuration)
13+
- [Usage](#usage)
14+
- [Highlight Groups](#highlight-groups)
15+
- [Filetypes and autocommands](#filetypes-and-autocommands)
16+
- [Roadmap](#roadmap)
17+
- [Known Issues](#known-issues)
18+
- [Acknowledgements](#acknowledgements)
19+
<!--toc:end-->
20+
621
> minimalistic [nvim-dap-ui](https://github.com/rcarriga/nvim-dap-ui) alternative
722
823
![watches view](https://github.com/user-attachments/assets/c6838700-95ed-4b39-9ab5-e0ed0e753995)
@@ -163,6 +178,33 @@ NvimDapViewBreakpointSeparator
163178

164179
They are linked to (somewhat) reasonable defaults, but they may look odd with your colorscheme. Consider contributing to your colorscheme by sending a PR to add support to `nvim-dap-view`.
165180

181+
### Filetypes and autocommands
182+
183+
`nvim-dap-view` sets buffer filetypes for the following Views
184+
185+
| Window | Filetype |
186+
| -------------------------------- | ------------- |
187+
| watches, exceptions, breakpoints | dap-view |
188+
| terminal | dap-view-term |
189+
190+
These filetypes can be used to override buffer and window options set by `nvim-dap-view`
191+
192+
<details>
193+
<summary>Example autocommand</summary>
194+
195+
Map q to quit in `nvim-dap-view` filetypes:
196+
197+
```lua
198+
vim.api.nvim_create_autocmd({ "FileType" }, {
199+
pattern = { "dap-view", "dap-view-term", "dap-repl" }, -- dap-repl is set by `nvim-dap`
200+
callback = function(evt)
201+
vim.keymap.set("n", "q", "<C-w>q", { silent = true, buffer = evt.buf })
202+
end,
203+
})
204+
```
205+
206+
</details>
207+
166208
## Roadmap
167209

168210
- Watches

doc/nvim-dap-view.txt

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,19 @@ Table of Contents *nvim-dap-view-table-of-contents*
1717
==============================================================================
1818
1. nvim-dap-view *nvim-dap-view-nvim-dap-view*
1919

20+
- |nvim-dap-view-nvim-dap-view|
21+
- |nvim-dap-view-installation|
22+
- |nvim-dap-view-via-lazy.nvim|
23+
- |nvim-dap-view-features|
24+
- |nvim-dap-view-documentation|
25+
- |nvim-dap-view-configuration|
26+
- |nvim-dap-view-usage|
27+
- |nvim-dap-view-highlight-groups|
28+
- |nvim-dap-view-filetypes-and-autocommands|
29+
- |nvim-dap-view-roadmap|
30+
- |nvim-dap-view-known-issues|
31+
- |nvim-dap-view-acknowledgements|
32+
2033

2134
minimalistic nvim-dap-ui <https://github.com/rcarriga/nvim-dap-ui> alternative
2235

@@ -178,6 +191,31 @@ your colorscheme. Consider contributing to your colorscheme by sending a PR to
178191
add support to `nvim-dap-view`.
179192

180193

194+
FILETYPES AND AUTOCOMMANDS ~
195+
196+
`nvim-dap-view` sets buffer filetypes for the following Views
197+
198+
Window Filetype
199+
---------------------------------- ---------------
200+
watches, exceptions, breakpoints dap-view
201+
terminal dap-view-term
202+
These filetypes can be used to override buffer and window options set by
203+
`nvim-dap-view`
204+
205+
Example autocommand ~
206+
207+
Map q to quit in `nvim-dap-view` filetypes:
208+
209+
>lua
210+
vim.api.nvim_create_autocmd({ "FileType" }, {
211+
pattern = { "dap-view", "dap-view-term", "dap-repl" }, -- dap-repl is set by `nvim-dap`
212+
callback = function(evt)
213+
vim.keymap.set("n", "q", "<C-w>q", { silent = true, buffer = evt.buf })
214+
end,
215+
})
216+
<
217+
218+
181219
ROADMAP *nvim-dap-view-nvim-dap-view-roadmap*
182220

183221
- Watches

lua/dap-view/options/settings.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ M.set_options = function()
1919
local buf = vim.bo[state.bufnr]
2020
buf.buftype = "nofile"
2121
buf.swapfile = false
22+
buf.filetype = "dap-view"
2223
end
2324

2425
M.set_keymaps = function()

lua/dap-view/term/options.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ M.set_options = function(winnr)
1111
win.statuscolumn = ""
1212
win.foldcolumn = "0"
1313
win.winfixbuf = true
14+
15+
local buf = vim.bo[state.term_bufnr]
16+
buf.filetype = "dap-view-term"
17+
buf.buftype = "nofile"
1418
end
1519

1620
return M

0 commit comments

Comments
 (0)