Skip to content

Commit dc060d1

Browse files
committed
feat: remove old plugins for snacks.nvim migration
1 parent fce5bfd commit dc060d1

File tree

14 files changed

+243
-250
lines changed

14 files changed

+243
-250
lines changed
149 KB
Loading
-289 KB
Binary file not shown.

src/content/docs/configuration/customizing_plugins.mdx

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ return {
324324

325325
### Extending Core Plugin Config Functions
326326

327-
Many of our core plugins have additional code that runs during setup which you might want to extend. For this reason we have included our own modules in `require("astronvim.plugins.configs.X")` (replacing `X` with the plugin `require` string) that returns the AstroNvim default config function in each plugin specification that has a `config` function which can be easily called if you want to extend a plugin configuration. This is particularly useful if you want to do something like add rules to `nvim-autopairs`, add user snippets to `luasnip`, or add more extensions to `telescope` without having to rewrite our entire configuration function. Here is an example of adding the `media_files` Telescope extension:
327+
Many of our core plugins have additional code that runs during setup which you might want to extend. For this reason we have included our own modules in `require("astronvim.plugins.configs.X")` (replacing `X` with the plugin `require` string) that returns the AstroNvim default config function in each plugin specification that has a `config` function which can be easily called if you want to extend a plugin configuration. This is particularly useful if you want to do something like add rules to `nvim-autopairs` or add user snippets to `luasnip` without having to rewrite our entire configuration function. Here is an example of adding extending LuaSnip to use extend snippet filetypes:
328328

329329
:::note
330330

@@ -335,30 +335,27 @@ Not all plugins have custom `config` functions and will not have an `astronvim.p
335335
```lua title="lua/plugins/extended_config.lua" {10-11}
336336
return {
337337
{
338-
"nvim-telescope/telescope.nvim",
339-
dependencies = { -- add a new dependency to telescope that is our new plugin
340-
"nvim-telescope/telescope-media-files.nvim",
341-
},
338+
"L3MON4D3/LuaSnip",
342339
-- the first parameter is the plugin specification
343340
-- the second is the table of options as set up in Lazy with the `opts` key
344341
config = function(plugin, opts)
345342
-- run the core AstroNvim configuration function with the options table
346-
require("astronvim.plugins.configs.telescope")(plugin, opts)
343+
require("astronvim.plugins.configs.luasnip")(plugin, opts)
347344

348-
-- require telescope and load extensions as necessary
349-
require("telescope").load_extension("media_files")
345+
-- require luasnip and use it's API as normal
346+
require("luasnip").filetype_extend("javascript", { "javascriptreact" })
350347
end,
351348
},
352349
}
353350
```
354351

355352
## Disabling Plugins
356353

357-
Plugins can be easily disabled by simply setting the `enabled` option to `false`. Here is an example of disabling the core dashboard plugin, `alpha`:
354+
Plugins can be easily disabled by simply setting the `enabled` option to `false`. Here is an example of disabling the core easy escape plugin, `better-escape`:
358355

359356
```lua title="lua/plugins/disabled.lua" "enabled = false"
360357
return {
361-
{ "goolord/alpha-nvim", enabled = false },
358+
{ "max397574/better-escape.nvim", enabled = false },
362359
}
363360
```
364361

@@ -390,7 +387,7 @@ return {
390387
},
391388

392389
-- this plugin will be loaded on the autocmd event "UIEnter"
393-
{ "rcarriga/nvim-notify", event = "UIEnter" },
390+
{ "rebelot/heirline.nvim", event = "UIEnter" },
394391
}
395392
```
396393

@@ -445,10 +442,10 @@ return {
445442

446443
AstroNvim has many plugins that we load on the first real file that is open. This is used internally for plugins like Treesitter, LSP related plugins, and other various plugins related to interacting with files. We achieve this by creating a custom `User` `autocmd` event called `AstroFile`. This can also be used by users for lazy loading plugins on the first real file that is opened:
447444

448-
```lua title="lua/plugins/indent-blankline.lua" {4}
445+
```lua title="lua/plugins/illuminate.lua" {4}
449446
return {
450447
{
451-
"lukas-reineke/indent-blankline.nvim",
448+
"RRethy/vim-illuminate",
452449
event = "User AstroFile",
453450
},
454451
}

src/content/docs/index.mdx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ AstroNvim is an aesthetically pleasing and feature-rich neovim config that is ex
3030
- A clipboard tool is necessary for the integration with the system clipboard (see [`:help clipboard-tool`](https://neovim.io/doc/user/provider.html#clipboard-tool) for supported solutions)
3131
- Terminal with true color support (for the default theme, otherwise it is dependent on the theme you are using) <sup>[[2]](#2)</sup>
3232
- Optional Requirements:
33-
- [ripgrep](https://github.com/BurntSushi/ripgrep) - live grep telescope search (`<Leader>fw`)
33+
- [ripgrep](https://github.com/BurntSushi/ripgrep) - live grep file search (`<Leader>fw`)
3434
- [lazygit](https://github.com/jesseduffield/lazygit) - git ui toggle terminal (`<Leader>tl` or `<Leader>gg`)
3535
- [go DiskUsage()](https://github.com/dundee/gdu) - disk usage toggle terminal (`<Leader>tu`)
3636
- [bottom](https://github.com/ClementTsang/bottom) - process viewer toggle terminal (`<Leader>tt`)
@@ -40,19 +40,20 @@ AstroNvim is an aesthetically pleasing and feature-rich neovim config that is ex
4040
:::note
4141

4242
<sup id="1">\[1\]</sup> All downloadable Nerd Fonts contain icons which are used
43-
by AstroNvim. Install the Nerd Font of your choice to your system and in your terminal
44-
emulator settings, set its font face to that Nerd Font. If you are using AstroNvim
45-
on a remote system via SSH, you do not need to install the font on the remote system.
43+
by AstroNvim. Install the Nerd Font of your choice to your system and in your
44+
terminal emulator settings, set its font face to that Nerd Font. If you are
45+
using AstroNvim on a remote system via SSH, you do not need to install the font
46+
on the remote system.
4647

4748
:::
4849

4950
:::note
5051

51-
<sup id="2">\[2\]</sup> When using default theme: For MacOS, the default terminal
52-
does not have true color support. You will need to use [iTerm2](https://iterm2.com/),
53-
[Kitty](https://sw.kovidgoyal.net/kitty/), [WezTerm](https://wezfurlong.org/wezterm/),
54-
or another [terminal emulator](https://github.com/termstandard/colors) that has true
55-
color support.
52+
<sup id="2">\[2\]</sup> When using default theme: For MacOS, the default
53+
terminal does not have true color support. You will need to use
54+
[iTerm2](https://iterm2.com/), [Kitty](https://sw.kovidgoyal.net/kitty/),
55+
[WezTerm](https://wezfurlong.org/wezterm/), or another [terminal
56+
emulator](https://github.com/termstandard/colors) that has true color support.
5657

5758
:::
5859

@@ -188,7 +189,7 @@ docker run -w /root -it --rm alpine:edge sh -uelic '
188189
- Autocompletion with [Cmp](https://github.com/hrsh7th/nvim-cmp)
189190
- Git integration with [Gitsigns](https://github.com/lewis6991/gitsigns.nvim)
190191
- Terminal with [Toggleterm](https://github.com/akinsho/toggleterm.nvim)
191-
- Fuzzy finding with [Telescope](https://github.com/nvim-telescope/telescope.nvim)
192+
- Fuzzy finding with [snacks.picker](https://github.com/folke/snacks.nvim/blob/main/docs/picker.md)
192193
- Syntax highlighting with [Treesitter](https://github.com/nvim-treesitter/nvim-treesitter)
193194
- Formatting and linting with [none-ls](https://github.com/nvimtools/none-ls.nvim)
194195
- Language Server Protocol with [Native LSP](https://github.com/neovim/nvim-lspconfig)

src/content/docs/mappings.mdx

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -181,45 +181,53 @@ AstroNvim generally relies on `<Leader>` driven mappings, which is default set t
181181
| Toggle Debugger UI | `Leader + du` |
182182
| Debugger Hover | `Leader + dh` |
183183

184-
## Telescope Mappings
184+
## Picker Mappings
185185

186186
| Action | Mappings |
187187
| --------------------------------- | -------------------- |
188188
| Resume previous search | `Leader + f + Enter` |
189189
| Marks | `Leader + f'` |
190+
| AstroNvim config files | `Leader + fa` |
190191
| Buffers | `Leader + fb` |
191192
| Word at cursor | `Leader + fc` |
192193
| Commands | `Leader + fC` |
193194
| Find files | `Leader + ff` |
194195
| Find files (include hidden files) | `Leader + fF` |
196+
| Git tracked files | `Leader + fg` |
195197
| Help Tags | `Leader + fh` |
196198
| Keymaps | `Leader + fk` |
199+
| Lines | `Leader + fl` |
197200
| Man Pages | `Leader + fm` |
198201
| Notifications | `Leader + fn` |
199202
| Old Files | `Leader + fo` |
203+
| Old Files (current directory) | `Leader + fO` |
204+
| Projects | `Leader + fp` |
200205
| Registers | `Leader + fr` |
206+
| Smart (buffers,recent,files) | `Leader + fs` |
201207
| Colorschemes | `Leader + ft` |
202208
| Live Grep | `Leader + fw` |
203209
| Live Grep (include hidden files) | `Leader + fW` |
204210
| Git Branches | `Leader + gb` |
205211
| Git Commits (repository) | `Leader + gc` |
206212
| Git Commits (current file) | `Leader + gC` |
213+
| Git browse (open) | `Leader + go` |
207214
| Git Status | `Leader + gt` |
215+
| Git Stash | `Leader + gT` |
208216
| LSP Symbols | `Leader + ls` |
209217
| LSP Workspace Symbols | `Leader + lG` |
210218

211219
## Terminal Mappings
212220

213-
| Action | Mappings |
214-
| ------------------------ | ----------------------- |
215-
| Open Floating Terminal | `Leader + tf` |
216-
| Open Horizontal Terminal | `Leader + th` |
217-
| Open Vertical Terminal | `Leader + tv` |
218-
| Open Toggle Lazygit | `Leader + tl` |
219-
| Open Toggle node | `Leader + tn` |
220-
| Open Toggle Python | `Leader + tp` |
221-
| Open Toggle btm | `Leader + tt` |
222-
| Toggle Current Terminal | `<F7>` |
221+
| Action | Mappings |
222+
| ------------------------ | ------------- |
223+
| Open Floating Terminal | `Leader + tf` |
224+
| Open Horizontal Terminal | `Leader + th` |
225+
| Open Vertical Terminal | `Leader + tv` |
226+
| Open Toggle Lazygit | `Leader + tl` |
227+
| Open Toggle node | `Leader + tn` |
228+
| Open Toggle Python | `Leader + tp` |
229+
| Open Toggle btm | `Leader + tt` |
230+
| Toggle Current Terminal | `<F7>` |
223231

224232
## UI/UX Mappings
225233

@@ -255,3 +263,4 @@ AstroNvim generally relies on `<Leader>` driven mappings, which is default set t
255263
| Toggle syntax highlighting (buffer) | `Leader + uy` |
256264
| Toggle LSP semantic tokens (buffer) | `Leader + uY` |
257265
| Toggle color highlighting | `Leader + uz` |
266+
| Toggle zen mode | `Leader + uZ` |

src/content/docs/recipes/alpha.mdx

Lines changed: 0 additions & 66 deletions
This file was deleted.
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
id: dashboard
3+
title: Dashboard Customizations
4+
---
5+
6+
AstroNvim comes with [snacks.dashboard](https://github.com/folke/snacks.nvim/blob/main/docs/dashboard.md) by default for providing a dashboard/home screen. This page provides a few common customization options.
7+
8+
### Customize Dashboard Header
9+
10+
If you want to customize your header on the dashboard you can do this easily by overriding the `snacks.nvim` options in your plugins:
11+
12+
```lua title="lua/plugins/dashboard.lua"
13+
return {
14+
"folke/snacks.nvim",
15+
opts = {
16+
dashboard = {
17+
preset = {
18+
header = table.concat({
19+
"My Custom",
20+
"Dashboard Header",
21+
}, "\n"),
22+
},
23+
},
24+
},
25+
}
26+
```
27+
28+
### Customize Buttons
29+
30+
In order to customize buttons presented on the dashboard, you can modify `snacks.nvim` options:
31+
32+
```lua title="lua/plugins/dashboard_buttons.lua"
33+
return {
34+
"folke/snacks.nvim",
35+
opts = {
36+
dashboard = {
37+
preset = {
38+
keys = {
39+
{
40+
key = "h",
41+
action = function()
42+
vim.notify("Hello World!")
43+
end,
44+
desc = "Say Hi",
45+
},
46+
},
47+
},
48+
},
49+
},
50+
}
51+
```
52+
53+
### Open Dashboard Automatically When No More Buffers
54+
55+
If you want to make the dashboard/home screen open automatically when you close the last buffer in your session you can add the following to your AstroCore mappings configuration:
56+
57+
```lua title="lua/plugins/astrocore.lua"
58+
return {
59+
"AstroNvim/astrocore",
60+
---@type AstroCoreOpts
61+
opts = {
62+
mappings = {
63+
n = {
64+
["<Leader>c"] = {
65+
function()
66+
local bufs = vim.fn.getbufinfo({ buflisted = true })
67+
require("astrocore.buffer").close(0)
68+
if not bufs[2] then
69+
require("snacks").dashboard()
70+
end
71+
end,
72+
desc = "Close buffer",
73+
},
74+
},
75+
},
76+
},
77+
}
78+
```

src/content/docs/recipes/detached_git_worktrees.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: Detached Git Worktrees
55

66
Some users prefer tracking their dotfiles in bare git repos which rely on setting a detached worktree to work. However, without a `.git` folder, it's difficult to tell whether a file is being tracked by a bare repo or not. Unfortunately, this also means that while editing dotfiles, it's not possible to see git diffs in the gutter or open lazygit in the correct repository — at least not without further configuration.
77

8-
AstroNvim provides an easy way to enable git integration when editing files within detached worktrees, allowing gitsigns gutter highlighting, lazygit toggleterm, and telescope mappings to work as you would expect them to.
8+
AstroNvim provides an easy way to enable git integration when editing files within detached worktrees, allowing gitsigns gutter highlighting, lazygit toggleterm, and picker mappings to work as you would expect them to.
99

1010
This functionality is opt-in. To enable it, configure AstroCore and set the `git_worktrees` option to an array-like table, where each entry represents a separate worktree with entries `toplevel` and `gitdir` specifying paths on your system.
1111

0 commit comments

Comments
 (0)