feat(go): organise imports on save
This commit is contained in:
parent
f1046c2a1f
commit
2893ebee96
4 changed files with 12 additions and 5 deletions
2
Makefile
2
Makefile
|
@ -1,4 +1,4 @@
|
|||
.PHONY: backup clean update install_packer package publish
|
||||
.PHONY: backup clean update install_lazy package publish
|
||||
|
||||
backup:
|
||||
@bash ./.helpers/config backup
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
require("options")
|
||||
require("plugins")
|
||||
require("keymappings")
|
||||
require("autocommands")
|
||||
|
|
6
nvim/lua/autocommands.lua
Normal file
6
nvim/lua/autocommands.lua
Normal file
|
@ -0,0 +1,6 @@
|
|||
vim.api.nvim_create_autocmd('BufWritePre', {
|
||||
pattern = '*.go',
|
||||
callback = function()
|
||||
vim.lsp.buf.code_action({ context = { only = { 'source.organizeImports' } }, apply = true })
|
||||
end
|
||||
})
|
Loading…
Reference in a new issue