Skip to content

Redirecting the leader key to run my script #1957

Closed
@MartinDelille

Description

@MartinDelille

What did you do? (required. The issue will be closed when not provided.)

I edited ~/.vim/ftplugin/go.vim to map the leader key:

map <Leader>m :!clear;go run %<Enter>

What did you expect to happen?

When pressing <leader>+m, my script should run.

What happened instead?

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.

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):

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):
go version go1.10.3 darwin/amd64
  • Go environment (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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions