-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoptions.lua
More file actions
36 lines (30 loc) · 986 Bytes
/
options.lua
File metadata and controls
36 lines (30 loc) · 986 Bytes
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
-- ===== Indent / Tabs (native) =====
vim.opt.expandtab = true -- spaces > tabs
vim.opt.smarttab = true
vim.opt.autoindent = true
vim.opt.smartindent = true
vim.opt.tabstop = 2 -- display width of a tab
vim.opt.shiftwidth = 2 -- << and >> size
vim.opt.softtabstop = 2 -- <Tab> inserts this many spaces
-- Nice behavior
vim.opt.shiftround = true -- round indent to multiples of shiftwidth
vim.opt.breakindent = true
vim.opt.wrap = false
vim.opt.number = true
vim.opt.relativenumber = true
vim.api.nvim_create_autocmd("FileType", {
pattern = "python",
callback = function()
vim.opt_local.shiftwidth = 4
vim.opt_local.tabstop = 4
vim.opt_local.softtabstop = 4
end,
})
vim.api.nvim_create_autocmd("FileType", {
pattern = { "lua", "javascript", "typescript", "json", "html", "css", "python", "bash" },
callback = function()
vim.opt_local.shiftwidth = 2
vim.opt_local.tabstop = 2
vim.opt_local.softtabstop = 2
end,
})