1
0
mirror of https://github.com/dcarrillo/dotfiles.git synced 2024-12-22 18:38:00 +00:00

[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 -- Set expandtab=true in several file types
vim.api.nvim_create_autocmd({ "FileType" }, { vim.api.nvim_create_autocmd({ "FileType" }, {
pattern = { "go", "makefile", "lua" }, pattern = { "*.go", "makefile", "*.lua" },
callback = function() callback = function()
vim.opt_local.expandtab = false vim.opt_local.expandtab = false
end, end,
@ -24,7 +24,7 @@ vim.api.nvim_create_autocmd({ "FileType" }, {
-- Use 'q' to quit from common plugins -- Use 'q' to quit from common plugins
vim.api.nvim_create_autocmd({ "FileType" }, { vim.api.nvim_create_autocmd({ "FileType" }, {
pattern = { "qf", "help", "man", "lspinfo", "spectre_panel", "lir" }, pattern = { "qf", "help", "man", "lspinfo" },
callback = function() callback = function()
vim.cmd([[ vim.cmd([[
nnoremap <silent> <buffer> q :close<CR> nnoremap <silent> <buffer> q :close<CR>

View File

@ -3,7 +3,10 @@ if not status_ok then
return return
end end
vim.cmd("autocmd FileType go nmap <Leader>gf :lua require('go.format').goimport()<CR>")
go.setup({ go.setup({
icons = { breakpoint = "", currentpos = "🏃" }, 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)