Summary Files Commits Branches @commit @diff @stats
path: root / lua / text.lua
blob: 6a950955552ce5a21402fa3cb06ad0011bed9a7e (plain) (blame)
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
--[=[ Treesitter ]=]--

vim.cmd.highlight({ "link", "@variable", "GruvboxFg1" })
vim.cmd.highlight({ "link", "@operator", "GruvboxOrange" })

--[=[ Search ]=]--

vim.o.hlsearch = false -- No highlighting when searching

--[=[ Cursor ]=]--

vim.o.scrolloff = 5    -- Lines above and below cursor
vim.o.showmatch = true -- Jump to opening brace when having typed closing one

vim.o.cursorline = true
vim.api.nvim_create_autocmd({ "InsertLeave", "BufEnter" }, {
	command = "set cul"
})
vim.api.nvim_create_autocmd({ "InsertEnter", "BufLeave" }, {
	command = "set nocul"
})

--[=[ Characters ]=]--

vim.o.list = true
vim.opt.listchars = { tab = "│ ", extends = ">", precedes = "<" }

vim.o.tabstop    = 4 -- Show tab as 4 spaces
vim.o.shiftwidth = 4 -- Indent with 4 spaces

--[=[ Windows ]=]--

vim.o.splitbelow = true
vim.o.splitright = true
vim.api.nvim_create_autocmd({ "BufEnter" }, { callback = function (ev)
	if vim.bo.buftype == "terminal" then
		vim.cmd("startinsert")
		vim.wo.number = false
	end
end })

vim.o.number = true
vim.o.signcolumn = "number"

--[=[ History ]=]--

vim.o.undofile = true
vim.o.undodir  = vim.fn.expand("~/nvim/undo")