diff --git a/.config/nvim/lua/user/autocommands.lua b/.config/nvim/lua/user/autocommands.lua index fc5c024..f06e676 100644 --- a/.config/nvim/lua/user/autocommands.lua +++ b/.config/nvim/lua/user/autocommands.lua @@ -16,7 +16,7 @@ vim.api.nvim_create_autocmd({ "TextYankPost" }, { -- Set expandtab=true in several file types vim.api.nvim_create_autocmd({ "FileType" }, { - pattern = { "go", "makefile", "lua" }, + pattern = { "*.go", "makefile", "*.lua" }, callback = function() vim.opt_local.expandtab = false end, @@ -24,7 +24,7 @@ vim.api.nvim_create_autocmd({ "FileType" }, { -- Use 'q' to quit from common plugins vim.api.nvim_create_autocmd({ "FileType" }, { - pattern = { "qf", "help", "man", "lspinfo", "spectre_panel", "lir" }, + pattern = { "qf", "help", "man", "lspinfo" }, callback = function() vim.cmd([[ nnoremap q :close diff --git a/.config/nvim/lua/user/go.lua b/.config/nvim/lua/user/go.lua index e1fb3e9..eba853d 100644 --- a/.config/nvim/lua/user/go.lua +++ b/.config/nvim/lua/user/go.lua @@ -3,7 +3,10 @@ if not status_ok then return end -vim.cmd("autocmd FileType go nmap gf :lua require('go.format').goimport()") go.setup({ icons = { breakpoint = "", currentpos = "🏃" }, + fillstruct = "fillstruct", }) + +vim.cmd("autocmd FileType go nmap gf :lua require('go.format').goimport()") +vim.api.nvim_exec([[ autocmd BufWritePre *.go :silent! lua require('go.format').goimport() ]], false)