22 lines
605 B
Lua
22 lines
605 B
Lua
-- [[ Autocommands ]]
|
|
-- See `:help lua-guide-autocommands`
|
|
|
|
-- Highlight when yanking (copying) text
|
|
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.hl.on_yank()
|
|
end,
|
|
})
|
|
|
|
-- Set indent for C/C++ to 2 spaces
|
|
vim.api.nvim_create_autocmd('FileType', {
|
|
pattern = { 'c', 'cpp' },
|
|
callback = function()
|
|
vim.bo.tabstop = 2
|
|
vim.bo.shiftwidth = 2
|
|
vim.bo.softtabstop = 2
|
|
vim.bo.expandtab = true
|
|
end,
|
|
})
|