mirror of
https://github.com/tradecatlabs/vibe-coding-cn.git
synced 2026-08-14 11:28:05 +00:00
chore: migrate repository to standard knowledge base layout
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
-- 默认使用 LazyVim 自带的 tokyonight 主题
|
||||
-- 如果需要其他主题,可以在这里添加
|
||||
|
||||
return {
|
||||
-- 可以在这里添加其他主题插件
|
||||
-- 例如:
|
||||
-- {
|
||||
-- "folke/tokyonight.nvim",
|
||||
-- opts = {
|
||||
-- style = "moon", -- 可选: night, storm, moon, day
|
||||
-- },
|
||||
-- },
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
-- 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'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
-- 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",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
return {
|
||||
{
|
||||
"folke/snacks.nvim",
|
||||
opts = function(_, opts)
|
||||
-- ==================== 默认显示隐藏/被忽略文件 ====================
|
||||
-- LazyVim install_version=8 默认 picker/explorer 都优先走 Snacks,这里统一打开 hidden/ignored。
|
||||
opts.picker = opts.picker or {}
|
||||
opts.picker.sources = opts.picker.sources or {}
|
||||
|
||||
local sources = opts.picker.sources
|
||||
sources.files = vim.tbl_deep_extend("force", sources.files or {}, {
|
||||
hidden = true,
|
||||
ignored = true,
|
||||
})
|
||||
|
||||
sources.explorer = vim.tbl_deep_extend("force", sources.explorer or {}, {
|
||||
hidden = true,
|
||||
ignored = true,
|
||||
})
|
||||
|
||||
sources.grep = vim.tbl_deep_extend("force", sources.grep or {}, {
|
||||
hidden = true,
|
||||
ignored = true,
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
return {
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
opts = {
|
||||
filesystem = {
|
||||
filtered_items = {
|
||||
hide_dotfiles = false,
|
||||
hide_gitignored = false,
|
||||
-- 避免被默认规则额外隐藏(例如 .git 等)
|
||||
hide_by_name = {},
|
||||
hide_by_pattern = {},
|
||||
},
|
||||
},
|
||||
window = {
|
||||
position = "left",
|
||||
width = 30,
|
||||
mapping_options = {
|
||||
noremap = true,
|
||||
nowait = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("neo-tree").setup(opts)
|
||||
-- Neotree 打开逻辑已移到 autocmds.lua,这里不再重复
|
||||
end,
|
||||
},
|
||||
-- Telescope 默认不展示 dotfiles(以及可能被 .gitignore 忽略的文件),这里统一打开
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.pickers = opts.pickers or {}
|
||||
opts.pickers.find_files = vim.tbl_deep_extend("force", opts.pickers.find_files or {}, {
|
||||
hidden = true,
|
||||
no_ignore = true,
|
||||
no_ignore_parent = true,
|
||||
})
|
||||
|
||||
-- live_grep / grep_string 默认也包含 dotfiles(但仍遵循 ignore 规则,避免把 node_modules 等全扫进来)
|
||||
opts.defaults = opts.defaults or {}
|
||||
local telescope_defaults = require("telescope.config").values
|
||||
opts.defaults.vimgrep_arguments = vim.deepcopy(opts.defaults.vimgrep_arguments or telescope_defaults.vimgrep_arguments)
|
||||
if not vim.tbl_contains(opts.defaults.vimgrep_arguments, "--hidden") then
|
||||
table.insert(opts.defaults.vimgrep_arguments, "--hidden")
|
||||
end
|
||||
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,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user