summaryrefslogtreecommitdiffstats
path: root/lua/core/auto.lua
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lua/core/auto.lua30
1 files changed, 0 insertions, 30 deletions
diff --git a/lua/core/auto.lua b/lua/core/auto.lua
deleted file mode 100644
index 170f2d7..0000000
--- a/lua/core/auto.lua
+++ /dev/null
@@ -1,30 +0,0 @@
-local function auto(event, opts)
- a.nvim_create_autocmd(event, opts)
-end
-
-a.nvim_create_augroup('bufcheck', { clear = true })
-
-auto('TextYankPost', { -- highlight yanks
- group = 'bufcheck',
- pattern = '*',
- desc = 'Highlight on yank.',
- callback = function()
- vim.highlight.on_yank{ timeout = 250 }
- end
-})
-
-auto('BufRead', { -- return to last place
- pattern = '*',
- command = [[call setpos(".", getpos("'\""))]],
- desc = 'Return to the last place the buffer was closed in.',
-})
-
-auto('BufWritePre', { -- make dirs when they don't exist
- pattern = '*',
- group = vim.api.nvim_create_augroup('auto_create_dir', { clear = true }),
- desc = 'Basically mkdir -p.',
- callback = function(ctx)
- local dir = vim.fn.fnamemodify(ctx.file, ':p:h')
- vim.fn.mkdir(dir, 'p')
- end
-})