[neovim] Minor fixes

This commit is contained in:
Daniel Carrillo 2022-10-14 20:40:51 +02:00
parent 89f28aba90
commit 2fc006ba85
Signed by: dcarrillo
GPG Key ID: E4CD5C09DAED6E16
2 changed files with 6 additions and 3 deletions

View File

@ -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 <silent> <buffer> q :close<CR>

View File

@ -3,7 +3,10 @@ if not status_ok then
return
end
vim.cmd("autocmd FileType go nmap <Leader>gf :lua require('go.format').goimport()<CR>")
go.setup({
icons = { breakpoint = "", currentpos = "🏃" },
fillstruct = "fillstruct",
})
vim.cmd("autocmd FileType go nmap <Leader>gf :lua require('go.format').goimport()<CR>")
vim.api.nvim_exec([[ autocmd BufWritePre *.go :silent! lua require('go.format').goimport() ]], false)