summaryrefslogtreecommitdiff
path: root/lua/misc.lua
blob: bbf603b488806f4c811653e84167961a7291f2ea (plain)
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
local ct = require('conftool')

--
-- Encoding
--
-- ct.set({'encoding', 'utf-8'}, {'fileencoding', 'utf-8'})

--
-- Search
--
ct.set('wildmenu', 'incsearch', 'hlsearch')
vim.opt.backspace = 'indent,eol,start'

--
-- Folds
--
ct.augroup('AutoSaveFolds', {
		'BufWinLeave,BufLeave,BufWritePost',
		'?*', 'nested silent!',
		'mkview!'
	},{
		'BufWinEnter', '?*', 'silent!', 'loadview'
	}
)

--
-- Spell Checking
--
ct.set({'spelllang', {'en', 'cjk', 'id'}})
ct.set({'spellsuggest', {'best', 5}})
--
-- Netrw built-in file manager
--
vim.g.netrw_liststyle = 3 -- tree style display
vim.g.netrw_banner = 0 -- no banner needed
vim.g.netrw_browse_split = 0
-- vim.g.netrw_chgwin = 1

--
-- EtC.
--
-- vim.opt.clipboard = "unnamedplus"
vim.opt.compatible = false
vim.opt.autowrite = true
vim.opt.foldmethod = "indent"
vim.opt.foldlevelstart = 99
-- auto cd to the current file's location
vim.cmd('autocmd BufEnter * silent! lcd %:p:h')
-- highlighting for other langs in markdown docs
vim.g.markdown_fenced_languages = {'html', 'vim', 'python', 'c', 'bash=sh'}
-- auto close delimiters (eg. parentheses, brackets)