Coder Social home page Coder Social logo

zchee / nvim-go Goto Github PK

View Code? Open in Web Editor NEW
260.0 8.0 5.0 12.68 MB

Go development plugin for Neovim written in pure Go

Home Page: https://pkg.go.dev/github.com/zchee/nvim-go

License: BSD 3-Clause "New" or "Revised" License

Go 82.79% Makefile 2.97% Shell 0.05% Vim Script 11.35% Dockerfile 0.08% Vim Snippet 2.75%
go neovim neovim-plugin go-client nvim-go

nvim-go's Introduction

nvim-go

CircleCI codecov.io pkg.go.dev Releases GA

nvim-go is a Go development plugin for Neovim written in pure Go.

Requirements

Neovim

Installing Neovim - Neovim wiki

Go

Getting Started - The Go Programming Language

Requires Go 1.11.x or higter. or, use devel.

Install

nvim-go uses Go 1.11 Modules.

We can build nvim-go outside $GOPATH. It's still early development feature. For use it, needs to:

export GO111MODULE='on'

After that, Just add following line to your init.vim:

" dein.vim
call dein#add('zchee/nvim-go', {'build': 'make'})

" NeoBundle
NeoBundle 'zchee/nvim-go', {'build': {'unix': 'make'}}

" vim-plug
Plug 'zchee/nvim-go', { 'do': 'make'}

Features

  • First goal is fully compatible vim-go.
  • Delve debugger GUI interface.

Acknowledgement

Donation

Please donate to the location in need of donations in your country.

Peace on Earth.

License

nvim-go is released under the BSD 3-Clause License.

nvim-go's People

Contributors

akatrevorjay avatar garyburd avatar nhooyr avatar zchee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nvim-go's Issues

imported and not used

Hello,

I'm getting an error when I'm running make on the plugin.

lint.go:19:2: imported and not used: "nvim-go/log"
nvim-go/command/delve
FATAL: command "build" failed: exit status 2

Exit status: 2 when installing

When doing PlugInstall after following instructions, I was given the following error:

  1 x Post-update hook for nvim-go ... Exit status: 2                                                │~

How do I find out what went wrong?

Run goimports on save

Since one of nvim-go stated goals is to be fully compatible with vim-go, I noticed that one of the config options missing at the moment is what command to run for auto formatting when saving.

Basically, we should have a way of specifying a similar flag/variable as done in vim-go with:

let g:go_fmt_command = "goimports"

This runs goimports on save and adds/removes the required/unused imports respectively.

See the mirror issue in vim-go.

Error occurs when I excute :w two or many times in neovim.

When I excute :w many times in neovim, error occur like:
Error detected while processing BufWritePre Auto Command for ".go"
Error detected while processing BufWritePost Auto Command for "
.go"
E475:invalid argument: Channel does't exsit.

action to buffer kind?

@cooljl31 commented on Sun Sep 03 2017

@cooljl31 commented on Sat Sep 02 2017

Warning: I will close the bug issue without the minimal init.vim and the reproduce ways.

Problems summary

  1. :Denite Buffer + Enter i have this log error wich you can in the log section

  2. when i open a go file i have this error message

Error detected while processing BufEnter Auto commands for "*.go":
E475: Invalid argument: Channel id must be a positive integer

Expected

Environment Information (Required!)

  • denite version(SHA1):

  • OS:
    10.12.6

  • Vim/neovim version:

NVIM v0.2.0
Build type: Release
Compilation: /usr/local/Homebrew/Library/Homebrew/shims/super/clang -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_MSGPACK_HAS_FLOAT32 -DNDEBUG -DDISABLE_LOG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -I/tmp/neovim-20170707-80027-1bg0wcx/neovim-0.2.0/build/config -I/tmp/neovim-20170707-80027-1bg0wcx/neovim-0.2.0/src -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/opt/gettext/include -I/usr/include -I/tmp/neovim-20170707-80027-1bg0wcx/neovim-0.2.0/build/src/nvim/auto -I/tmp/neovim-20170707-80027-1bg0wcx/neovim-0.2.0/build/include
Compiled by [email protected]

Optional features included (+) or not (-): +acl   +iconv    +jemalloc +tui
For differences from Vim, see :help vim-differences

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/0.2.0_1/share/nvim"
  • :CheckHealth result(neovim only):
health#deoplete#check
========================================================================
## deoplete.nvim
  - SUCCESS: has("nvim") was successful
  - SUCCESS: has("python3") was successful
  - INFO: If you're still having problems, try the following commands:
    $ export NVIM_PYTHON_LOG_FILE=/tmp/log
    $ export NVIM_PYTHON_LOG_LEVEL=DEBUG
    $ nvim
    $ cat /tmp/log_{PID}
    and then create an issue on github

health#nvim#check
========================================================================
## Configuration
  - WARNING: $NVIM_TUI_ENABLE_CURSOR_SHAPE is ignored in Nvim 0.2+
    - SUGGESTIONS:
      - Use the 'guicursor' option to configure cursor shape. :help |'guicursor'|
      - https://github.com/neovim/neovim/wiki/Following-HEAD#20170402

## Performance
  - SUCCESS: Build type: Release

## Remote Plugins
  - SUCCESS: Up to date

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=^H
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~

health#provider#check
========================================================================
## Clipboard (optional)
  - SUCCESS: Clipboard tool found: pbcopy

## Python 2 provider (optional)
  - INFO: Using: g:python_host_prog = "/usr/local/bin/python2"
  - INFO: Executable: /usr/local/bin/python2
  - INFO: Python2 version: 2.7.13
  - INFO: python2-neovim version: 0.1.13
  - SUCCESS: Latest python2-neovim is installed: 0.1.13

## Python 3 provider (optional)
  - INFO: Using: g:python3_host_prog = "/usr/local/bin/python3"
  - INFO: Executable: /usr/local/bin/python3
  - INFO: Python3 version: 3.6.2
  - INFO: python3-neovim version: 0.1.13
  - SUCCESS: Latest python3-neovim is installed: 0.1.13

## Ruby provider (optional)
  - INFO: Ruby: ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]
  - INFO: Host: /Users/cooljl31/.rvm/gems/ruby-2.4.0/bin/neovim-ruby-host
  - SUCCESS: Latest "neovim" gem is installed: 0.5.1

Provide a minimal init.vim with less than 50 lines (Required!)

" Your minimal init.vim
set runtimepath+=~/path/to/denite.nvim/
https://github.com/mhartington/dotfiles/blob/master/config/nvim/init.vim

The reproduce ways from neovim starting (Required!)

  1. foo
  2. bar
  3. baz

Screen shot (if possible)

screen shot 2017-09-02 at 6 13 37 pm

Upload the log file

python3/denite/init.py", line 29, in start
[denite] return ui.start(args[0], args[1])
[denite] File "/Users/cooljl31/.dotfiles/configs/nvim/.cache/init.vim/.dein/rplugin/
python3/denite/ui/default.py", line 68, in start
[denite] self._start(sources, context)
[denite] File "/Users/cooljl31/.dotfiles/configs/nvim/.cache/init.vim/.dein/rplugin/
python3/denite/ui/default.py", line 131, in _start
[denite] status = self._prompt.start()
[denite] File "/Users/cooljl31/.dotfiles/configs/nvim/.cache/init.vim/.dein/rplugin/
python3/denite/prompt/prompt.py", line 201, in start
[denite] raise e
[denite] File "/Users/cooljl31/.dotfiles/configs/nvim/.cache/init.vim/.dein/rplugin/
python3/denite/prompt/prompt.py", line 191, in start
[denite] interval=self.harvest_interval,
[denite] File "/Users/cooljl31/.dotfiles/configs/nvim/.cache/init.vim/.dein/rplugin/
python3/denite/ui/prompt.py", line 91, in on_keypress
[denite] return self.action.call(self, m.group('action'))
[denite] File "/Users/cooljl31/.dotfiles/configs/nvim/.cache/init.vim/.dein/rplugin/
python3/denite/prompt/action.py", line 139, in call
[denite] return fn(prompt, params)
[denite] File "/Users/cooljl31/.dotfiles/configs/nvim/.cache/init.vim/.dein/rplugin/
python3/denite/ui/action.py", line 17, in _do_action
[denite] return prompt.denite.do_action(params)
[denite] File "/Users/cooljl31/.dotfiles/configs/nvim/.cache/init.vim/.dein/rplugin/
python3/denite/ui/default.py", line 652, in do_action
[denite] self.quit()
[denite] File "/Users/cooljl31/.dotfiles/configs/nvim/.cache/init.vim/.dein/rplugin/
python3/denite/ui/default.py", line 617, in quit
[denite] self.quit_buffer()
[denite] File "/Users/cooljl31/.dotfiles/configs/nvim/.cache/init.vim/.dein/rplugin/
python3/denite/ui/default.py", line 578, in quit_buffer
[denite] self._vim.command('close!')
[denite] File "/usr/local/lib/python3.6/site-packages/neovim/api/nvim.py", line 218,
in command
[denite] return self.request('nvim_command', string, **kwargs)
[denite] File "/usr/local/lib/python3.6/site-packages/neovim/api/nvim.py", line 131,
in request
[denite] res = self._session.request(name, *args, **kwargs)
[denite] File "/usr/local/lib/python3.6/site-packages/neovim/msgpack_rpc/session.py"
, line 98, in request
[denite] raise self.error_wrapper(err)
[denite] neovim.api.nvim.NvimError: b'Vim(call):E475: Invalid argument: Channel id mus
t be a positive integer'
[denite] Please execute :messages command

Install via Plug fails

I'm switching to neovim and try to get nvim-go running. My Plug section in my init.vim looks like this:

call plug#begin('~/.vim/plugged')

Plug 'zchee/nvim-go', { 'do': 'make'}
Plug 'sebdah/vim-delve'

call plug#end()

If I open nvim and run PlugInstall, I get the following errors:

Error detected while processing
/home/domma/.vim/plugged/nvim-go/plugin/nvim-go. vim: line 20:
E121: Undefined variable: g:go#debug

I checked the file and the error makes sense. But I have no idea where this variable comes from, how it should be set. How can I fix this?

Gobuild does nothing

running :Gobuild shows or does nothing. Then, after running it once, running it again shows E475: Invalid argument: Channel doesn't exist

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.