Features 3 - WhoIsSethDaniel/goldsmith.nvim GitHub Wiki

Use :checkhealth to check Goldsmith setup

Neovim has a very useful system for checking the health of a particular plugin or system. Goldsmith takes advantage of this system by having checkhealth check the status of supported and optional plugins, LSP servers, and external tools. This screencast shows the output of running ":checkhealth goldsmith".

Goldsmith checkhealth example

Manual formatting using :GoFormat

The following screencast shows manual formatting uses two different formatters: gopls and golines. gopls does most of the work, but golines will reformat lines that are too long (in this case the line length is set to 100). The user simply enters ":GoFormat" and the formatting occurs. You can also set this to happen every time you save the file.

Goldsmith goformat example

Switch to alternate file / Generate stub tests

The following screencast first shows switching to the 'alternate' file using ":GoAlt!" (the exclamation point is needed since the alternate file does not yet exist). A window appears with a new buffer that can be used for editing the alternate file. The user then enters ":GoAddTest" which generates a new stub test for the function the cursor is currently on. The user enters ":e!" in the alternate window and the newly generated test appears. The user then enters ":GoAlt" to go back to the code file.

Goldsmith goformat example

GO TO PAGE 4 --->