-- floating terminal
-- TODO: I prefer a split buffer for terminal, need to review how to make this more vim-like
-local lazyterm = function() LazyVim.terminal(nil, { cwd = LazyVim.root() }) end
+local lazyterm = function() LazyVim.terminal(nil, {}) end
vim.keymap.set("n", "<leader>ft", lazyterm, { desc = "Terminal (Root Dir)" })
vim.keymap.set("n", "<leader>fT", function() LazyVim.terminal() end, { desc = "Terminal (cwd)" })
win = {
input = {
keys = {
- ["<a-c>"] = { "toggle_cwd", mode = { "n", "i" }, },
["<c-t>"] = { "trouble_open", mode = { "n", "i" }, },
},
},
},
actions = {
- ---@param p snacks.Picker
- toggle_cwd = function(p)
- local root = LazyVim.root({ buf = p.input.filter.current_buf, normalize = true })
- local cwd = vim.fs.normalize((vim.uv or vim.loop).cwd() or ".")
- local current = p:cwd()
- p:set_cwd(current == root and cwd or root)
- p:find()
- end,
actions = require("trouble.sources.snacks").actions,
},
},