@@ -60,7 +60,7 @@ so we can fix it.
60
60
> You do not need to call ` require('neo-tree').setup({ ... }) ` for Neo-tree to work. ` setup() ` is only used for
61
61
> configuration.
62
62
63
- #### Minimal Example for Lazy :
63
+ #### Minimal Example for lazy.nvim :
64
64
``` lua
65
65
{
66
66
" nvim-neo-tree/neo-tree.nvim" ,
@@ -69,13 +69,16 @@ so we can fix it.
69
69
" nvim-lua/plenary.nvim" ,
70
70
" nvim-tree/nvim-web-devicons" , -- not strictly required, but recommended
71
71
" MunifTanjim/nui.nvim" ,
72
- -- {"3rd/image.nvim", opts = {}}, -- Optional image support in preview window: See `# Preview Mode` for more information
72
+ -- Optional image support for file preview: See `# Preview Mode` for more information.
73
+ -- {"3rd/image.nvim", opts = {}},
74
+ -- OR use snacks.nvim's image module:
75
+ -- "folke/snacks.nvim",
73
76
},
74
77
lazy = false , -- neo-tree will lazily load itself
75
78
--- @module " neo-tree"
76
79
--- @type neotree.Config ?
77
80
opts = {
78
- -- fill any relevant options here
81
+ -- add options here
79
82
},
80
83
}
81
84
```
89
92
" nvim-lua/plenary.nvim" ,
90
93
" nvim-tree/nvim-web-devicons" , -- not strictly required, but recommended
91
94
" MunifTanjim/nui.nvim" ,
92
- -- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information
95
+ -- Optional image support in preview window: See `# Preview Mode` for more information
96
+ -- { "3rd/image.nvim", config = function() require('image').setup({}) end },
97
+ -- OR use snacks.nvim's image module:
98
+ -- "folke/snacks.nvim",
93
99
}
94
100
})
95
101
```
@@ -153,10 +159,6 @@ return {
153
159
},
154
160
},
155
161
lazy = false ,
156
- ---- -Instead of using `config`, you can use `opts` instead, if you'd like:
157
- ---- -@module "neo-tree"
158
- ---- -@type neotree.Config
159
- -- opts = {},
160
162
config = function ()
161
163
-- If you want icons for diagnostic errors, you'll need to define them somewhere.
162
164
-- In Neovim v0.10+, you can configure them in vim.diagnostic.config(), like:
@@ -178,6 +180,8 @@ return {
178
180
-- vim.fn.sign_define("DiagnosticSignInfo", { text = " ", texthl = "DiagnosticSignInfo" })
179
181
-- vim.fn.sign_define("DiagnosticSignHint", { text = "", texthl = "DiagnosticSignHint" })
180
182
183
+ vim .keymap .set (" n" , " <leader>e" , " <Cmd>Neotree reveal<CR>" )
184
+
181
185
require (" neo-tree" ).setup ({
182
186
close_if_last_window = false , -- Close Neo-tree if it is the last window left in the tab
183
187
popup_border_style = " NC" , -- or "" to use 'winborder' on Neovim v0.11+
@@ -300,7 +304,14 @@ return {
300
304
[" <2-LeftMouse>" ] = " open" ,
301
305
[" <cr>" ] = " open" ,
302
306
[" <esc>" ] = " cancel" , -- close preview or floating neo-tree window
303
- [" P" ] = { " toggle_preview" , config = { use_float = true , use_image_nvim = true } },
307
+ [" P" ] = {
308
+ " toggle_preview" ,
309
+ config = {
310
+ use_float = true ,
311
+ use_snacks_image = true ,
312
+ use_image_nvim = true ,
313
+ },
314
+ },
304
315
-- Read `# Preview Mode` for more information
305
316
[" l" ] = " focus_preview" ,
306
317
[" S" ] = " open_split" ,
@@ -507,8 +518,6 @@ return {
507
518
},
508
519
},
509
520
})
510
-
511
- vim .keymap .set (" n" , " <leader>e" , " <Cmd>Neotree reveal<CR>" )
512
521
end ,
513
522
},
514
523
}
@@ -807,6 +816,7 @@ require("neo-tree").setup({
807
816
config = {
808
817
use_float = false ,
809
818
-- use_image_nvim = true,
819
+ -- use_snacks_image = true,
810
820
-- title = 'Neo-tree Preview',
811
821
},
812
822
},
@@ -831,11 +841,13 @@ window as being used as a preview.
831
841
832
842
#### Image Support in Preview Mode
833
843
834
- If you have [ 3rd/image.nvim] ( https://github.com/3rd/image.nvim ) installed, preview
844
+ If you have [ folke/snacks.nvim] ( https://github.com/folke/snacks.nvim/blob/main/docs/image.md )
845
+ or [ 3rd/image.nvim] ( https://github.com/3rd/image.nvim ) installed, preview
835
846
mode supports image rendering by default using kitty graphics protocol or ueberzug
836
847
([ Video] ( https://user-images.githubusercontent.com/41065736/277180763-b7152637-f310-43a5-b8c3-4bcba135629d.mp4 ) ).
837
- However, if you do not want this feature, you can disable it by changing the option
838
- ` use_image_nvim = false ` in the mappings config mentioned above.
848
+
849
+ However, if you do not want this feature, you can disable it by setting
850
+ ` use_snacks_image = false ` or ` use_image_nvim = false ` in the mappings config mentioned above.
839
851
840
852
## Configuration and Customization
841
853
0 commit comments