diff --git a/lazy-lock.json b/lazy-lock.json index 636f78b..431b2de 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -37,6 +37,7 @@ "telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" }, "telescope.nvim": { "branch": "master", "commit": "ad7d9580338354ccc136e5b8f0aa4f880434dcdc" }, "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, + "toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" }, "tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" }, "trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, "ts-comments.nvim": { "branch": "main", "commit": "123a9fb12e7229342f807ec9e6de478b1102b041" }, diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index 2c134f7..06b1b8e 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -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", "mt", function() + dir_term:toggle() +end, { desc = "List directory contents" }) diff --git a/lua/plugins/toggleterm.lua b/lua/plugins/toggleterm.lua new file mode 100644 index 0000000..51ca35b --- /dev/null +++ b/lua/plugins/toggleterm.lua @@ -0,0 +1,4 @@ +return { + -- amongst your other plugins + { "akinsho/toggleterm.nvim", version = "*", config = true }, +}