feat(root): customizable root detection and :LazyRoot command

This commit is contained in:
Folke Lemaitre 2023-10-11 08:59:18 +02:00
parent 5538ab2d64
commit 171a843edf
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
6 changed files with 126 additions and 38 deletions

View file

@ -115,7 +115,7 @@ if vim.lsp.inlay_hint then
end
-- lazygit
map("n", "<leader>gg", function() Util.terminal({ "lazygit" }, { cwd = Util.root.get(), esc_esc = false, ctrl_hjkl = false }) end, { desc = "Lazygit (root dir)" })
map("n", "<leader>gg", function() Util.terminal({ "lazygit" }, { cwd = Util.root(), esc_esc = false, ctrl_hjkl = false }) end, { desc = "Lazygit (root dir)" })
map("n", "<leader>gG", function() Util.terminal({ "lazygit" }, {esc_esc = false, ctrl_hjkl = false}) end, { desc = "Lazygit (cwd)" })
-- quit
@ -128,7 +128,7 @@ map("n", "<leader>ui", vim.show_pos, { desc = "Inspect Pos" })
map("n", "<leader>L", Util.changelog, {desc = "LazyVim Changelog"})
-- floating terminal
local lazyterm = function() Util.terminal(nil, { cwd = Util.root.get() }) end
local lazyterm = function() Util.terminal(nil, { cwd = Util.root() }) end
map("n", "<leader>ft", lazyterm, { desc = "Terminal (root dir)" })
map("n", "<leader>fT", function() Util.terminal() end, { desc = "Terminal (cwd)" })
map("n", "<c-/>", lazyterm, { desc = "Terminal (root dir)" })