Comments (24)
Can you past the full log? Usually the file is listed too.
from vim-go.
The same issue on OSX (2 errors before opening .go file):
Error detected while processing function GoFiles: line 1: E484: Can't open file /var/folders/2y/xnkn1mdn18j87g40pqc_b3qc0000gn/T/vbAj3PD/0 Press ENTER or type command to continue Error detected while processing function GoFiles: line 1: E484: Can't open file /var/folders/2y/xnkn1mdn18j87g40pqc_b3qc0000gn/T/vbAj3PD/1 Press ENTER or type command to continue
from vim-go.
GoFiles()
is using go list
to obtain the dependencies of the file in your current directory. Do you work on a directory that isn't accessible ? Also can you try to invoki :GoFiles
and paste the results there.
from vim-go.
Typing :GoFiles produces the same result as above... Empty line, and then can't open file in temp dir.
I'm using FuzzyFinder with VIM, and go list in current directory produces:
$ go list can't load package: package .: no buildable Go source files in ...
I usually open vim in GOPATH dir which doesn't contain any .go files anyway.
Here is my VIM setup: https://github.com/bkaradzic/dotvim
from vim-go.
Yeah it needs go files. If there is no go files available it does produce an output like this.
from vim-go.
GoFiles does it even if I open vim in dir with .go files.
from vim-go.
Can you give me your test files please? I need a way to reproduce it :( Is your GOPATH not set maybe ?
from vim-go.
I just tried on this, and even when there are .go files it doesn't work: https://github.com/bkaradzic/go-lz4
GOPATH is set.
from vim-go.
Btw, I tried this on Windows, Linux and OSX and I get the same behavior everywhere.
from vim-go.
Thanks @bkaradzic , I'm looking at it now.
from vim-go.
Just tested it with your package (on Mac OS X) and this is what I have:
I have two questions:
- I think
:GoFiles
is not executed in the files folder. Can you give me the output of:pwd
before you do a:GoFiles
? - Can you simply execute this in your folder from Terminal?:
go list -f $'{{range $f := .GoFiles}}{{$.Dir}}/{{$f}}\n{{end}}'
from vim-go.
:pwd
returns just current directory which is go-lz4...
But the problem might be that I'm not using bash... On Win I just use standard cmd, on OSX and Linux I'm using fish shell (http://fishshell.com/).
from vim-go.
Is escaping different in fish shell? How would the command above work for you ?
from vim-go.
Fish is not really backwards compatible. I just changed back to bash (chsh -s ) restarted terminal and now :GoFiles
works. Is it possible to add option to specify bash executable path?
from vim-go.
We can give a specific shell
option to system()
call in vimscript. That would do the trick.
from vim-go.
Just pasting this as info. But probably you don't want to support all shell variations:
ish: Did you mean (COMMAND)? In fish, the '$' character is only used for accessing variables. To learn more about command substitution in fish, type 'help expand-command-substitution'. go list -f $'{{range $f := .GoFiles}}{{$.Dir}}/{{$f}}\n{{end}}'
from vim-go.
Cool! This probably would fix Windows too, since I can use bash from msys there.
from vim-go.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=609599 fixes your problem. Seems you need to apply:
if $SHELL =~ 'fish'
set shell='/bin/sh'
endif
or
set shell='/bin/sh'
from vim-go.
See also: https://github.com/dag/vim-fish
Vim needs a more POSIX compatible shell than fish for certain functionality to work, such as :%!, compressed help pages and many third-party addons. If you use fish as your login shell or launch Vim from fish, you need to set shell to something else in your ~/.vimrc, for example:
if &shell =~# 'fish$'
set shell=sh
endif
Best do it somewhere at the top, before any addon code is loaded and executed.
Note that this also affects what :sh[ell] launches, so if you care about that you might want to set it to your second best shell instead. If you use Vim in the terminal you could also train yourself to use :st[op] or CTRL-Z instead and then fg in fish to get back to Vim.
from vim-go.
@weitzj 👍
from vim-go.
Hi all, i have the some problem:
when i try :GoRun or others GoCommand i have this error
My os is Win7, i use gvim7.4 and in my _vimrc i set:
set shell=cmd
set shellcmdflag=/c
i try :echo system("echo hi") and the error is the some:
i can't understand what i wrong...
from vim-go.
This file opening error occurs when gvim is invoked from bash within MINGW64 terminal, but not when it is invoked from Windows explorer or bash within cmd.exe.
Error when invoked from MINGW64 terminal window:
No error when invoked from bash within cmd.exe:
from vim-go.
I have this set up in .vimrc
if $SHELL =~ 'fish'
set shell='/bin/sh'
endif
but still hitting issues when trying to save a file
Cannot execute shell '/bin/sh'
Error detected while processing function go#fmt#Format:
line 44:
E484: Can't open file /var/folders/pf/01012ncd26d4rcz5qknsym940000gn/T/vCqzcXR/7
from vim-go.
@philwhln Uninstalling and reinstalling vim-go
fixed this for me.
I'd love to know if you found the real cause of the issue.
from vim-go.
Related Issues (20)
- go_debug_mappings not set properly HOT 5
- How do I use vim-go with lazy.nvim HOT 1
- Highlight parameters and not functions HOT 1
- E900: Invalid channel id (again?) HOT 5
- :GoDef: please add support of GoMock HOT 7
- :GoTest sometimes on error opens file that not exists, with only one line: "package <my-package-name>" HOT 6
- Code folding is broken for single-line varconst declarations
- nvim snap error on opening file HOT 2
- Inconsistent :GoDoc behaviour HOT 1
- text/template support in gopls integration? HOT 1
- Syntax highlighting may be disabled by "'redrawtime' exceeded" when `re=1` HOT 4
- unknown directive: toolchain in go1.21 HOT 1
- GoRun FAILED HOT 1
- Position for identifier highlight(GoSameIds) is miscalculated when unicode character is present
- `g:go_metalinter_autosave_enabled` option can be set to not use any linter HOT 12
- debugger-commands not work HOT 2
- GoFillStruct does not work with []struct{{ _ }} HOT 3
- Add command for gopls inline refactor
- vim-go: Please comment on https://...537 if this impacts your workflow. HOT 4
- unknown directive: toolchain HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-go.