nvim/lua/editor/autocommands/autocommands.lua

24 lines
737 B
Lua

-- [[ Basic Autocommands ]]
-- See `:help lua-guide-autocommands`
-- Highlight when yanking (copying) text
-- Try it with `yap` in normal mode
-- See `:help vim.highlight.on_yank()`
vim.api.nvim_create_autocmd('TextYankPost', {
desc = 'Highlight when yanking (copying) text',
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
callback = function()
vim.highlight.on_yank()
end,
})
-- Set the *.blade.php file to be filetype of blade
vim.api.nvim_create_augroup('BladeFileTypeRelated', { clear = true })
vim.api.nvim_create_autocmd({ 'BufNewFile', 'BufRead' }, {
pattern = '*.blade.php',
callback = function()
vim.opt.filetype = 'blade'
end,
group = 'BladeFileTypeRelated',
})