Skip to content

irfansharif/vim-crlfmt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

vim-crlfmt

Vim plugin for crlfmt, a gofmt-style linter for Go code that enforces the CockroachDB Style Guide found here. Heavily borrowed implementation from fatih/vim-go and fatih/vim-hclfmt.

The plugin by default will format *.go files on save, ignoring *.pb.go and *.pb.gw.go. Under the hood it uses crlfmt to process the files.

Usage

Save the file or call :Crlfmt.

By default vim-crlfmt automatically formats *.go files, ignoring *.pb.go and *.pb.gw.go files, tab width for column calculations used is 2.

" Turn off autosave formatting
g:crlfmt_autosave = 0 [default = 1]

" Options to pass to crlfmt
g:crlfmt_options = '' [default = '-ignore ".*.pb(.gw)?.go -tab 2"']

" Don't display error message if crlfmt fails
g:crlfmt_fail_silently = 1 [default = 0]

Install

Vim-crlfmt follows the standard runtime path structure. For Pathogen just clone the repo. For other plugin managers add the appropriate lines and execute the plugin's install command.

  • Pathogen
  • git clone https://github.com/irfansharif/vim-crlfmt.git ~/.vim/bundle/vim-crlfmt
  • vim-plug
  • Plug 'irfansharif/vim-crlfmt'
  • NeoBundle
  • NeoBundle 'irfansharif/vim-crlfmt'
  • Vundle
  • Plugin 'irfansharif/vim-crlfmt'

About

Vim plugin for cockroachdb/crlfmt

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published