Only run if gofmt is present
This commit is contained in:
parent
0ebe1a52ad
commit
0cfe71f52b
1 changed files with 7 additions and 1 deletions
8
vimrc
8
vimrc
|
@ -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
|
||||
|
||||
"===============================================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue