feat(keymaps): added floating terminal

This commit is contained in:
Folke Lemaitre 2023-01-05 11:38:05 +01:00
parent 68242540cf
commit 18756a614c
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
2 changed files with 5 additions and 0 deletions

View file

@ -88,6 +88,10 @@ if vim.fn.has("nvim-0.9.0") == 1 then
vim.keymap.set("n", "<leader>hl", vim.show_pos, { desc = "Highlight Groups at cursor" })
end
-- floating terminal
vim.keymap.set("n", "<leader>ot", function() util.float_term(nil, { cwd = util.get_root() }) end, { desc = "Terminal (root dir)" })
vim.keymap.set("n", "<leader>oT", function() require("lazyvim.util").float_term() end, { desc = "Terminal (cwd)" })
-- windows
vim.keymap.set("n", "<leader>ww", "<C-W>p", { desc = "other-window" })
vim.keymap.set("n", "<leader>wd", "<C-W>c", { desc = "delete-window" })

View file

@ -61,6 +61,7 @@ function M.telescope(builtin, opts)
end
function M.float_term(cmd, opts)
cmd = cmd or { vim.env.SHELL or vim.o.shell }
opts = vim.tbl_deep_extend("force", {
terminal = true,
close_on_exit = true,