This commit is contained in:
2025-06-17 22:33:09 +08:00
parent 956b146cb2
commit 0bde25e91d
28 changed files with 858 additions and 40 deletions

10
lua/boot/cmds.lua Normal file
View File

@ -0,0 +1,10 @@
-- ********** yank **********
vim.api.nvim_create_autocmd({ "TextYankPost" }, {
pattern = { "*" },
callback = function()
vim.highlight.on_yank({
timeout = 300,
})
end,
})

10
lua/boot/init.lua Normal file
View File

@ -0,0 +1,10 @@
require("boot.opts")
require("boot.cmds")
require("boot.maps")
require("boot.util")
require("boot.plug")

8
lua/boot/maps.lua Normal file
View File

@ -0,0 +1,8 @@
local map = vim.api.nvim_set_keymap
-- buffers
map("n", "<C-H>", ":bp<esc>", { desc = "buffer prev" })
map("n", "<C-L>", ":bn<esc>", { desc = "buffer next" })
map("i", "<C-H>", "<esc>:bp<esc>", { desc = "buffer prev" })
map("i", "<C-L>", "<esc>:bn<esc>", { desc = "buffer next" })

67
lua/boot/opts.lua Normal file
View File

@ -0,0 +1,67 @@
-- ********** leader **********
vim.g.mapleader = " "
-- ********** line number **********
vim.o.number = true
vim.o.relativenumber = true
-- ********** tab size **********
vim.o.tabstop = 4
vim.o.softtabstop = 4
vim.o.shiftwidth = 4
vim.o.expandtab = true
-- ********** encoding **********
vim.o.encoding = "utf-8"
-- vim.o.termencoding = "utf-8"
vim.o.fileencodings = "utf-8,gb2312,gbk,ucs-bom,cp936,latin-1"
-- ********** backup **********
vim.o.backup = false
vim.o.writebackup = false
vim.o.swapfile = false
-- ********** search **********
vim.o.hlsearch = true
vim.o.ignorecase = true
vim.o.incsearch = false
-- ********** display **********
-- blank chars
vim.o.list = true
vim.o.listchars = "space:·"
-- syntax
vim.o.syntax = "on"
vim.o.termguicolors = true
vim.o.cursorline = true
-- wrap
vim.o.wrap = false
-- fold
vim.o.foldenable = true
vim.o.foldcolumn = "1"
vim.o.foldlevel = 99
vim.o.foldmethod = "manual"
-- vim.o.foldmethod = "indent"
-- ********** clipboard **********
vim.o.clipboard = "unnamedplus"
-- ********** mouse **********
vim.o.mouse = "a"
-- ********** gui **********
if vim.fn.has("gui_running") then
vim.o.guifont = "FiraCode Nerd Font:h11"
if vim.fn.exists("g:neovide") then
-- Floating Shadow
vim.g.neovide_floating_shadow = true
vim.g.neovide_floating_z_height = 10
vim.g.neovide_light_angle_degrees = 45
vim.g.neovide_light_radius = 5
-- Transparency
vim.g.neovide_transparency = 0.8
end
end

15
lua/boot/plug.lua Normal file
View File

@ -0,0 +1,15 @@
if vim.fn.executable("git") == 1 then
if vim.fn.isdirectory(vim.fn.stdpath("data") .. "/lazy/lazy.nvim") == 0 then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
vim.fn.stdpath("data") .. "/lazy/lazy.nvim",
})
end
vim.opt.rtp:prepend(vim.fn.stdpath("data") .. "/lazy/lazy.nvim")
require("lazy").setup({ { import = "plug" } })
end

20
lua/boot/util.lua Normal file
View File

@ -0,0 +1,20 @@
local M = {
uv = vim.uv or vim.loop,
has = function(what)
return vim.fn.has(what) == 1
end,
executable = function(what)
return vim.fn.executable(what) == 1
end,
}
setmetatable(M, {
---@param key string
__index = function(_, key)
return require("util." .. key)
end,
})
_G.NeoVim = M