-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
76 lines (69 loc) · 1.65 KB
/
init.lua
File metadata and controls
76 lines (69 loc) · 1.65 KB
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
if vim.env.PROF then
local snacks = vim.fn.stdpath "data" .. "/lazy/snacks.nvim"
vim.opt.rtp:append(snacks)
require("snacks.profiler").startup {
startup = {
event = "VimEnter",
},
}
end
require "config.lazy"
-- Editor options (grouped for clarity)
vim.opt.wrap = false
vim.opt.cmdheight = 0
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
vim.opt.expandtab = true
vim.opt.softtabstop = 2
vim.opt.fillchars:append { eob = " " }
vim.opt.termguicolors = true
vim.opt.listchars = { space = "·", tab = "->" }
vim.opt.list = true
-- Window options
vim.wo.number = true
vim.wo.relativenumber = true
-- Clipboard (set globally)
vim.opt.clipboard = "unnamed"
-- Diagnostics
vim.diagnostic.config {
virtual_lines = false,
}
-- Disable netrw (for nvim-tree)
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- Adjust padding on enter and load (use autocmd group)
local ui_group = vim.api.nvim_create_augroup("UIPadding", { clear = true })
vim.api.nvim_create_autocmd({ "UIEnter", "ColorScheme" }, {
group = ui_group,
callback = function()
local normal = vim.api.nvim_get_hl(0, { name = "Normal" })
if normal.bg then
io.write(string.format("\027]11;#%06x\027\\", normal.bg))
end
end,
})
vim.api.nvim_create_autocmd("UILeave", {
group = ui_group,
callback = function()
io.write "\027]111\027\\"
end,
})
vim.api.nvim_create_autocmd("FileType", {
pattern = {
"go",
"lua",
"python",
"bash",
"markdown",
"yaml",
"json",
"terraform",
"hcl",
"rust",
"javascript",
},
callback = function()
vim.treesitter.start()
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
end,
})