File tree Expand file tree Collapse file tree 2 files changed +45
-6
lines changed Expand file tree Collapse file tree 2 files changed +45
-6
lines changed Original file line number Diff line number Diff line change @@ -29,16 +29,34 @@ import TabItem from '@theme/TabItem';
29
29
30
30
## [ snacks.nvim] ( https://github.com/folke/snacks.nvim )
31
31
32
- recommended = true,
33
-
34
-
35
32
<Tabs >
36
33
37
34
<TabItem value =" opts " label =" Options " >
38
35
39
36
``` lua
40
37
opts = {
41
- picker = {},
38
+ picker = {
39
+ win = {
40
+ input = {
41
+ keys = {
42
+ [" <a-c>" ] = {
43
+ " toggle_cwd" ,
44
+ mode = { " n" , " i" },
45
+ },
46
+ },
47
+ },
48
+ },
49
+ actions = {
50
+ --- @param p snacks.Picker
51
+ toggle_cwd = function (p )
52
+ local root = LazyVim .root ({ buf = p .input .filter .current_buf , normalize = true })
53
+ local cwd = vim .fs .normalize ((vim .uv or vim .loop ).cwd () or " ." )
54
+ local current = p :cwd ()
55
+ p :set_cwd (current == root and cwd or root )
56
+ p :find ()
57
+ end ,
58
+ },
59
+ },
42
60
}
43
61
```
44
62
@@ -51,7 +69,28 @@ opts = {
51
69
{
52
70
" folke/snacks.nvim" ,
53
71
opts = {
54
- picker = {},
72
+ picker = {
73
+ win = {
74
+ input = {
75
+ keys = {
76
+ [" <a-c>" ] = {
77
+ " toggle_cwd" ,
78
+ mode = { " n" , " i" },
79
+ },
80
+ },
81
+ },
82
+ },
83
+ actions = {
84
+ --- @param p snacks.Picker
85
+ toggle_cwd = function (p )
86
+ local root = LazyVim .root ({ buf = p .input .filter .current_buf , normalize = true })
87
+ local cwd = vim .fs .normalize ((vim .uv or vim .loop ).cwd () or " ." )
88
+ local current = p :cwd ()
89
+ p :set_cwd (current == root and cwd or root )
90
+ p :find ()
91
+ end ,
92
+ },
93
+ },
55
94
},
56
95
-- stylua: ignore
57
96
keys = {
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ opts = nil
99
99
vim .api .nvim_create_autocmd (" FileType" , {
100
100
pattern = sql_ft ,
101
101
callback = function ()
102
- if LazyVim .has ( " nvim-cmp" ) then
102
+ if LazyVim .cmp_engine () == " nvim-cmp" then
103
103
local cmp = require (" cmp" )
104
104
105
105
-- global sources
You can’t perform that action at this time.
0 commit comments