初始化dotfiles

This commit is contained in:
2026-06-18 11:36:12 +08:00
commit f4305709a5
37 changed files with 1540 additions and 0 deletions

73
nvim/init.lua Normal file
View File

@ -0,0 +1,73 @@
-- ============================================================================
-- Neovim 入口配置
-- ============================================================================
-- Leader 键
vim.g.mapleader = " "
-- ---------------------------------------------------------------------------
-- 编辑器选项
-- ---------------------------------------------------------------------------
local opt = vim.opt
opt.number = true -- 行号
opt.relativenumber = true -- 相对行号
opt.tabstop = 4 -- Tab 宽度
opt.shiftwidth = 4 -- 缩进宽度
opt.expandtab = true -- Tab 转空格
opt.smartindent = true -- 智能缩进
opt.wrap = false -- 不自动换行
opt.cursorline = true -- 高亮当前行
opt.signcolumn = "yes" -- 始终显示符号列
opt.updatetime = 250 -- 快速更新
opt.timeoutlen = 300 -- 快捷键超时
opt.splitright = true -- 垂直分屏在右侧
opt.splitbelow = true -- 水平分屏在下方
opt.undofile = true -- 持久化撤销
opt.ignorecase = true -- 搜索忽略大小写
opt.smartcase = true -- 智能大小写
opt.wildmenu = true -- 命令行补全增强
opt.wildmode = "longest:full,full"
opt.pumheight = 10 -- 补全菜单最大高度
opt.clipboard = "unnamedplus" -- 系统剪贴板
opt.termguicolors = true -- 真彩色支持
opt.foldlevel = 99 -- 默认展开所有折叠
-- 全局浮动窗口圆角边框(与 blink.cmp 补全菜单一致)
vim.o.winborder = "rounded"
-- ---------------------------------------------------------------------------
-- 基础键位
-- ---------------------------------------------------------------------------
local keymap = vim.keymap.set
-- 编辑器操作
keymap("n", "<leader>w", "<cmd>w<cr>", { desc = "保存" })
keymap("n", "<leader>q", "<cmd>q<cr>", { desc = "退出" })
keymap("n", "<leader>/", "<cmd>noh<cr>", { desc = "清除搜索高亮" })
-- 窗口导航
keymap("n", "<C-h>", "<C-w>h", { desc = "跳到左边窗口" })
keymap("n", "<C-j>", "<C-w>j", { desc = "跳到下面窗口" })
keymap("n", "<C-k>", "<C-w>k", { desc = "跳到上面窗口" })
keymap("n", "<C-l>", "<C-w>l", { desc = "跳到右边窗口" })
-- ---------------------------------------------------------------------------
-- lazy.nvim 插件管理器
-- ---------------------------------------------------------------------------
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.uv.fs_stat(lazypath) then
vim.fn.system({
"git", "clone", "--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
spec = { { import = "plugins" } },
defaults = { lazy = true },
install = { colorscheme = { "default" } },
checker = { enabled = false },
})