summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/mango/set.lua
blob: ddb49dc3f0f7aa65f6b5dc0540974a2a1ba32eae (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
49
50
51
52
53
54
55
56
57
58
59
60
61
local lib = require('mango.lib')
local api = vim.api
local opt = vim.opt
local glo = vim.g

local augroup = api.nvim_create_augroup('Mango', { clear = true })

opt.nu = true
opt.relativenumber = true

opt.exrc = true
opt.secure = true

opt.guifont = { 'Iosevka Smooth', ':h16' }

lib.set_tab_width(4)
opt.expandtab = false
opt.smartindent = true

opt.wrap = false

opt.swapfile = false
opt.backup = false
opt.undodir = os.getenv('XDG_STATE_HOME') .. '/nvim/undo'
opt.undofile = true

opt.hlsearch = true
opt.incsearch = true

opt.termguicolors = true

opt.scrolloff = 8
-- TODO: Research
-- opt.signcolumn = 'yes'
-- opt.isfname:append('@-@')

opt.updatetime = 50

opt.colorcolumn = '81'

opt.splitright = true
opt.splitbelow = true

-- Disable auto commenting
api.nvim_create_autocmd('BufEnter', {
	callback = function()
		opt.formatoptions:remove({ 'c', 'r', 'o' })
	end,
	group = augroup,
})

opt.foldmethod = 'expr'
opt.foldexpr = 'nvim_treesitter#foldexpr()'

api.nvim_create_autocmd('BufWinEnter', {
	command = 'normal zR',
	group = augroup,
})

-- This has to be done to enable linenumbers in netrw
glo.netrw_bufsettings = 'noma nomod nu nobl nowrap ro'