local cmd, opt = vim.api.nvim_create_autocmd, vim.opt_local local map = require("core.utils").map cmd("TextYankPost", { pattern = "*", callback = function() vim.highlight.on_yank() end, }) cmd("FileType", { pattern = "lua", callback = function() opt.tabstop = 2 opt.shiftwidth = 2 opt.softtabstop = 2 map("n", ";t", "PlenaryTestFile") end, }) cmd("FileType", { pattern = "go", callback = function() opt.expandtab = false opt.tabstop = 4 opt.shiftwidth = 4 opt.softtabstop = 4 map("n", ";dt", "lua require('dap-go').debug_test()") map("n", ";to", "GoTestAdd") map("n", ";ta", "GoTestsAll") map("n", ";te", "GoTestsExpr") map("n", ";g", "GoGenerate") map("n", ";c", "GoCmt") map("n", ";e", "GoIfErr") end, }) cmd("FileType", { pattern = "python", callback = function() opt.tabstop = 4 opt.shiftwidth = 4 opt.softtabstop = 4 end, }) cmd("FileType", { pattern = "javascript,typescript,json", callback = function() opt.tabstop = 2 opt.shiftwidth = 2 opt.softtabstop = 2 end, })