summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/autocmds.lua
blob: 52720296a66ed03c52fa8b8ce55a78d6820e91fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
vim.api.nvim_create_autocmd('TextYankPost', {
    desc = 'Highlight when yanking text',
    group = vim.api.nvim_create_augroup('highlight-yank', { clear = true }),
    callback = function()
        vim.highlight.on_yank()
    end,
})

-- vim.api.nvim_create_autocmd('FileType', {
--     group = vim.api.nvim_create_augroup('disable-auto-comment', { clear = true }),
--     pattern = '*',
--     callback = function()
--         -- c - autowrap using textwidth | r - enter in insert mode | o - o/O in normal mode
--         -- vim.opt.formatoptions:remove({ 'c', 'r', 'o' })
--         vim.opt.formatoptions:remove('o')
--         -- vim.cmd('set formatoptions-=o')
--     end,
-- })