We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I edited ~/.vim/ftplugin/go.vim to map the leader key:
~/.vim/ftplugin/go.vim
map <Leader>m :!clear;go run %<Enter>
When pressing <leader>+m, my script should run.
<leader>+m
I have the following output:
make: *** No targets specified and no makefile found. Stop. shell returned 2 Press ENTER or type command to continue
This is due to the fact that <leader>+m is configure to run make in .vimrc.
make
.vimrc
vim-go version:
vimrc you used to reproduce (use a minimal vimrc with other plugins disabled; do not link to a 2,000 line vimrc):
vimrc
Vim version (first three lines from :version):
:version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Nov 29 2017 18:37:46) Included patches: 1-503, 505-680, 682-1283 Compiled by [email protected]
go version
go version go1.10.3 darwin/amd64
go env
GOARCH="amd64" GOBIN="" GOCACHE="/Users/martin/Library/Caches/go-build" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/martin/dev/go" GORACE="" GOROOT="/usr/local/Cellar/go/1.10.3/libexec" GOTMPDIR="" GOTOOLDIR="/usr/local/Cellar/go/1.10.3/libexec/pkg/tool/darwin_amd64" GCCGO="gccgo" CC="clang" CXX="clang++" CGO_ENABLED="1" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/rv/x9flf_k97zq_bfv790jhhtwc0000gn/T/go-build932926580=/tmp/go-build -gno-record-gcc-switches -fno-common"
The text was updated successfully, but these errors were encountered:
I am a bit confused how this is a vim-go issue? vim-go doesn't map <Leader>m, and you're not calling any vim-go functions?
<Leader>m
You can use :GoRun or :GoRun %.
:GoRun
:GoRun %
As for why your mapping is wrong? That'll be difficult to say anything meaningful about without seeing what you're doing exactly.
Sorry, something went wrong.
Ok the problem was that I am using vim-plug to manage my plugin and the ftplugin folder was ignored.
ftplugin
I created my own plugin and add it here to fix my problem.
No branches or pull requests
What did you do? (required. The issue will be closed when not provided.)
I edited
~/.vim/ftplugin/go.vim
to map the leader key:What did you expect to happen?
When pressing
<leader>+m
, my script should run.What happened instead?
I have the following output:
This is due to the fact that
<leader>+m
is configure to runmake
in.vimrc
.Configuration (MUST fill this out):
vim-go version:
vimrc
you used to reproduce (use a minimal vimrc with other plugins disabled; do not link to a 2,000 line vimrc):Vim version (first three lines from
:version
):go version
):go env
):The text was updated successfully, but these errors were encountered: