summaryrefslogtreecommitdiff
path: root/lua/misc.lua
diff options
context:
space:
mode:
authorIan Griffin <migriffin@disroot.org>2022-09-30 20:06:55 +0800
committerIan Griffin <migriffin@disroot.org>2022-09-30 20:06:55 +0800
commit0e1bf5aad478a4030f31acd8bbea874b71e42f43 (patch)
treeb31312df0273548387a613ff2f4e00bc6828b379 /lua/misc.lua
initial commit
Diffstat (limited to 'lua/misc.lua')
-rw-r--r--lua/misc.lua70
1 files changed, 70 insertions, 0 deletions
diff --git a/lua/misc.lua b/lua/misc.lua
new file mode 100644
index 0000000..add8984
--- /dev/null
+++ b/lua/misc.lua
@@ -0,0 +1,70 @@
+local ct = require('conftool')
+local pk_use = require('packer').use
+
+--
+-- 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}})
+
+--
+-- Focus Mode
+--
+pk_use {
+ 'junegunn/goyo.vim',
+ cmd = 'Goyo'
+}
+
+--
+-- Multi-cursor
+--
+pk_use {
+ 'mg979/vim-visual-multi',
+ keys = {"<C-Up>", "<C-Down>"}
+}
+
+--
+-- 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 = 4
+vim.g.netrw_winsize = 15 -- small window size
+vim.g.netrw_chgwin = 1
+
+--
+-- EtC.
+--
+vim.opt.compatible = false
+vim.opt.autowrite = true
+-- 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)
+pk_use 'Raimondi/delimitMate'
+
+