Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add explanations about how to use gofumpt in vim #747

Merged
merged 3 commits into from
May 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Add to your `.vimrc` file:

```vim
function! GnoFmt()
cexpr system('gofmt -e -w ' . expand('%')) "or replace with gofumpt
cexpr system('gofmt -e -w ' . expand('%')) "or replace with gofumpt, see below
edit!
endfunction
command! GnoFmt call GnoFmt()
Expand All @@ -90,6 +90,12 @@ augroup gno_autocmd
augroup END
```

To use *gofumpt* instead of *gofmt*, as hinted in the comment, you may either have `gofumpt` in your PATH or substitute the cexpr line above with the following (please make sure to replace `<path/to/gno>` with the path to your local gno repository):

```vim
cexpr system('go run -modfile </path/to/gno>/misc/devdeps/go.mod mvdan.cc/gofumpt -w ' . expand('%'))
```

#### Emacs Support

1. Install [go-mode.el](https://github.com/dominikh/go-mode.el).
Expand Down