neovim-config/lua/misc.lua

52 lines
1.1 KiB
Lua

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)