Skip to content

Latest commit

 

History

History
51 lines (33 loc) · 1.64 KB

README.md

File metadata and controls

51 lines (33 loc) · 1.64 KB

go-add-tags.el travis badge melpa badge melpa stable badge

Add field tags for struct fields. This package is inspired by GoAddTags of vim-go.

Screencast

Screencast of go-add-tags. Insert tags for struct fields with M-x go-add-tags

Installation

go-add-tags is available on MELPA and MELPA stable

You can install go-add-tags with the following command.

M-x package-install [RET] go-add-tags [RET]

Interfaces

go-add-tags

Insert tag at current line. You can input multiple tags at once by comma, like json,yaml. If region is enabled, then tags are inserted in lines in region. And current-prefix-key is specified, then you can choose field style function.

Customization

go-add-tags-style(Default: 'snake-case)

How to convert field in tag from field name.

  • snake-case
  • lower-camel-case
  • upper-camel-case
  • original

Sample Configuration

(custom-set-variables
 '(go-add-tags-style 'lower-camel-case))

(with-eval-after-load 'go-mode
  (define-key go-mode-map (kbd "C-c t") #'go-add-tags))