Skip to content

Commit

Permalink
docs(contributing): change instructions for vim, reference gnols (gno…
Browse files Browse the repository at this point in the history
…lang#1113)

Setting syntax=go instead of filetype=go allows us to have syntax
highlighting without triggering vim-go. Also added a reference to
@jdkato's great [gnols](https://github.com/jdkato/gnols)

---------

Co-authored-by: Manfred Touron <94029+moul@users.noreply.github.com>
  • Loading branch information
2 people authored and gfanton committed Nov 9, 2023
1 parent 8bef753 commit 99fcec2
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,15 @@ Add to your `.vimrc` file:

```vim
function! GnoFmt()
cexpr system('gofmt -e -w ' . expand('%')) "or replace with gofumpt, see below
edit!
cexpr system('gofmt -e -w ' . expand('%')) " or replace with gofumpt, see below
edit!
set syntax=go
endfunction
command! GnoFmt call GnoFmt()
augroup gno_autocmd
autocmd!
autocmd BufNewFile,BufRead *.gno set filetype=go
autocmd BufWritePost *.gno GnoFmt
autocmd!
autocmd BufNewFile,BufRead *.gno set syntax=go
autocmd BufWritePost *.gno GnoFmt
augroup END
```

Expand All @@ -96,6 +97,9 @@ To use *gofumpt* instead of *gofmt*, as hinted in the comment, you may either ha
cexpr system('go run -modfile </path/to/gno>/misc/devdeps/go.mod mvdan.cc/gofumpt -w ' . expand('%'))
```

There is an experimental and unofficial [Gno Language Server](https://github.com/jdkato/gnols)
developed by the community, with an installation guide for Neovim.

#### Emacs Support

1. Install [go-mode.el](https://github.com/dominikh/go-mode.el).
Expand All @@ -105,6 +109,11 @@ cexpr system('go run -modfile </path/to/gno>/misc/devdeps/go.mod mvdan.cc/gofump
(add-to-list 'auto-mode-alist '("\\.gno\\'" . go-mode))
```

#### Sublime Text

There is an experimental and unofficial [Gno Language Server](https://github.com/jdkato/gnols)
developed by the community, with an installation guide for Sublime Text.

### Local Setup

To get started with Gno development, the process is relatively straightforward.
Expand Down

0 comments on commit 99fcec2

Please sign in to comment.