diff options
| author | nsfisis <nsfisis@gmail.com> | 2021-11-28 00:00:38 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2021-11-28 00:00:38 +0900 |
| commit | 5f6941aa610fcc82c34782ed140b83b4497fd048 (patch) | |
| tree | 0b36056c36db563c82694b055fd23f9ece0fd127 /.config/nvim/lua/vimrc.lua | |
| parent | b73d4c0bff913467628ecddd2b5ac9eb66f55118 (diff) | |
| download | dotfiles-5f6941aa610fcc82c34782ed140b83b4497fd048.tar.gz dotfiles-5f6941aa610fcc82c34782ed140b83b4497fd048.tar.zst dotfiles-5f6941aa610fcc82c34782ed140b83b4497fd048.zip | |
neovim: rewrite after/ftplugin/* in Lua
Diffstat (limited to '.config/nvim/lua/vimrc.lua')
| -rw-r--r-- | .config/nvim/lua/vimrc.lua | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/.config/nvim/lua/vimrc.lua b/.config/nvim/lua/vimrc.lua index 4520c5b..80a02bc 100644 --- a/.config/nvim/lua/vimrc.lua +++ b/.config/nvim/lua/vimrc.lua @@ -15,5 +15,31 @@ function vimrc.autocmd(event, filter, callback) end +local conf = {} +conf.SPACE = true +conf.TAB = false +function conf.indent(style, width) + vim.bo.expandtab = style + vim.bo.tabstop = width + vim.bo.shiftwidth = width + vim.bo.softtabstop = width + + if vim.fn.exists(':IndentLinesReset') == 2 then + vim.cmd('IndentLinesReset') + end +end + +function vimrc.after_ftplugin(ft, callback) + local var_name = 'did_ftplugin_' .. ft .. '_after' + if vim.b[var_name] ~= nil then + return + end + + callback(conf) + + vim.b[var_name] = true +end + + return vimrc |
