Skip to content

Formats Go source code asynchronously with multiple Go formatters.

Notifications You must be signed in to change notification settings

haya14busa/vim-gofmt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

vim-gofmt

LICENSE

vim-gofmt formats Go source code asynchronously with multiple Go formatters.

It's experimental and API may changes, but it should work.

Usage

:Fmt

:Fmt formats Go source code in current buffer using g:gofmt_formatters.

It runs asynchronously and doesn't block editing.

g:gofmt_formatters

default:

let g:gofmt_formatters = [
\   { 'cmd': 'gofmt', 'args': ['-s', '-w'] },
\   { 'cmd': 'goimports', 'args': ['-w'] },
\ ]

Each formatters are used in consecutively in order of the list.

Example:

$ go get -u github.com/rhysd/gofmtrlx
$ go get -u github.com/haya14busa/go-typeconv/cmd/gotypeconv
let g:gofmt_formatters = [
\   { 'cmd': 'gofmtrlx', 'args': ['-s', '-w'] },
\   { 'cmd': 'goimports', 'args': ['-w'] },
\   { 'cmd': 'gotypeconv', 'args': ['-w'] },
\ ]

🐦 Author

haya14busa (https://github.com/haya14busa)

About

Formats Go source code asynchronously with multiple Go formatters.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published