-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.lua
59 lines (51 loc) · 1.43 KB
/
options.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
require "nvchad.options"
vim.cmd.set "nowrap"
vim.cmd.set "shiftwidth=0"
vim.opt.scrolloff = 15
local listchars = "tab:\\ \\ ,trail:·"
vim.cmd.set("listchars=" .. listchars)
vim.cmd.set "list"
-- AutoFormating Toggle
vim.api.nvim_create_user_command("FormatDisable", function(args)
if args.bang then
-- FormatDisable! will disable formatting just for this buffer
vim.b.disable_autoformat = true
else
vim.g.disable_autoformat = true
end
end, {
desc = "Disable autoformat-on-save",
bang = true,
})
vim.api.nvim_create_user_command("FormatEnable", function()
vim.b.disable_autoformat = false
vim.g.disable_autoformat = false
end, {
desc = "Re-enable autoformat-on-save",
})
-- Indentation by Filetype
vim.api.nvim_create_autocmd("FileType", {
pattern = "cs",
callback = function()
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
end,
})
vim.api.nvim_create_autocmd("FileType", {
pattern = "gdscript",
callback = function()
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.cmd.set "noexpandtab"
vim.cmd.set("listchars=eol:↴," .. listchars)
end,
})
vim.o.cursorlineopt = "both"
vim.cmd.set "guicursor=n-v-c:block-Cursor/lCursor,i-ci-ve:block-blinkwait700-blinkoff400-blinkon250-Cursor/lCursor,r-cr:hor20,o:hor50"
-- vim.api.nvim_create_autocmd("ModeChanged", {
-- callback = function()
-- if vim.fn.mode() == "n" then
-- vim.api.nvim_get_hl_by_name "hola"
-- end
-- end,
-- })