Coder Social home page Coder Social logo

xpzouying / goldsmith.nvim Goto Github PK

View Code? Open in Web Editor NEW

This project forked from whoissethdaniel/goldsmith.nvim

0.0 2.0 0.0 1.09 MB

Use Neovim features, such as built-in LSP and tree-sitter, and develop Go code.

License: MIT License

Lua 93.60% Vim Script 6.40%

goldsmith.nvim's Introduction

Goldsmith

Go development environment for Neovim utilizing the builtin LSP and other features and plugins specific to Neovim.

Features

view all screencasts here

  • codelens support screencast
  • flag and update out-of-date dependencies in your current Go module screencast
  • automatically run goimports on save screencast
  • auto-highlight the current symbol under the cursor throughout the current buffer screencast
  • treesitter navigation utilizing the nvim-treesitter-textobjects plugin
  • treesitter text objects utilizing the nvim-treesitter-textobjects plugin
  • convert JSON to Go structs directly in your code, or paste from outside the editor screencast
  • view Go documentation using the :GoDoc command and Go help with :GoHelp screencast
  • context sensitive help with either :GoContextHelp or via a keybinding
  • manually update imports using the :GoImports command screencast
  • use :checkhealth to see if your Goldsmith setup should work correctly screencast
  • format your code on demand using :GoFormat or have Goldsmith automatically format your code on save screencast
  • integration with Telescope for a number of file picking needs screencast
  • run extra linters and/or formatters using null-ls: currently has support for golines, gofmt, gofumpt, revive, golangci-lint, and staticcheck
  • see the source of the diagnostic when running extra linters
  • Goldsmith can completely configure everything for you, if you want (see the Configurations wiki for more)
  • generate test stubs automatically using gotests screencast
  • create implementation stubs for your interfaces using :GoImpl screencast
  • :GoFillStruct utilizes LSP to fill the current struct
  • switch to the 'alternate' file quickly screencast
  • struct tag editing: add / remove / update struct tags and options screencast
  • use common go subcommands from within Neovim with: :GoBuild, :GoInstall, :GoGet, :GoRun, and others screencast
  • coverage support: annotate the current buffer and store coverage data for all files affected screencast
  • statusline integration: see the status of running jobs and of coverage data for the current buffer screencast
  • edit the go.mod file from within Neovim with: :GoModTidy, :GoModCheck, :GoModRetract, :GoModReplace, and others
  • use the excellent builtin testing framework to run individual tests, package tests, or all your tests
  • all the great Neovim LSP functions are available as Vim commands
  • most commands are completely asynchronous
  • support for nvim-lsp-installer

Installation

Install using your favorite plugin manager.

If you use vim-plug:

Plug 'WhoIsSethDaniel/goldsmith.nvim'

Or if you use Vim 8 style packages:

cd <plugin dir>
git clone https://github.com/WhoIsSethDaniel/goldsmith.nvim

Quickstart

  1. Install Go.

  2. Install Goldsmith, lspconfig, treesitter and null-ls.

  3. Install required external programs:

    nvim +GoInstallBinaries

    You may receive some warnings from Goldsmith about missing programs. These can be ignored since you are now installing those programs.

    After the installation completes (usually within a minute or so) run

    :checkhealth goldsmith

    Make certain everything looks okay.

  4. Restart Neovim.

  5. Start editing Go code.

  6. Currently you are running with Goldsmith defaults. So take a look at the documentation and tweak your configuration.

Configuration

See the configuration page on the wiki for examples demonstrating how to configure Goldsmith.

Also see the Goldsmith :help documentation or after installing Goldsmith by using :h goldsmith.

Minimal Requirements

These 'minimal' requirements are not hard-and-fast. They are simply the minimal versions that the author has been able to test with. Goldsmith may work just fine with older versions of Go, gopls, etc.... Neovim, however, must be at least 0.5.0 and nvim-lspconfig is also a hard requirement.

Goldsmith will not work with Vim or versions of Neovim prior to 0.5.0.

Run :checkhealth goldsmith after installing to see what is required and what needs to be done to meet the minimal requirements.

[*] Goldsmith depends on package completion provided by gopls. Prior to 0.6.6 this did not exist. If you use a gopls earlier than 0.6.6 it means package completion will not work for those commands that require it.

Reporting Problems / Asking Questions

Goldsmith is very new. It works for the author, but does it work for you? If not, please consider asking a question or reporting a problem.

goldsmith.nvim's People

Contributors

rgerardi avatar whoissethdaniel avatar

Watchers

 avatar  avatar

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.