Skip to content

Commit c8fe9c7

Browse files
AndrewRadevdsymonds
authored andcommitted
misc/vim: fix reimport guard and remove K mapping.
The "did_ftplugin" lines were ineffective and the "K" mapping was too invasive, which is why it was removed. R=golang-dev, dsymonds, minux.ma CC=golang-dev https://golang.org/cl/6823044
1 parent 63c6b3c commit c8fe9c7

File tree

4 files changed

+8
-15
lines changed

4 files changed

+8
-15
lines changed

misc/vim/ftplugin/go/fmt.vim

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
" It tries to preserve cursor position and avoids
1313
" replacing the buffer with stderr output.
1414
"
15+
if exists("b:did_ftplugin_go_fmt")
16+
finish
17+
endif
1518

1619
command! -buffer Fmt call s:GoFormat()
1720

@@ -41,4 +44,6 @@ function! s:GoFormat()
4144
call winrestview(view)
4245
endfunction
4346

47+
let b:did_ftplugin_go_fmt = 1
48+
4449
" vim:ts=4:sw=4:et

misc/vim/ftplugin/go/godoc.vim

Lines changed: 0 additions & 13 deletions
This file was deleted.

misc/vim/ftplugin/go/import.vim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
" The backslash is the default maplocalleader, so it is possible that
3333
" your vim is set to use a different character (:help maplocalleader).
3434
"
35-
if exists("b:did_ftplugin")
35+
if exists("b:did_ftplugin_go_import")
3636
finish
3737
endif
3838

@@ -228,4 +228,6 @@ function! s:Error(s)
228228
echohl Error | echo a:s | echohl None
229229
endfunction
230230

231+
let b:did_ftplugin_go_import = 1
232+
231233
" vim:ts=4:sw=4:et

misc/vim/readme.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,4 @@ To install godoc plugin:
7272
1. Same as 1 above.
7373
2. Copy or link plugin/godoc.vim to $HOME/.vim/plugin/godoc,
7474
syntax/godoc.vim to $HOME/.vim/syntax/godoc.vim,
75-
ftplugin/go/godoc.vim to $HOME/.vim/ftplugin/go/godoc.vim.
7675
and autoload/go/complete.vim to $HOME/.vim/autoload/go/complete.vim.

0 commit comments

Comments
 (0)