summaryrefslogtreecommitdiffstats
path: root/.config/nvim/lua
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/lua')
-rw-r--r--.config/nvim/lua/helpers/autocmds.lua31
1 files changed, 31 insertions, 0 deletions
diff --git a/.config/nvim/lua/helpers/autocmds.lua b/.config/nvim/lua/helpers/autocmds.lua
new file mode 100644
index 0000000..b57f64e
--- /dev/null
+++ b/.config/nvim/lua/helpers/autocmds.lua
@@ -0,0 +1,31 @@
1local function augroup(name)
2 return vim.api.nvim_create_augroup("custom_" .. name, {})
3end
4
5vim.api.nvim_create_autocmd("FileType", {
6 group = augroup("use_sentences"),
7 pattern = {
8 "vimwiki",
9 "latex",
10 "tex",
11 },
12 callback = function()
13 vim.bo.formatprg = "/home/yigit/.local/bin/sentences"
14 end,
15})
16
17vim.api.nvim_create_autocmd("VimLeave", {
18 group = augroup("tex_clear"),
19 pattern = {
20 '*.tex',
21 },
22 command = "!textclear %",
23})
24
25vim.api.nvim_create_autocmd("VimResized", {
26 group = augroup("sane_windows"),
27 pattern = {
28 '*.*',
29 },
30 command = "wincmd =",
31})