Skip to content

Commit 235bffd

Browse files
scottmckendrygithub-actions[bot]
authored andcommitted
doc: auto-generate vimdoc
1 parent 2108c9e commit 235bffd

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

doc/cyberdream.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Table of Contents *cyberdream-table-of-contents*
77
- Installation |cyberdream-installation|
88
- Usage |cyberdream-usage|
99
- Configuring |cyberdream-configuring|
10+
- ‍ Recipes |cyberdream-‍-recipes|
1011
- Contributing |cyberdream-contributing|
1112
1. Links |cyberdream-links|
1213

@@ -126,6 +127,35 @@ their default values:
126127
<
127128

128129

130+
‍ RECIPES *cyberdream-‍-recipes*
131+
132+
Include these alongside the `setup` function to add additional functionality to
133+
the theme.
134+
135+
136+
MAP A KEY TO TOGGLE BETWEEN LIGHT AND DARK MODE
137+
138+
>lua
139+
-- Add a custom keybinding to toggle the colorscheme
140+
vim.api.nvim_set_keymap("n", "<leader>tt", ":CyberdreamToggleMode<CR>", { noremap = true, silent = true })
141+
<
142+
143+
144+
CREATE AN AUTOCMD TO HOOK INTO THE TOGGLE EVENT AND RUN CUSTOM CODE
145+
146+
>lua
147+
-- The event data property will contain a string with either "default" or "light" respectively
148+
vim.api.nvim_create_autocmd("User", {
149+
pattern = "CyberdreamToggleMode",
150+
callback = function(event)
151+
-- Your custom code here!
152+
-- For example, notify the user that the colorscheme has been toggled
153+
print("Switched to " .. event.data .. " mode!")
154+
end,
155+
})
156+
<
157+
158+
129159
CONTRIBUTING *cyberdream-contributing*
130160

131161
Pull requests are welcome. If a plugin you use is not supported, please open an
@@ -137,6 +167,7 @@ feedback, please open an issue.
137167

138168
1. *image*: https://github.com/scottmckendry/cyberdream.nvim/assets/39483124/55ad863e-11e6-4539-bf67-118ea328fb5b
139169
2. *image*: https://github.com/scottmckendry/cyberdream.nvim/assets/39483124/387a32f3-da38-4e96-b1e6-ea55591ec9ae
170+
3. *image*: https://github.com/scottmckendry/cyberdream.nvim/assets/39483124/c0188d60-d62b-4a15-965d-a19757c484e6
140171

141172
Generated by panvimdoc <https://github.com/kdheepak/panvimdoc>
142173

0 commit comments

Comments
 (0)