-- 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 map = vim.keymap.set local opts = { noremap = true, silent = true } -- === VSCode-like buffer/tab navigation === map("n", "", "bnext", { desc = "Next buffer (like VSCode)" }) map("n", "", "bprevious", { desc = "Previous buffer (like VSCode)" }) -- === Close buffer like Ctrl + W in VSCode === vim.keymap.set("n", "", "BufferLinePickClose", { desc = "Close buffer (BufferLine)" }) vim.keymap.set("n", "", function() if vim.bo.buftype == "terminal" then vim.cmd("vsplit | terminal") else vim.cmd("botright split | terminal") end end, { desc = "Split terminal" }) -- 在终端模式下的快捷键 vim.keymap.set("t", "", "h", { desc = "Go to left window" }) vim.keymap.set("t", "", "j", { desc = "Go to lower window" }) vim.keymap.set("t", "", "k", { desc = "Go to upper window" }) vim.keymap.set("t", "", "l", { desc = "Go to right window" }) vim.keymap.set("n", "xo", function() vim.fn.jobstart({ "xdg-open", vim.fn.expand("%:p") }, { detach = true }) end, { desc = "使用系统默认应用程序打开当前文件" })