-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathinit.lua
100 lines (89 loc) · 3.01 KB
/
init.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
-- 清理 jumps 列表,防止跳转整到其他项目
vim.cmd([[
augroup kide_clearjumps
autocmd!
autocmd VimEnter * :clearjumps
augroup END
]])
vim.opt_global.jumpoptions = "stack"
vim.opt_global.encoding = "UTF-8"
vim.opt.fileencoding = "UTF-8"
vim.g.mapleader = " "
vim.g.maplocalleader = " "
local g = vim.g
g.loaded_node_provider = 0
g.loaded_python3_provider = 0
g.loaded_perl_provider = 0
g.loaded_ruby_provider = 0
-- 禁用内置插件
g.loaded_tohtml_plugin = 1
g.loaded_netrw = 1
g.loaded_netrwPlugin = 1
vim.opt_global.grepprg = "rg --vimgrep --no-heading --smart-case"
vim.opt_global.grepformat = "%f:%l:%c:%m,%f:%l:%m"
local x = vim.diagnostic.severity
vim.diagnostic.config({
virtual_text = { prefix = "" },
signs = { text = { [x.ERROR] = "", [x.WARN] = "", [x.INFO] = "", [x.HINT] = "" } },
float = {
border = "rounded",
},
})
vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "Debug", linehl = "", numhl = "" })
vim.fn.sign_define("DapBreakpointCondition", { text = "", texthl = "Debug", linehl = "", numhl = "" })
vim.fn.sign_define("DapLogPoint", { text = "", texthl = "Debug", linehl = "", numhl = "" })
vim.fn.sign_define("DapStopped", { text = "", texthl = "Debug", linehl = "", numhl = "" })
vim.fn.sign_define("DapBreakpointRejected", { text = "", texthl = "Debug", linehl = "", numhl = "" })
if vim.g.neovide then
vim.g.neovide_cursor_vfx_mode = "railgun"
vim.opt_global.guifont = "CaskaydiaCove Nerd Font Mono:h15"
vim.g.neovide_fullscreen = true
vim.g.transparency = 1.0
local alpha = function()
return string.format("%x", math.floor(255 * (vim.g.transparency or 0.8)))
end
-- g:neovide_transparency should be 0 if you want to unify transparency of content and title bar.
vim.g.neovide_transparency = 1.0
vim.g.neovide_background_color = "#282828" .. alpha()
vim.g.neovide_floating_blur_amount_x = 2.0
vim.g.neovide_floating_blur_amount_y = 2.0
vim.g.neovide_hide_mouse_when_typing = true
vim.g.neovide_profiler = false
vim.g.neovide_padding_top = 0
vim.g.neovide_padding_bottom = 0
vim.g.neovide_padding_right = 0
vim.g.neovide_padding_left = 0
end
require("options")
-- Bootstrap lazy.nvim
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({
defaults = {
lazy = false,
},
spec = {
{ import = "plugins" },
},
install = { colorscheme = { "gruvboxl" } },
checker = { enabled = false },
rocks = {
enabled = false,
},
})
vim.cmd.colorscheme("gruvboxl")
require("mappings")
require("autocmds")