refactor: Remove libs directory

This commit is contained in:
tukuaiai
2025-12-18 13:22:45 +08:00
parent 8487ece766
commit 21aa110e95
639 changed files with 1 additions and 110809 deletions
@@ -1,25 +0,0 @@
-- Autocmds are automatically loaded on the VeryLazy event
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
--
-- Add any additional autocmds here
-- with `vim.api.nvim_create_autocmd`
--
-- Or remove existing autocmds by their group name (which is prefixed with `lazyvim_` for the defaults)
-- e.g. vim.api.nvim_del_augroup_by_name("lazyvim_wrap_spell")
-- 自动打开Neotree(使用标准LazyVim方式)
vim.api.nvim_create_autocmd("VimEnter", {
callback = function()
-- 延迟执行,确保插件加载完成
vim.defer_fn(function()
vim.cmd("Neotree show")
end, 50)
end,
})
-- 确保bufferline始终显示
vim.api.nvim_create_autocmd("VimEnter", {
callback = function()
vim.o.showtabline = 2
end,
})
@@ -1,3 +0,0 @@
-- 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
-55
View File
@@ -1,55 +0,0 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
spec = {
-- add LazyVim and import its plugins
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
-- import/override with your plugins
{ import = "plugins" },
},
defaults = {
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
lazy = false,
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
-- have outdated releases, which may break your Neovim install.
version = false, -- always use the latest git commit
-- version = "*", -- try installing the latest stable version for plugins that support semver
},
install = { colorscheme = { "tokyonight", "habamax" } },
checker = {
enabled = true, -- check for plugin updates periodically
notify = false, -- notify on update
}, -- automatically check for plugin updates
performance = {
rtp = {
-- disable some rtp plugins
disabled_plugins = {
"gzip",
-- "matchit",
-- "matchparen",
-- "netrwPlugin",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
})
-- 使用默认的tokyonight主题(LazyVim默认主题)
-- 不需要手动设置,LazyVim会自动加载
@@ -1,3 +0,0 @@
-- Options are automatically loaded before lazy.nvim startup
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
-- Add any additional options here
@@ -1,13 +0,0 @@
-- 默认使用 LazyVim 自带的 tokyonight 主题
-- 如果需要其他主题,可以在这里添加
return {
-- 可以在这里添加其他主题插件
-- 例如:
-- {
-- "folke/tokyonight.nvim",
-- opts = {
-- style = "moon", -- 可选: night, storm, moon, day
-- },
-- },
}
@@ -1,34 +0,0 @@
-- Dracula 主题插件配置
return {
{
'Mofiqul/dracula.nvim',
name = 'dracula',
lazy = false,
priority = 1000,
config = function()
-- 获取主题配置
local dracula_config = require('themes.dracula')
-- 从环境变量或默认值获取样式
local style = vim.env.NVIM_THEME_STYLE or 'dracula'
-- 设置主题
require('dracula').setup(dracula_config.config(style))
-- 应用主题
vim.cmd.colorscheme('dracula')
end,
},
-- Lualine 主题集成
{
'nvim-lualine/lualine.nvim',
dependencies = { 'dracula' },
opts = {
options = {
theme = 'dracula-nvim'
}
}
}
}
@@ -1,197 +0,0 @@
-- since this is just an example spec, don't actually load anything here and return an empty spec
-- stylua: ignore
if true then return {} end
-- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim
--
-- In your plugin files, you can:
-- * add extra plugins
-- * disable/enabled LazyVim plugins
-- * override the configuration of LazyVim plugins
return {
-- add gruvbox
{ "ellisonleao/gruvbox.nvim" },
-- Configure LazyVim to load gruvbox
{
"LazyVim/LazyVim",
opts = {
colorscheme = "gruvbox",
},
},
-- change trouble config
{
"folke/trouble.nvim",
-- opts will be merged with the parent spec
opts = { use_diagnostic_signs = true },
},
-- disable trouble
{ "folke/trouble.nvim", enabled = false },
-- override nvim-cmp and add cmp-emoji
{
"hrsh7th/nvim-cmp",
dependencies = { "hrsh7th/cmp-emoji" },
---@param opts cmp.ConfigSchema
opts = function(_, opts)
table.insert(opts.sources, { name = "emoji" })
end,
},
-- change some telescope options and a keymap to browse plugin files
{
"nvim-telescope/telescope.nvim",
keys = {
-- add a keymap to browse plugin files
-- stylua: ignore
{
"<leader>fp",
function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end,
desc = "Find Plugin File",
},
},
-- change some options
opts = {
defaults = {
layout_strategy = "horizontal",
layout_config = { prompt_position = "top" },
sorting_strategy = "ascending",
winblend = 0,
},
},
},
-- add pyright to lspconfig
{
"neovim/nvim-lspconfig",
---@class PluginLspOpts
opts = {
---@type lspconfig.options
servers = {
-- pyright will be automatically installed with mason and loaded with lspconfig
pyright = {},
},
},
},
-- add tsserver and setup with typescript.nvim instead of lspconfig
{
"neovim/nvim-lspconfig",
dependencies = {
"jose-elias-alvarez/typescript.nvim",
init = function()
require("lazyvim.util").lsp.on_attach(function(_, buffer)
-- stylua: ignore
vim.keymap.set( "n", "<leader>co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" })
vim.keymap.set("n", "<leader>cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer })
end)
end,
},
---@class PluginLspOpts
opts = {
---@type lspconfig.options
servers = {
-- tsserver will be automatically installed with mason and loaded with lspconfig
tsserver = {},
},
-- you can do any additional lsp server setup here
-- return true if you don't want this server to be setup with lspconfig
---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
setup = {
-- example to setup with typescript.nvim
tsserver = function(_, opts)
require("typescript").setup({ server = opts })
return true
end,
-- Specify * to use this function as a fallback for any server
-- ["*"] = function(server, opts) end,
},
},
},
-- for typescript, LazyVim also includes extra specs to properly setup lspconfig,
-- treesitter, mason and typescript.nvim. So instead of the above, you can use:
{ import = "lazyvim.plugins.extras.lang.typescript" },
-- add more treesitter parsers
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = {
"bash",
"html",
"javascript",
"json",
"lua",
"markdown",
"markdown_inline",
"python",
"query",
"regex",
"tsx",
"typescript",
"vim",
"yaml",
},
},
},
-- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above
-- would overwrite `ensure_installed` with the new value.
-- If you'd rather extend the default config, use the code below instead:
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
-- add tsx and treesitter
vim.list_extend(opts.ensure_installed, {
"tsx",
"typescript",
})
end,
},
-- the opts function can also be used to change the default opts:
{
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
opts = function(_, opts)
table.insert(opts.sections.lualine_x, {
function()
return "😄"
end,
})
end,
},
-- or you can return new options to override all the defaults
{
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
opts = function()
return {
--[[add your custom lualine config here]]
}
end,
},
-- use mini.starter instead of alpha
{ import = "lazyvim.plugins.extras.ui.mini-starter" },
-- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc
{ import = "lazyvim.plugins.extras.lang.json" },
-- add any tools you want to have installed below
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"stylua",
"shellcheck",
"shfmt",
"flake8",
},
},
},
}
-70
View File
@@ -1,70 +0,0 @@
return {
{
"nvim-neo-tree/neo-tree.nvim",
opts = {
filesystem = {
filtered_items = {
hide_dotfiles = false,
hide_gitignored = false,
},
},
window = {
position = "left",
width = 30,
mapping_options = {
noremap = true,
nowait = true,
},
},
},
config = function(_, opts)
require("neo-tree").setup(opts)
-- Neotree 打开逻辑已移到 autocmds.lua,这里不再重复
end,
},
{
"akinsho/bufferline.nvim",
event = "VeryLazy",
opts = {
options = {
mode = "buffers", -- set to "tabs" to only show tabpages instead
numbers = "ordinal",
close_command = function(bufnr) vim.api.nvim_buf_delete(bufnr, { force = true }) end,
right_mouse_command = function(bufnr) vim.api.nvim_buf_delete(bufnr, { force = true }) end,
left_mouse_command = "buffer",
middle_mouse_command = nil,
indicator = {
style = "icon",
icon = "",
},
buffer_close_icon = "󰅖",
modified_icon = "",
close_icon = "",
left_trunc_marker = "",
right_trunc_marker = "",
max_name_length = 18,
max_prefix_length = 15,
tab_size = 18,
truncate_names = true,
color_icons = true,
show_buffer_icons = true,
show_buffer_close_icons = true,
show_close_icon = true,
show_tab_indicators = true,
persist_buffer_sort = true,
separator_style = "thin",
enforce_regular_tabs = false,
always_show_bufferline = true,
hover = {
enabled = true,
delay = 200,
reveal = {'close'}
},
sort_by = 'insert_after_current',
},
},
config = function(_, opts)
require("bufferline").setup(opts)
end,
},
}
@@ -1,60 +0,0 @@
-- Dracula 主题配置
-- 支持多种变体: dracula, dracula-soft, day
local M = {}
M.config = function(style)
local opts = {
-- 主题变体: dracula, dracula-soft, day
theme = style or 'dracula',
-- 透明背景
transparent_bg = false,
-- 斜体注释
italic_comment = true,
-- 显示文件末尾的 ~ 符号
show_end_of_buffer = true,
-- Lualine 背景色
lualine_bg_color = '#44475a',
}
-- 高级自定义选项(可选)
if style == 'soft' then
opts.colors = {
-- 更柔和的背景色
bg = '#21222c',
fg = '#f8f8f2',
}
elseif style == 'day' then
opts.colors = {
-- 浅色主题配色
bg = '#f8f8f2',
fg = '#282a36',
}
end
return opts
end
-- 主题信息
M.info = {
name = 'dracula',
plugin = 'Mofiqul/dracula.nvim',
variants = {
{ name = 'dracula', desc = '经典深色主题' },
{ name = 'dracula-soft', desc = '柔和深色主题' },
{ name = 'day', desc = '浅色主题' },
},
features = {
'支持透明背景',
'斜体注释',
'完整的 LSP 和 Treesitter 支持',
'Lualine 主题集成',
'多插件支持(Telescope, NvimTree 等)',
}
}
return M