"$pkg_dst_cmd" get golang.org/x/tools/cmd/gotype > /dev/null #2>/dev/null
echo stringer
"$pkg_dst_cmd" get golang.org/x/tools/cmd/stringer > /dev/null #2>/dev/null
+ echo goreturns
+ "$pkg_dst_cmd" get github.com/sqs/goreturns > /dev/null #2>/dev/null
}
pkg_done_message() {
> `vim-go` provides integration with various official and 3rd part go tooling
> for linting, vetting, etc.
-You'll also need `ALE`, `syntastic`, or similar.
+You'll also need `ALE`, [`syntastic`](https://webinstall.dev/vim-syntastic), or
+similar.
### How to install by hand
### How to configure your `.vimrc`
-```vimrc
+```vim
" don't check syntax immediately on open or on quit
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
autocmd BufWritePre * :%s/\s\+$//e
```
-```vimrc
+```vim
"""""""""""""""""""""""""""
" Golang-specific options "
"""""""""""""""""""""""""""
# gorename
go get golang.org/x/tools/cmd/gorename
+# goreturns
+go get github.com/sqs/goreturns
+
# gotype
go get golang.org/x/tools/cmd/gotype
```
--- /dev/null
+""""""""""""""""""""""""""""""
+" Golang-specific defaults "
+" from webinstall.dev/vim-go "
+""""""""""""""""""""""""""""""
+
+" tell syntastic that go, golint, and errcheck are installed
+let g:syntastic_go_checkers = ['go', 'golint', 'errcheck']
+
+" tell vim-go that goimports is installed
+let g:go_fmt_command = "goreturns"
+
+" tell vim-go to highlight
+let g:go_highlight_functions = 1
+let g:go_highlight_methods = 1
+let g:go_highlight_structs = 1
+let g:go_highlight_operators = 1
+let g:go_highlight_build_constraints = 1
#!/usr/bin/env pwsh
-IF (!(Test-Path -Path "$Env:USERPROFILE\.vim\pack\plugins\start")) {
- New-Item -Path "$Env:USERPROFILE\.vim\pack\plugins\start" -ItemType Directory -Force
-}
+New-Item -Path "$Env:USERPROFILE\.vim\pack\plugins\start" -ItemType Directory -Force
+
Remove-Item -Path "$Env:USERPROFILE\.vim\pack\plugins\start\vim-go" -Recurse -ErrorAction Ignore
& git clone --depth=1 https://github.com/fatih/vim-go.git "$Env:USERPROFILE\.vim\pack\plugins\start\vim-go"
mkdir -p "$HOME/.vim/pack/plugins/start"
rm -rf "$HOME/.vim/pack/plugins/start/vim-go"
git clone --depth=1 https://github.com/fatih/vim-go.git "$HOME/.vim/pack/plugins/start/vim-go"
+
+ # Install go linting tools
+ echo "Building go language tools..."
+ echo gopls
+ go get golang.org/x/tools/gopls > /dev/null #2>/dev/null
+ echo golint
+ go get golang.org/x/lint/golint > /dev/null #2>/dev/null
+ echo errcheck
+ go get github.com/kisielk/errcheck > /dev/null #2>/dev/null
+ echo goimports
+ go get golang.org/x/tools/cmd/goimports > /dev/null #2>/dev/null
+ echo goreturns
+ go get github.com/sqs/goreturns > /dev/null #2>/dev/null
+
+ if [ -f "$HOME/.vimrc" ]; then
+ set +e
+ if ! grep 'source.*go.vim' -r ~/.vimrc; then
+ mkdir -p ~/.vim/plugin
+ printf '\n" Golang: reasonable defaults from webinstall.dev/vim-go\n' >> ~/.vimrc
+ printf 'source ~/.vim/plugin/go.vim\n' >> ~/.vimrc
+ fi
+ set -e
+ fi
+
+ if ! [ -f "$HOME/.vim/plugin/go.vim" ]; then
+ mkdir -p ~/.vim/plugin
+ WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"}
+ curl -fsS -o ~/.vim/plugin/go.vim "$WEBI_HOST/packages/vim-go/go.vim"
+ fi
}
--- /dev/null
+---
+title: vim-prettier
+homepage: https://github.com/prettier/vim-prettier
+tagline: |
+ vim-prettier adds Prettier support for Vim.
+---
+
+## Updating `vim-prettier`
+
+```bash
+webi vim-prettier
+```
+
+## Cheat Sheet
+
+> `vim-prettier` is a vim plugin wrapper for prettier, pre-configured with
+> custom default prettier settings.
+
+You'll also need `ALE`, [`syntastic`](https://webinstall.dev/vim-syntastic), or
+similar.
+
+### How to install by hand
+
+```bash
+git clone --depth=1 https://github.com/prettier/vim-prettier ~/.vim/pack/plugins/start/vim-prettier
+```
+
+### How to configure your `.vimrc`
+
+```vim
+" don't check syntax immediately on open or on quit
+let g:syntastic_check_on_open = 1
+let g:syntastic_check_on_wq = 0
+
+" we also want to get rid of accidental trailing whitespace on save
+autocmd BufWritePre * :%s/\s\+$//e
+```
+
+```vim
+"""""""""""""""""""""""""""
+" Prettier-specific options "
+"""""""""""""""""""""""""""
+
+" format as-you-type is quite annoying, so we turn it off
+let g:prettier#autoformat = 0
+
+" list all of the extensions for which prettier should run
+autocmd BufWritePre .babelrc,.eslintrc,.jshintrc,*.js,*.jsx,*.mjs,*.ts,*.tsx,*.css,*.less,*.scss,*.json,*.graphql,*.md,*.vue,*.yaml,*.html PrettierAsync
+```
+
+### How to install Prettier
+
+With `webi`:
+
+```bash
+webi prettier
+```
+
+With `node`:
+
+```bash
+npm install -g prettier@2
+```
--- /dev/null
+#!/usr/bin/env pwsh
+
+New-Item -Path "$Env:USERPROFILE\.vim\pack\plugins\start" -ItemType Directory -Force
+
+Remove-Item -Path "$Env:USERPROFILE\.vim\pack\plugins\start\vim-prettier" -Recurse -ErrorAction Ignore
+& git clone --depth=1 https://github.com/prettier/vim-prettier.git "$Env:USERPROFILE\.vim\pack\plugins\start\vim-prettier"
--- /dev/null
+#!/bin/bash
+
+{
+ set -e
+ set -u
+
+ mkdir -p "$HOME/.vim/pack/plugins/start"
+ rm -rf "$HOME/.vim/pack/plugins/start/vim-prettier"
+ git clone --depth=1 https://github.com/prettier/vim-prettier.git "$HOME/.vim/pack/plugins/start/vim-prettier"
+
+ npm install -g prettier@2
+
+ if [ -f "$HOME/.vimrc" ]; then
+ set +e
+ if ! grep 'source.*prettier.vim' -r ~/.vimrc; then
+ mkdir -p ~/.vim/plugin
+ printf '\n" Prettier: reasonable defaults from webinstall.dev/vim-prettier\n' >> ~/.vimrc
+ printf 'source ~/.vim/plugin/prettier.vim\n' >> ~/.vimrc
+ fi
+ set -e
+ fi
+
+ if ! [ -f "$HOME/.vim/plugin/prettier.vim" ]; then
+ mkdir -p ~/.vim/plugin
+ WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"}
+ curl -fsS -o ~/.vim/plugin/prettier.vim "$WEBI_HOST/packages/vim-prettier/prettier.vim"
+ fi
+}
--- /dev/null
+""""""""""""""""""""""""""""""""""""
+" Prettier-specific defaults "
+" from webinstall.dev/vim-prettier "
+""""""""""""""""""""""""""""""""""""
+
+" format as-you-type is quite annoying, so we turn it off
+let g:prettier#autoformat = 0
+
+" list all of the extensions for which prettier should run
+autocmd BufWritePre .babelrc,.eslintrc,.jshintrc,*.js,*.jsx,*.mjs,*.ts,*.tsx,*.css,*.less,*.scss,*.json,*.graphql,*.md,*.vue,*.yaml,*.html PrettierAsync