diff options
| author | Yigit Sever | 2023-09-03 20:57:25 +0300 |
|---|---|---|
| committer | Yigit Sever | 2023-09-03 20:57:25 +0300 |
| commit | 45ce7dd6fe5872983ab27ba354391397a61809ef (patch) | |
| tree | 7a351a6f1be4c365742aebba8a1fd6ee2b69fe6a /.config/nvim/lua/helpers/autocmds.lua | |
| parent | f69e8f3c3259460fe6842a951c8c4d2728a67f57 (diff) | |
| download | dotfiles-45ce7dd6fe5872983ab27ba354391397a61809ef.tar.gz dotfiles-45ce7dd6fe5872983ab27ba354391397a61809ef.tar.bz2 dotfiles-45ce7dd6fe5872983ab27ba354391397a61809ef.zip | |
nvim: port autocmds
Diffstat (limited to '.config/nvim/lua/helpers/autocmds.lua')
| -rw-r--r-- | .config/nvim/lua/helpers/autocmds.lua | 31 |
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 @@ | |||
| 1 | local function augroup(name) | ||
| 2 | return vim.api.nvim_create_augroup("custom_" .. name, {}) | ||
| 3 | end | ||
| 4 | |||
| 5 | vim.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 | |||
| 17 | vim.api.nvim_create_autocmd("VimLeave", { | ||
| 18 | group = augroup("tex_clear"), | ||
| 19 | pattern = { | ||
| 20 | '*.tex', | ||
| 21 | }, | ||
| 22 | command = "!textclear %", | ||
| 23 | }) | ||
| 24 | |||
| 25 | vim.api.nvim_create_autocmd("VimResized", { | ||
| 26 | group = augroup("sane_windows"), | ||
| 27 | pattern = { | ||
| 28 | '*.*', | ||
| 29 | }, | ||
| 30 | command = "wincmd =", | ||
| 31 | }) | ||
