Skip to content

Commit e67ff18

Browse files
committed
简化配置,去掉 nvchad
1 parent 13dd36f commit e67ff18

37 files changed

+1292
-1460
lines changed

.stylua.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ line_endings = "Unix"
33
indent_type = "Spaces"
44
indent_width = 2
55
quote_style = "AutoPreferDouble"
6-
call_parentheses = "None"

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# NVIM IDE
22

3-
使用 [NvChad](https://github.com/NvChad/NvChad) 做为基础配置, `NvChad` 基础配置和快捷建未做修改, 建议先阅读 `NvChad` 相关的文档。
4-
主要添加了 `Java`, `Python`, `Rust` 语言的 `LSP`, `DAP` 配置
3+
支持 `Java`, `Python`, `Rust` 语言的 `LSP`, `DAP` 配置
54

65
## 安装
76

colors/gruvboxl.lua

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
-- 使用 morhetz/gruvbox
2+
-- nvchad
3+
local dark0_hard = "#1d2021"
4+
local dark0 = "#282828"
5+
local dark0_soft = "#32302f"
6+
local dark1 = "#3c3836"
7+
local dark2 = "#504945"
8+
local dark3 = "#665c54"
9+
local dark4 = "#7c6f64"
10+
local dark4_256 = "#7c6f64"
11+
12+
local dark_ext0 = "#4e4e4e"
13+
local dark_ext1 = "#2e2e2e"
14+
local dark_ext2 = "#2c2c2c"
15+
local dark_ext3 = "#4b4b4b"
16+
local gray_ext0 = "#656565"
17+
18+
local gray_245 = "#928374"
19+
local gray_244 = "#928374"
20+
21+
local light0_hard = "#f9f5d7"
22+
local light0 = "#fbf1c7"
23+
local light0_soft = "#f2e5bc"
24+
local light1 = "#ebdbb2"
25+
local light2 = "#d5c4a1"
26+
local light3 = "#bdae93"
27+
local light4 = "#a89984"
28+
local light4_256 = "#a89984"
29+
30+
local bright_red = "#fb4934"
31+
local bright_green = "#b8bb26"
32+
local bright_yellow = "#fabd2f"
33+
local bright_blue = "#83a598"
34+
local bright_purple = "#d3869b"
35+
local bright_aqua = "#8ec07c"
36+
local bright_orange = "#fe8019"
37+
38+
local neutral_red = "#cc241d"
39+
local neutral_green = "#98971a"
40+
local neutral_yellow = "#d79921"
41+
local neutral_blue = "#458588"
42+
local neutral_purple = "#b16286"
43+
local neutral_aqua = "#689d6a"
44+
local neutral_orange = "#d65d0e"
45+
46+
local faded_red = "#9d0006"
47+
local faded_green = "#79740e"
48+
local faded_yellow = "#b57614"
49+
local faded_blue = "#076678"
50+
local faded_purple = "#8f3f71"
51+
local faded_aqua = "#427b58"
52+
local faded_orange = "#af3a03"
53+
54+
-- 设置高亮
55+
local function hl(theme)
56+
for k, v in pairs(theme) do
57+
vim.api.nvim_set_hl(0, k, v)
58+
end
59+
end
60+
-- 基础颜色
61+
hl({
62+
NvimLightGrey2 = { fg = light2 },
63+
64+
Normal = { fg = light2, bg = dark0 },
65+
CursorLine = { bg = dark_ext1 },
66+
WildMenu = { fg = bright_red, bg = bright_yellow },
67+
68+
WinSeparator = { fg = dark_ext3 },
69+
Pmenu = { fg = light2, bg = dark0 },
70+
PmenuSel = { fg = dark0, bg = bright_blue },
71+
PmenuMatch = { bold = true },
72+
PmenuMatchSel = { bold = true },
73+
PmenuKind = { link = "Pmenu" },
74+
PmenuKindSel = { link = "PmenuSel" },
75+
PmenuExtra = { link = "Pmenu" },
76+
PmenuExtraSel = { link = "PmenuSel" },
77+
PmenuSbar = { bg = "#353535" },
78+
PmenuThumb = { bg = dark_ext3 },
79+
80+
NormalFloat = {},
81+
FloatBorder = { fg = dark_ext0 },
82+
StatusLine = { bg = dark_ext2 },
83+
Directory = { fg = bright_blue },
84+
Title = { fg = bright_blue, bold = true },
85+
Question = { fg = bright_blue },
86+
Search = { fg = dark1, bg = bright_yellow },
87+
88+
MoreMsg = { fg = bright_green },
89+
ModeMsg = { fg = bright_green },
90+
ErrorMsg = { fg = bright_red, bg = dark0 },
91+
WarningMsg = { fg = bright_yellow },
92+
93+
DiffAdd = { fg = dark0, bg = bright_green },
94+
DiffChange = { fg = dark0, bg = bright_aqua },
95+
DiffDelete = { fg = dark0, bg = bright_red },
96+
DiffText = { fg = dark0, bg = bright_yellow },
97+
98+
LineNr = { fg = dark_ext3 },
99+
100+
Type = { fg = bright_yellow },
101+
PreProc = { fg = bright_yellow },
102+
Include = { fg = bright_blue },
103+
Function = { fg = bright_blue },
104+
Comment = { fg = gray_ext0, italic = true },
105+
String = { fg = bright_green },
106+
Statement = { fg = bright_red },
107+
Constant = { fg = bright_red },
108+
Special = { fg = bright_aqua },
109+
Operator = { fg = bright_blue },
110+
Delimiter = { fg = neutral_orange },
111+
Identifier = { fg = bright_red },
112+
113+
Visual = { bg = "#423e3c" },
114+
115+
DiagnosticError = { fg = bright_red },
116+
DiagnosticInfo = { fg = bright_green },
117+
DiagnosticHint = { fg = "#b4bbc8" },
118+
DiagnosticWarn = { fg = neutral_yellow },
119+
120+
ColorColumn = { bg = dark_ext1 },
121+
})
122+
123+
-- LSP
124+
hl({
125+
["@variable"] = { fg = light2 },
126+
["@variable.member"] = { fg = bright_red },
127+
["@punctuation.delimiter"] = { fg = neutral_orange },
128+
["@keyword.operator"] = { fg = bright_purple },
129+
["@keyword.exception"] = { fg = bright_red },
130+
131+
["@markup"] = { link = "Special" },
132+
["@markup.strong"] = { bold = true },
133+
["@markup.italic"] = { italic = true },
134+
["@markup.strikethrough"] = { strikethrough = true },
135+
["@markup.underline"] = { underline = true },
136+
["@markup.heading"] = { fg = bright_blue },
137+
["@markup.link"] = { fg = bright_red },
138+
139+
["@markup.quote"] = { bg = dark_ext1 },
140+
["@markup.list"] = { fg = bright_red },
141+
["@markup.link.label"] = { fg = bright_aqua },
142+
["@markup.link.url"] = { underline = true, fg = bright_orange },
143+
["@markup.raw"] = { fg = bright_orange },
144+
145+
LspReferenceWrite = { fg = "#e78a4e" },
146+
LspReferenceText = { fg = "#e78a4e" },
147+
})
148+
149+
hl({
150+
NvimTreeGitNew = { fg = neutral_yellow },
151+
NvimTreeFolderIcon = { fg = "#749689" },
152+
NvimTreeSpecialFile = { fg = neutral_yellow, bold = true },
153+
NvimTreeIndentMarker = { fg = "#313334" },
154+
})
155+
156+
hl({
157+
158+
Added = { fg = bright_green },
159+
Removed = { fg = bright_red },
160+
Changed = { fg = neutral_yellow },
161+
162+
diffChanged = { fg = neutral_yellow },
163+
diffAdded = { fg = bright_green },
164+
})
165+
166+
hl({
167+
BlinkCmpMenuBorder = { link = "FloatBorder" },
168+
BlinkCmpDocBorder = { link = "FloatBorder" },
169+
})

ftplugin/java.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
vim.bo.shiftwidth = 4
2+
vim.bo.tabstop = 4
3+
vim.bo.softtabstop = 4
4+
print("hello")

ftplugin/json.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vim.bo.formatprg = "jq ."

ftplugin/lua.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print("hello")

init.lua

Lines changed: 70 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,81 @@
1-
vim.g.base46_cache = vim.fn.stdpath "data" .. "/base46/"
1+
vim.opt_global.encoding = "UTF-8"
2+
vim.opt.fileencoding = "UTF-8"
23
vim.g.mapleader = " "
4+
vim.g.maplocalleader = " "
5+
local g = vim.g
6+
g.loaded_node_provider = 0
7+
g.loaded_python3_provider = 0
8+
g.loaded_perl_provider = 0
9+
g.loaded_ruby_provider = 0
310

4-
vim.cmd [[
5-
augroup kide_clearjumps
6-
autocmd!
7-
autocmd VimEnter * :clearjumps
8-
augroup END
9-
]]
11+
-- 禁用内置插件
12+
g.loaded_tohtml_plugin = 1
1013

11-
-- bootstrap lazy and all plugins
12-
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
14+
g.loaded_netrw = 1
15+
g.loaded_netrwPlugin = 1
1316

14-
if not vim.loop.fs_stat(lazypath) then
15-
local repo = "https://github.com/folke/lazy.nvim.git"
16-
vim.fn.system { "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath }
17-
end
17+
vim.opt_global.grepprg = "rg --vimgrep --no-heading --smart-case"
18+
vim.opt_global.grepformat = "%f:%l:%c:%m,%f:%l:%m"
1819

19-
vim.opt.rtp:prepend(lazypath)
20+
local x = vim.diagnostic.severity
21+
vim.diagnostic.config({
22+
virtual_text = { prefix = "" },
23+
signs = { text = { [x.ERROR] = "󰅙", [x.WARN] = "", [x.INFO] = "󰋼", [x.HINT] = "󰌵" } },
24+
float = {
25+
border = "rounded",
26+
},
27+
})
2028

21-
local lazy_config = require "configs.lazy"
29+
vim.g.nvim_jdtls = 1
30+
if vim.g.neovide then
31+
vim.g.neovide_cursor_vfx_mode = "railgun"
32+
vim.opt_global.guifont = "CaskaydiaCove Nerd Font Mono:h15"
33+
vim.g.neovide_fullscreen = true
34+
vim.g.transparency = 1.0
35+
local alpha = function()
36+
return string.format("%x", math.floor(255 * (vim.g.transparency or 0.8)))
37+
end
38+
-- g:neovide_transparency should be 0 if you want to unify transparency of content and title bar.
39+
vim.g.neovide_transparency = 1.0
40+
vim.g.neovide_background_color = "#282828" .. alpha()
2241

23-
-- load plugins
24-
require("lazy").setup({
25-
{
26-
"NvChad/NvChad",
27-
lazy = false,
28-
branch = "v2.5",
29-
import = "nvchad.plugins",
30-
config = function()
31-
require "options"
32-
end,
33-
},
42+
vim.g.neovide_floating_blur_amount_x = 2.0
43+
vim.g.neovide_floating_blur_amount_y = 2.0
3444

35-
{ import = "plugins" },
36-
}, lazy_config)
45+
vim.g.neovide_hide_mouse_when_typing = true
3746

38-
-- load theme
39-
dofile(vim.g.base46_cache .. "defaults")
40-
dofile(vim.g.base46_cache .. "statusline")
47+
vim.g.neovide_profiler = false
48+
vim.g.neovide_padding_top = 0
49+
vim.g.neovide_padding_bottom = 0
50+
vim.g.neovide_padding_right = 0
51+
vim.g.neovide_padding_left = 0
52+
end
4153

42-
require "nvchad.autocmds"
54+
-- Bootstrap lazy.nvim
55+
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
56+
if not (vim.uv or vim.loop).fs_stat(lazypath) then
57+
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
58+
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
59+
if vim.v.shell_error ~= 0 then
60+
vim.api.nvim_echo({
61+
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
62+
{ out, "WarningMsg" },
63+
{ "\nPress any key to exit..." },
64+
}, true, {})
65+
vim.fn.getchar()
66+
os.exit(1)
67+
end
68+
end
69+
vim.opt.rtp:prepend(lazypath)
70+
require("lazy").setup({
71+
spec = {
72+
{ import = "plugins" },
73+
},
74+
install = { colorscheme = { "gruvbox" } },
75+
checker = { enabled = false },
76+
})
4377

44-
vim.schedule(function()
45-
require "mappings"
46-
end)
47-
require "kide"
78+
vim.cmd.colorscheme("gruvboxl")
79+
require("options")
80+
require("mappings")
81+
require("autocmds")

0 commit comments

Comments
 (0)