Skip to content

Commit 8370e27

Browse files
author
pkos98
committed
docs(pickers): add example to set default layout for pickers
1 parent 93ad23a commit 8370e27

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/picker.md

+18
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,24 @@ Snacks.picker.pick({source = "files", ...})
6363
}
6464
```
6565

66+
Example to set the default layout to "ivy" for the files picker if the screen is wide enough, else "vertical":
67+
68+
```lua
69+
{
70+
"folke/snacks.nvim",
71+
---@type snacks.Config
72+
opts = {
73+
picker = {
74+
sources = {
75+
files = {
76+
layout = { preset = function() return vim.o.columns >= 120 and "ivy" or "vertical" end },
77+
},
78+
}
79+
}
80+
}
81+
}
82+
```
83+
6684
## ⚙️ Config
6785

6886
```lua

0 commit comments

Comments
 (0)