chore:add_diffview

This commit is contained in:
dichgrem
2025-10-21 10:59:44 +08:00
parent a6d8827eff
commit a32a68a24b
4 changed files with 36 additions and 28 deletions

View File

@@ -13,11 +13,11 @@ map("n", "<C-S-Tab>", "<cmd>bprevious<CR>", { desc = "Previous buffer (like VSCo
vim.keymap.set("n", "<C-w>", "<cmd>BufferLinePickClose<CR>", { desc = "Close buffer (BufferLine)" }) vim.keymap.set("n", "<C-w>", "<cmd>BufferLinePickClose<CR>", { desc = "Close buffer (BufferLine)" })
vim.keymap.set("n", "<C-S-5>", function() vim.keymap.set("n", "<C-S-5>", function()
if vim.bo.buftype == "terminal" then if vim.bo.buftype == "terminal" then
vim.cmd("vsplit | terminal") vim.cmd("vsplit | terminal")
else else
vim.cmd("botright split | terminal") vim.cmd("botright split | terminal")
end end
end, { desc = "Split terminal" }) end, { desc = "Split terminal" })
-- 在终端模式下的快捷键 -- 在终端模式下的快捷键
@@ -27,5 +27,5 @@ vim.keymap.set("t", "<C-k>", "<C-\\><C-n><C-w>k", { desc = "Go to upper window"
vim.keymap.set("t", "<C-l>", "<C-\\><C-n><C-w>l", { desc = "Go to right window" }) vim.keymap.set("t", "<C-l>", "<C-\\><C-n><C-w>l", { desc = "Go to right window" })
vim.keymap.set("n", "<leader>xo", function() vim.keymap.set("n", "<leader>xo", function()
vim.fn.jobstart({ "xdg-open", vim.fn.expand("%:p") }, { detach = true }) vim.fn.jobstart({ "xdg-open", vim.fn.expand("%:p") }, { detach = true })
end, { desc = "使用系统默认应用程序打开当前文件" }) end, { desc = "使用系统默认应用程序打开当前文件" })

View File

@@ -1,16 +1,16 @@
return { return {
{ {
"folke/tokyonight.nvim", "folke/tokyonight.nvim",
lazy = false, lazy = false,
priority = 1000, priority = 1000,
opts = { opts = {
style = "storm", style = "storm",
}, },
config = function(_, opts) config = function(_, opts)
require("tokyonight").setup(opts) require("tokyonight").setup(opts)
vim.defer_fn(function() vim.defer_fn(function()
vim.cmd([[colorscheme tokyonight]]) vim.cmd([[colorscheme tokyonight]])
end, 0) end, 0)
end, end,
}, },
} }

View File

@@ -1,10 +1,10 @@
-- ~/.config/nvim/lua/plugins/dashboard.lua -- ~/.config/nvim/lua/plugins/dashboard.lua
return { return {
"folke/snacks.nvim", "folke/snacks.nvim",
opts = { opts = {
dashboard = { dashboard = {
preset = { preset = {
header = [[ header = [[
███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗
████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║
██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║
@@ -12,7 +12,7 @@ return {
██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║
╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
]], ]],
}, },
}, },
}, },
} }

View File

@@ -0,0 +1,8 @@
return {
"sindrets/diffview.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
cmd = { "DiffviewOpen", "DiffviewClose", "DiffviewFileHistory" },
config = function()
require("diffview").setup()
end,
}