Questions tagged [vim-go]

For questions about the plugin vim-go that provides language support for the Go programming language in Vim and Neovim based editors. This plugin is not related to the LanguageClient protocol or related language support plugins (i.e. coc-go).

The plugin vim-go provides language support for the Go programming language in Vim and Neovim based editors. The plugin is one of the more popular Vim plugins for Go language according to the vim-plugins topic on Github.

Github Repository: fatih/vim-go

14 questions
2
votes
0 answers

vim-go: permission denied installing 'gopls'

I'm trying to setup the vim-go in a work environment but I don't have permission to install the gopls using: GoInstallBinaris or go get golang.org/x/tools/gopls@latest I'm getting this: /path/go/bin/gopls: permission denied Is there a way to fix…
Marcos Vidolin
  • 186
  • 4
  • 21
2
votes
0 answers

How to show the full message rather than truncated one in Vim?

I'm new to Vim. When I use Vim to write Go with vim-go plugin, I found it can mark the statements that go wrong. But what confuses me is that the message on the status bar(or command line?) is truncated and sometimes I couldn't see the whole…
2
votes
0 answers

vim-go with golangci-lint and revive (replacing deprecated go-lint): Confused about correct config

I am having a really hard time getting vim-go to play well with golanci-lint. golint, which was a default linter for go, has been deprecated. Most users now suggest to use revive. While the default config of vim-go with golint was working, but…
transient_loop
  • 5,984
  • 15
  • 58
  • 117
1
vote
1 answer

How to disable omnifunc autowrite suggestions

I am new to vim and I installed vim-go today. I set up auto completion with gopls with omnifunc set as go#complete#Complete. It works as expected but it always writes the current suggestion automatically. this is very annoying since it always writes…
Kirubel
  • 51
  • 1
  • 5
1
vote
0 answers

:GoInstallBinaries is ok but vim-go is not working

I am installing fatih/vim-go plugin. After install (I am using Vim8 packages) I run :GoInstallBinaries. In the image installation is complete. So, ... why if I run command such GoRun the editor answer me with:
sensorario
  • 20,262
  • 30
  • 97
  • 159
1
vote
2 answers

vim-go with coc.nvim: how to rename a package?

I have a file work.go opened in vim-go. It's in package oldpackagename. I want to refactor and rename it to newpackagename. Is there some tooling for that? The reason is, the initial assumptions for oldpackagename do not apply anymore. I know I can…
transient_loop
  • 5,984
  • 15
  • 58
  • 117
1
vote
0 answers

vim-go use environment file for :GoRun

When I use an IDE like Goland I'm able to set an environment file for the process when I run the program. I've done the following to get a similar result. I added the following to the init.vim. " Function to source only if file exists { function!…
SamuelTJackson
  • 1,357
  • 3
  • 19
  • 40
1
vote
0 answers

Vim-go: Short-cut key to open the files in import?

When it comes to vim-cscope, keyOfOurChoice + f to open the header files (for the most part) – somehow, I don’t find the answer for this question in https://github.com/fatih/vim-go/wiki/Tutorial#navigate-it Thanks.
RaGa__M
  • 2,550
  • 1
  • 23
  • 44
0
votes
0 answers

vim-go - how to configure goimports group like GoLand

How can I set up goimports on vim to group all the imports like in the GoLand? I already have this configuration for autosave on .vimrc: let g:go_fmt_command = "goimports"
Marcos Vidolin
  • 186
  • 4
  • 21
0
votes
2 answers

Go: vim autocomplete command don't works

autocomplete in vim doesn't work when I hit ENTER and the cursor go to the next line. this is my .vimrc configuration: https://github.com/marcosvidolin/dotfiles/blob/master/.vimrc Popup example: Thanks
Marcos Vidolin
  • 186
  • 4
  • 21
0
votes
1 answer

Problems with vim-go and vimrc

I recently installed vim-go from github via this command: git clone https://github.com/fatih/vim-go.git ~/.vim/pack/plugins/start/vim-go and it all worked. But I want to see the line numbers and do some stuff in the "global" vimrc file. So I added…
0
votes
0 answers

How to make Vim to auto format the name of the function to be capitalize in Go

I use Vim as an editor for coding in Go. I has vim-go installed in my Vim. I wonder if there is a way to auto format the function name to make it capitalize. For example instead of type fmt.Println("Go is fun") I would like to just…
worrawut
  • 958
  • 10
  • 17
0
votes
1 answer

How to safe delete the usages of struct field on all files from Intellij?

Though we have refactoring tool to rename the struct field we do not have refactoring tool for deleting the struct field & its usages. How to safely delete the struct field and its usages[Write & read access] across the files from any IDE that…
Mani
  • 2,599
  • 4
  • 30
  • 49
0
votes
0 answers

Not able to see first two characters in the file

Vim details: $ vim --version VIM - Vi IMproved 8.1 (2018 May 18, compiled Jun 5 2020 21:30:37) macOS version Here you can see that package v1 word in the starting of the file is not visible properly. This happens only with .go file, vimrc file as…
Murtuza Z
  • 5,639
  • 1
  • 28
  • 52