summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/autocmds.lua
blob: d7d1294913058e6350a1b05d2c900cb9c14008bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
local custom_au = vim.api.nvim_create_augroup('custom', {})

vim.api.nvim_create_autocmd('BufWritePost', {
	group = custom_au,
	pattern = require('utils').config_home() .. "/i3/config",
	command = '!i3-msg -q reload',
})

vim.api.nvim_create_autocmd('BufWritePost', {
	group = custom_au,
	pattern = "*.tex",
	command = 'silent !pdflatex %',
})

vim.api.nvim_create_autocmd('BufWritePre', {
	group = custom_au,
	pattern = 'todo.txt',
	command = 'sort',
})

vim.api.nvim_create_autocmd('VimResized', {
	group = custom_au,
	command = 'wincmd =',
})

vim.api.nvim_create_autocmd('TextYankPost', {
	group = custom_au,
	callback = function ()
		vim.highlight.on_yank({ higroup = 'IncSearch', timeout = 200})
	end,
})