toggleterm执行外部exe测试。

This commit is contained in:
2026-02-09 17:22:57 +08:00
parent bfb0c6db53
commit 345e53b945
3 changed files with 26 additions and 0 deletions

View File

@@ -1,3 +1,24 @@
-- Keymaps are automatically loaded on the VeryLazy event
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
-- Add any additional keymaps here
--
--
--
local Terminal = require("toggleterm.terminal").Terminal
-- 测试外部命令。
local dir_term = Terminal:new({
cmd = "cmd.exe /c dir",
direction = "float",
float_opts = {
border = "rounded",
width = 100,
height = 30,
},
hidden = false,
close_on_exit = false,
})
vim.keymap.set("n", "<Leader>mt", function()
dir_term:toggle()
end, { desc = "List directory contents" })

View File

@@ -0,0 +1,4 @@
return {
-- amongst your other plugins
{ "akinsho/toggleterm.nvim", version = "*", config = true },
}