darrikonn / vim-gofmt

Minimal Vim Go formatter plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vim-gofmt

NOTE

The contents of this repo are pure copy-paste from the awesome vim-go repo.

The only differences is that vim-gofmt strips most of the functionality, leaving only go-fmt and go-imports (along with the binary setup commands) to format your code

The reason is simply that I personally don't like having my vim editor act like a fully fledged IDE with all of its features.

So if you want more features, please check out vim-go

Vim-go logo

Features

This plugin adds Go language support for Vim, with the following main features:

  • gofmt
  • goimports

Install

vim-gofmt requires at least Vim 8.0.1453 or Neovim 0.3.1.

vim-gofmt follows the standard runtime path structure. Below are some helper lines for popular package managers:

  • Vim 8 packages
    • git clone https://github.com/darrikonn/vim-gofmt.git ~/.vim/pack/plugins/start/vim-gofmt
  • Pathogen
    • git clone https://github.com/darrikonn/vim-gofmt.git ~/.vim/bundle/vim-gofmt
  • vim-plug
    • Plug 'darrikonn/vim-gofmt', { 'do': ':GoUpdateBinaries' }
  • Vundle
    • Plugin 'darrikonn/vim-gofmt'

You will also need to install all the necessary binaries. vim-gofmt makes it easy to install all of them by providing a command, :GoInstallBinaries, which will go install all the required binaries.

Usage

vim-gofmt exposes four commands:

  1. :GoFmt - to format your code
  2. :GoImports - to format/clean your imports
  3. :GoInstallBinaries - to install the required binaries
  4. :GoUpdateBinaries - to update the required binaries

License

The BSD 3-Clause License - see LICENSE for more details

About

Minimal Vim Go formatter plugin

License:Other


Languages

Language:Vim Script 100.0%