Skip to content

Commit d5cda10

Browse files
committed
docs: Document 'surround' keys
1 parent b43c98e commit d5cda10

File tree

1 file changed

+33
-23
lines changed

1 file changed

+33
-23
lines changed

README.md

+33-23
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ the NeoVim generation. It:
4848
- Provides [keymappings](#keymappings-and-commands) for normal, insert,
4949
visual, and operator-pending modes. Supports
5050
[dot-repeat](https://jovicailic.org/2018/03/vim-the-dot-command/).
51+
Can insert two 'surrounding' lines at the same time.
5152

5253
- Supports direct writing to NeoVim registers for batch insert of debugprint
5354
lines.
@@ -103,29 +104,33 @@ the box'. There are also some function invocations which are not mapped to any
103104
keymappings or commands by default, but could be. This is all shown in the
104105
following table.
105106

106-
| Mode | Default Key / Cmd | Purpose | Above/Below Line |
107-
| ---------- | --------------------------- | ------------------------------------------------------------------------------- | ---------------- |
108-
| Normal | `g?p` | Plain debug | Below |
109-
| Normal | `g?P` | Plain debug | Above |
110-
| Normal | `g?v` | Variable debug | Below |
111-
| Normal | `g?V` | Variable debug | Above |
112-
| Normal | None | Variable debug (always prompt for variable) | Below |
113-
| Normal | None | Variable debug (always prompt for variable) | Above |
114-
| Normal | None | Delete debug lines in buffer | - |
115-
| Normal | None | Comment/uncomment debug lines in buffer | - |
116-
| Insert | `Ctrl-G p` | Plain debug | In-place |
117-
| Insert | `Ctrl-G v` | Variable debug (always prompt for variable) | In-place |
118-
| Visual | `g?v` | Variable debug | Below |
119-
| Visual | `g?V` | Variable debug | Above |
120-
| Op-pending | `g?o` | Variable debug | Below |
121-
| Op-pending | `g?O` | Variable debug | Above |
122-
| Command | `:DeleteDebugPrints` | Delete debug lines in buffer | - |
123-
| Command | `:ToggleCommentDebugPrints` | Comment/uncomment debug lines in buffer | - |
124-
| Command | `:ResetDebugPrintsCounter` | Reset debug print persistent counter (only for built-in counter implementation) | - |
125-
126-
Each of the keymappings (except for insert mode) can also be prefixed with a
127-
register, see the [showcase](SHOWCASE.md#register-usage) for an example of how
128-
to use this to insert debugprint lines in batches.
107+
| Mode | Default Key / Cmd | Purpose | Above/Below Line |
108+
| ---------- | --------------------------- | ------------------------------------------------------------------------------- | -------------------------- |
109+
| Normal | `g?p` | Plain debug | Below |
110+
| Normal | `g?P` | Plain debug | Above |
111+
| Normal | `g?v` | Variable debug | Below |
112+
| Normal | `g?V` | Variable debug | Above |
113+
| Normal | None | Variable debug (always prompt for variable) | Below |
114+
| Normal | None | Variable debug (always prompt for variable) | Above |
115+
| Normal | `g?sp` | Plain debug | Above and below (surround) |
116+
| Normal | `g?sv` | Variable debug | Above and below (surround) |
117+
| Normal | None | Variable debug (always prompt for variable) | Above and below (surround) |
118+
| Normal | None | Delete debug lines in buffer | - |
119+
| Normal | None | Comment/uncomment debug lines in buffer | - |
120+
| Insert | `Ctrl-G p` | Plain debug | In-place |
121+
| Insert | `Ctrl-G v` | Variable debug (always prompt for variable) | In-place |
122+
| Visual | `g?v` | Variable debug | Below |
123+
| Visual | `g?V` | Variable debug | Above |
124+
| Op-pending | `g?o` | Variable debug | Below |
125+
| Op-pending | `g?O` | Variable debug | Above |
126+
| Op-pending | `g?so` | Variable debug | Above and below (surround) |
127+
| Command | `:DeleteDebugPrints` | Delete debug lines in buffer | - |
128+
| Command | `:ToggleCommentDebugPrints` | Comment/uncomment debug lines in buffer | - |
129+
| Command | `:ResetDebugPrintsCounter` | Reset debug print persistent counter (only for built-in counter implementation) | - |
130+
131+
Each of the keymappings (except for 'surround' keys and insert modes) can also
132+
be prefixed with a register, see the [showcase](SHOWCASE.md#register-usage) for
133+
an example of how to use this to insert debugprint lines in batches.
129134

130135
The keys and commands outlined above can be specifically overridden using the
131136
`keymaps` and `commands` objects inside the `opts` object used above during
@@ -144,8 +149,12 @@ return {
144149
variable_above = "g?V",
145150
variable_below_alwaysprompt = "",
146151
variable_above_alwaysprompt = "",
152+
surround_plain = "g?sp",
153+
surround_variable = "g?sv",
154+
surround_variable_alwaysprompt = "",
147155
textobj_below = "g?o",
148156
textobj_above = "g?O",
157+
textobj_surround = "g?so",
149158
toggle_comment_debug_prints = "",
150159
delete_debug_prints = "",
151160
},
@@ -223,6 +232,7 @@ they are used to convert sections to ROT-13, which most folks don't use.
223232
| Persistent location counter between NeoVim sessions | :+1: | :x: | :x: | :x: | :x: | :x: | :x: |
224233
| Print plain debug lines | :+1: | :+1: (via user config) | :+1: | :x: | :+1: | :x: | :x: |
225234
| Print variables using treesitter | :+1: | :+1: | :+1: | :x: | :+1: | :x: | :x: |
235+
| 'Surround' lines with debugging above and below | :+1: | :x: | :x: | :x: | :x: | :x: | :x: |
226236
| Use treesitter to locate log targets | (some languages) | :+1: | :+1: | :x: | :x: | :x: | :x: |
227237
| Use treesitter to intelligently insert log lines | :x: | :+1: | :+1: | :x: | :x: | :x: | :x: |
228238
| Enter variables/expressions using prompts | :+1: | :x: | :x: | :x: | :x: | :x: | :x: |

0 commit comments

Comments
 (0)