This commit is contained in:
2025-05-09 22:16:19 +08:00
commit b868f3fd04
23 changed files with 575 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
return {
"akinsho/bufferline.nvim",
event = "VeryLazy",
opts = {
options = {
separator_style = { " ", " " },
},
highlights = {
buffer_selected = { italic = false, bold = false },
},
},
config = function(_, opts)
require("bufferline").setup(opts)
-- Fix bufferline when restoring a session
vim.api.nvim_create_autocmd("BufAdd", {
callback = function()
vim.schedule(function()
pcall(nvim_bufferline)
end)
end,
})
end,
}

3
lua/plugins/diffview.lua Normal file
View File

@@ -0,0 +1,3 @@
return {
"sindrets/diffview.nvim",
}

5
lua/plugins/disable.lua Normal file
View File

@@ -0,0 +1,5 @@
return {
{ "folke/flash.nvim", enabled = false },
{ "echasnovski/mini.pairs", enabled = false },
{ "folke/noice.nvim", enabled = false },
}

8
lua/plugins/hop.lua Normal file
View File

@@ -0,0 +1,8 @@
return {
"smoka7/hop.nvim",
version = "*",
vscode = true,
opts = {
keys = "etovxqpdygfblzhckisuran",
},
}

View File

@@ -0,0 +1,4 @@
return {
{ "mason-org/mason.nvim", version = "^1.0.0" },
{ "mason-org/mason-lspconfig.nvim", version = "^1.0.0" },
}

36
lua/plugins/neo-tree.lua Normal file
View File

@@ -0,0 +1,36 @@
return {
"nvim-neo-tree/neo-tree.nvim",
cmd = "Neotree",
keys = {
{
"<leader>fe",
function()
require("neo-tree.command").execute({ toggle = true, reveal = true, dir = LazyVim.root() })
end,
desc = "Explorer NeoTree (Root Dir)",
},
{
"<leader>fE",
function()
require("neo-tree.command").execute({ toggle = true, reveal = true, dir = vim.uv.cwd() })
end,
desc = "Explorer NeoTree (cwd)",
},
{ "<leader>e", "<leader>fe", desc = "Explorer NeoTree (Root Dir)", remap = true },
{ "<leader>E", "<leader>fE", desc = "Explorer NeoTree (cwd)", remap = true },
{
"<leader>ge",
function()
require("neo-tree.command").execute({ source = "git_status", toggle = true })
end,
desc = "Git Explorer",
},
{
"<leader>be",
function()
require("neo-tree.command").execute({ source = "buffers", toggle = true })
end,
desc = "Buffer Explorer",
},
},
}

View File

@@ -0,0 +1,5 @@
return {
"windwp/nvim-autopairs",
event = "InsertEnter",
opts = {}, -- this is equalent to setup({}) function
}

39
lua/plugins/nvim-cmp.lua Normal file
View File

@@ -0,0 +1,39 @@
return {
"hrsh7th/nvim-cmp",
---@param opts cmp.ConfigSchema
opts = function(_, opts)
local has_words_before = function()
unpack = unpack or table.unpack
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
local cmp = require("cmp")
opts.mapping = vim.tbl_extend("force", opts.mapping, {
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
-- You could replace select_next_item() with confirm({ select = true }) to get VS Code autocompletion behavior
cmp.select_next_item()
elseif vim.snippet.active({ direction = 1 }) then
vim.schedule(function()
vim.snippet.jump(1)
end)
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif vim.snippet.active({ direction = -1 }) then
vim.schedule(function()
vim.snippet.jump(-1)
end)
else
fallback()
end
end, { "i", "s" }),
})
end,
}

View File

@@ -0,0 +1,16 @@
-- surr*ound_words ysiw) (surround_words)
-- *make strings ys$" "make strings"
-- [delete ar*ound me!] ds] delete around me!
-- remove <b>HTML t*ags</b> dst remove HTML tags
-- 'change quot*es' cs'" "change quotes"
-- <b>or tag* types</b> csth1<CR> <h1>or tag types</h1>
-- delete(functi*on calls) dsf function calls
return {
"kylechui/nvim-surround",
version = "*", -- Use for stability; omit to use `main` branch for the latest features
event = "VeryLazy",
config = function()
require("nvim-surround").setup({
})
end,
}

25
lua/plugins/outline.lua Normal file
View File

@@ -0,0 +1,25 @@
return {
"hedyhli/outline.nvim",
keys = { { "<leader>cs", "<cmd>Outline<cr>", desc = "Toggle Outline" } },
cmd = "Outline",
opts = function()
local defaults = require("outline.config").defaults
local opts = {
symbols = {
icons = {},
filter = vim.deepcopy(LazyVim.config.kind_filter),
},
keymaps = {
up_and_jump = "<up>",
down_and_jump = "<down>",
},
}
for kind, symbol in pairs(defaults.symbols.icons) do
opts.symbols.icons[kind] = {
icon = LazyVim.config.icons.kinds[kind] or symbol.icon,
hl = symbol.hl,
}
end
return opts
end,
}

10
lua/plugins/theme.lua Normal file
View File

@@ -0,0 +1,10 @@
return {
{ "catppuccin/nvim", name = "catppuccin", priority = 1000, opts = { transparent_background = true } },
{ "projekt0n/github-nvim-theme", name = "github-theme", opts = {} },
{
"LazyVim/LazyVim",
opts = {
colorscheme = "catppuccin",
},
},
}