summaryrefslogtreecommitdiffstats
path: root/.config/nvim/lua/autocmds.lua
diff options
context:
space:
mode:
authorYigit Sever2021-10-08 13:40:08 +0300
committerYigit Sever2021-10-08 13:40:41 +0300
commit484188c99b21e668f40b84b21d1b21f5b9ce8d9e (patch)
tree97592a6667dafe35eb51171c4485208da1e5abba /.config/nvim/lua/autocmds.lua
parent98795863769fc46b78439b39a97c5d2c057fbb80 (diff)
downloaddotfiles-484188c99b21e668f40b84b21d1b21f5b9ce8d9e.tar.gz
dotfiles-484188c99b21e668f40b84b21d1b21f5b9ce8d9e.tar.bz2
dotfiles-484188c99b21e668f40b84b21d1b21f5b9ce8d9e.zip
nvim: autocommands
Diffstat (limited to '.config/nvim/lua/autocmds.lua')
-rw-r--r--.config/nvim/lua/autocmds.lua59
1 files changed, 59 insertions, 0 deletions
diff --git a/.config/nvim/lua/autocmds.lua b/.config/nvim/lua/autocmds.lua
new file mode 100644
index 0000000..295dcc2
--- /dev/null
+++ b/.config/nvim/lua/autocmds.lua
@@ -0,0 +1,59 @@
1-- ┌─────────────────────────┐
2-- │ ▐ ▌ │
3-- │▝▀▖▌ ▌▜▀ ▞▀▖▞▀▖▛▚▀▖▞▀▌▞▀▘│
4-- │▞▀▌▌ ▌▐ ▖▌ ▌▌ ▖▌▐ ▌▌ ▌▝▀▖│
5-- │▝▀▘▝▀▘ ▀ ▝▀ ▝▀ ▘▝ ▘▝▀▘▀▀ │
6-- └─────────────────────────┘
7
8local au = require('au')
9
10au.TextYankPost = function()
11 vim.highlight.on_yank({ higroup = 'Visual', timeout = 120 })
12end
13
14au.BufEnter = {
15 'PKGBUILD',
16 function()
17 vim.bo.filetype = "PKGBUILD"
18 end,
19}
20
21-- autocmd FileType vimwiki,latex,tex setlocal formatprg=/home/yigit/.local/bin/sentences
22au.FileType = {
23 'vimwiki,latex,tex',
24 function()
25 vim.bo.formatprg = "/home/yigit/.local/bin/sentences"
26 end,
27}
28
29-- autocmd VimLeave *.tex !texclear %
30au.VimLeave = {
31 '*.tex',
32 function()
33 vim.cmd("!texclear %")
34 end,
35}
36
37-- autocmd FileType rust let b:dispatch = 'cargo run'
38au.FileType = {
39 'rust',
40 function()
41 vim.b.dispatch = 'cargo run'
42 end,
43}
44
45-- autocmd VimResized * :wincmd =
46au.VimResized = {
47 '*',
48 function()
49 vim.cmd(":wincmd =")
50 end,
51}
52
53-- autocmd FileType markdown,tex setlocal spell
54au.FileType = {
55 'markdown,text',
56 function()
57 vim.bo.spell = true
58 end,
59}