summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYigit Sever2023-09-03 20:57:25 +0300
committerYigit Sever2023-09-03 20:57:25 +0300
commit45ce7dd6fe5872983ab27ba354391397a61809ef (patch)
tree7a351a6f1be4c365742aebba8a1fd6ee2b69fe6a
parentf69e8f3c3259460fe6842a951c8c4d2728a67f57 (diff)
downloaddotfiles-45ce7dd6fe5872983ab27ba354391397a61809ef.tar.gz
dotfiles-45ce7dd6fe5872983ab27ba354391397a61809ef.tar.bz2
dotfiles-45ce7dd6fe5872983ab27ba354391397a61809ef.zip
nvim: port autocmds
-rw-r--r--.config/nvim/init.lua2
-rw-r--r--.config/nvim/lua/helpers/autocmds.lua31
2 files changed, 33 insertions, 0 deletions
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua
index eacfbf4..b55e65a 100644
--- a/.config/nvim/init.lua
+++ b/.config/nvim/init.lua
@@ -11,5 +11,7 @@ require("core.keymaps")
11 11
12require("core.lazy") 12require("core.lazy")
13 13
14require("helpers.autocmds")
15
14-- I have to clean this 16-- I have to clean this
15require('helpers.stale').setup{} 17require('helpers.stale').setup{}
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})