-- Custom filetypes vim.filetype.add({ extension = { conf = "conf", nd = "markdown", }, pattern = { [".*%.env.*"] = "sh", ["ignore$"] = "conf", }, }) local cmd = vim.api.nvim_create_autocmd -- Go to last location when opening buffer cmd("BufReadPost", { command = [[ if line("'\"") > 1 && line("'\"") <= line("$") | execute "normal! g`\"" | endif ]] }) -- Highlight the region on yank cmd("TextYankPost", { group = vim.api.nvim_create_augroup("TextYankGroup", { clear = true }), callback = function() vim.highlight.on_yank({ higroup = "Visual" }) end, })