Skip to content

Commit

Permalink
mapping: add go-fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
bhcleek committed Apr 23, 2021
1 parent f54d325 commit c7d94a6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions doc/vim-go.txt
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,9 @@ Calls `go test -coverprofile-temp.out` for the current package and shows the
coverage annotation. If run again it acts as a toggle and clears the
annotation.

*(go-fmt)*

Format the current buffer.
*(go-imports)*

Adjust imports for the current buffer.
Expand Down
2 changes: 1 addition & 1 deletion ftplugin/go/commands.vim
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ command! -nargs=* -range -complete=customlist,go#package#Complete GoDoc call go#
command! -nargs=* -range -complete=customlist,go#package#Complete GoDocBrowser call go#doc#OpenBrowser(<f-args>)

" -- fmt
command! -nargs=0 GoFmt call go#fmt#Format(-1)
command! -nargs=0 GoFmt call go#fmt#Format(0)
command! -nargs=0 GoFmtAutoSaveToggle call go#fmt#ToggleFmtAutoSave()
command! -nargs=0 GoImports call go#fmt#Format(1)

Expand Down
1 change: 1 addition & 0 deletions ftplugin/go/mappings.vim
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ nnoremap <silent> <Plug>(go-deps) :<C-u>call go#tool#Deps()<CR>
nnoremap <silent> <Plug>(go-info) :<C-u>call go#tool#Info(1)<CR>
nnoremap <silent> <Plug>(go-import) :<C-u>call go#import#SwitchImport(1, '', expand('<cword>'), '')<CR>
nnoremap <silent> <Plug>(go-imports) :<C-u>call go#fmt#Format(1)<CR>
nnoremap <silent> <Plug>(go-fmt) :<C-u>call go#fmt#Format(0)<CR>
nnoremap <silent> <Plug>(go-implements) :<C-u>call go#implements#Implements(-1)<CR>
nnoremap <silent> <Plug>(go-callees) :<C-u>call go#guru#Callees(-1)<CR>
Expand Down

0 comments on commit c7d94a6

Please sign in to comment.