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-S-5>", function()
if vim.bo.buftype == "terminal" then
vim.cmd("vsplit | terminal")
else
vim.cmd("botright split | terminal")
end
if vim.bo.buftype == "terminal" then
vim.cmd("vsplit | terminal")
else
vim.cmd("botright split | terminal")
end
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("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 = "使用系统默认应用程序打开当前文件" })

View File

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

View File

@@ -1,10 +1,10 @@
-- ~/.config/nvim/lua/plugins/dashboard.lua
return {
"folke/snacks.nvim",
opts = {
dashboard = {
preset = {
header = [[
"folke/snacks.nvim",
opts = {
dashboard = {
preset = {
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,
}