From f6554604f77975a602ac73e16f48a1969f36dd90 Mon Sep 17 00:00:00 2001 From: Pascal Riesinger Date: Sun, 7 May 2017 11:26:24 +0200 Subject: [PATCH] Add :GoAddTags transform (#1275) * Add option to enable gomodifytags camelcase --- autoload/go/tags.vim | 2 ++ doc/vim-go.txt | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/autoload/go/tags.vim b/autoload/go/tags.vim index 4ef7d282f5..fecf52e3a9 100644 --- a/autoload/go/tags.vim +++ b/autoload/go/tags.vim @@ -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]) diff --git a/doc/vim-go.txt b/doc/vim-go.txt index 894ba09737..2bdd196ad3 100644 --- a/doc/vim-go.txt +++ b/doc/vim-go.txt @@ -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 @@ -219,7 +219,7 @@ COMMANDS *go-commands* If [!] is not given the first error is jumped to. *:GoDef* -:GoDef +:GoDef gd CTRL-] @@ -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. @@ -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*