Only run if gofmt is present

This commit is contained in:
Anthony Rose 2025-04-01 08:57:37 +01:00
parent 0ebe1a52ad
commit 0cfe71f52b

8
vimrc
View file

@ -51,7 +51,7 @@ nnoremap <F3> :NvimTreeToggle<CR>
nnoremap <F4> :vsplit<CR>
nnoremap <F6> :set invhlsearch<CR>
nnoremap <F7> :call ACPToggleSpellEnUs()<CR>
nnoremap <F8> :%!gofmt -s<CR>
nnoremap <F8> :call ACPGoFmt()<CR>
nnoremap <F9> gqip
nnoremap <Leader>B :bprevious<CR>
nnoremap <Leader>b :bnext<CR>
@ -221,6 +221,12 @@ if has('eval')
endif
endfunction
function! ACPGoFmt()
if executable('gofmt')
:%!gofmt -s
endif
endfunction
endif
"===============================================================================