Skip to content

Commit

Permalink
Add :GoAddTags transform (#1275)
Browse files Browse the repository at this point in the history
* Add option to enable gomodifytags camelcase
  • Loading branch information
riesinger authored and fatih committed May 7, 2017
1 parent 8532385 commit f655460
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 2 additions & 0 deletions autoload/go/tags.vim
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,13 @@ func s:create_cmd(args) abort
let l:offset = a:args.offset
let l:mode = a:args.mode
let l:cmd_args = a:args.cmd_args
let l:modifytags_transform = get(g:, 'go_addtags_transform', "snakecase")

" start constructing the command
let cmd = [bin_path]
call extend(cmd, ["-format", "json"])
call extend(cmd, ["-file", a:args.fname])
call extend(cmd, ["-transform", l:modifytags_transform])

if l:offset != 0
call extend(cmd, ["-offset", l:offset])
Expand Down
16 changes: 13 additions & 3 deletions doc/vim-go.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ command.
Plugin 'fatih/vim-go'
* Vim |packages|
* Vim |packages|
>
git clone https://github.com/fatih/vim-go.git \
~/.vim/pack/plugins/start/vim-go
Expand Down Expand Up @@ -219,7 +219,7 @@ COMMANDS *go-commands*
If [!] is not given the first error is jumped to.

*:GoDef*
:GoDef
:GoDef
gd
CTRL-]

Expand Down Expand Up @@ -605,7 +605,7 @@ CTRL-t
Changes the build tags for various commands. If you have any file that
uses a custom build tag, such as `//+build integration` , this command can
be used to pass it to all tools that accepts tags, such as guru, gorenate,
etc..
etc..

The build tags is cleared (unset) if `""` is given. If no arguments is
given it prints the current custom build tags.
Expand Down Expand Up @@ -1553,6 +1553,16 @@ default it's 60 seconds. Must be in milliseconds.
>
let g:go_statusline_duration = 60000
<

*'g:go_addtags_transform'*

Sets the `transform` option for `gomodifytags` when using |:GoAddTags|.
Possible options are: `snakecase`, `camelcase`. By default it is set to
`snakecase`.
>
let g:go_addtags_transform = 'snakecase'
<

==============================================================================
DEVELOPMENT *go-development*

Expand Down

0 comments on commit f655460

Please sign in to comment.