diff options
| -rw-r--r-- | .config/nvim/lua/init/03-autocmds.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/.config/nvim/lua/init/03-autocmds.lua b/.config/nvim/lua/init/03-autocmds.lua index 01c6e4f..6025c00 100644 --- a/.config/nvim/lua/init/03-autocmds.lua +++ b/.config/nvim/lua/init/03-autocmds.lua @@ -1,6 +1,7 @@ local F = vim.fn local O = vim.o local vimrc = require('vimrc') +local my_env = require('vimrc.my_env') local A = vimrc.autocmd @@ -52,6 +53,18 @@ A('BufWritePre', { }) +A('BufEnter', { + desc = 'Set up *scratch* buffer', + pattern = my_env.scratch_dir .. '/*/*.*', + callback = function() + vim.b._scratch_ = true + if F.exists(':AutosaveEnable') == 2 then + vim.cmd('AutosaveEnable') + end + end, +}) + + vimrc.register_filetype_autocmds_for_indentation() -- TODO: move it elsewhere |
