diff options
author | Franck Cuny <franckcuny@gmail.com> | 2016-01-17 07:17:17 -0800 |
---|---|---|
committer | Franck Cuny <franckcuny@gmail.com> | 2016-01-17 07:17:17 -0800 |
commit | e58a6497d050480c56b9689004b9ded1cc2b0b9d (patch) | |
tree | 291b4ae5b114d06d96498f2312a9ab3e466ca501 /vim/ftplugin/go/fmt.vim | |
parent | [emacs] some small changes to the UI. (diff) | |
download | emacs.d-e58a6497d050480c56b9689004b9ded1cc2b0b9d.tar.gz |
Remove configuration for `vim` and all the scripts
No need to carry a configuration for `vim` anymore, and most of the scripts are either useless, or have moved to the *toolbox* repository on GitHub (and are now in go, and sometimes with tests).
Diffstat (limited to '')
-rw-r--r-- | vim/ftplugin/go/fmt.vim | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/vim/ftplugin/go/fmt.vim b/vim/ftplugin/go/fmt.vim deleted file mode 100644 index 359545b..0000000 --- a/vim/ftplugin/go/fmt.vim +++ /dev/null @@ -1,69 +0,0 @@ -" Copyright 2011 The Go Authors. All rights reserved. -" Use of this source code is governed by a BSD-style -" license that can be found in the LICENSE file. -" -" fmt.vim: Vim command to format Go files with gofmt. -" -" This filetype plugin add a new commands for go buffers: -" -" :Fmt -" -" Filter the current Go buffer through gofmt. -" It tries to preserve cursor position and avoids -" replacing the buffer with stderr output. -" -" Options: -" -" g:go_fmt_commands [default=1] -" -" Flag to indicate whether to enable the commands listed above. -" -" g:gofmt_command [default="gofmt"] -" -" Flag naming the gofmt executable to use. -" -if exists("b:did_ftplugin_go_fmt") - finish -endif - -if !exists("g:go_fmt_commands") - let g:go_fmt_commands = 1 -endif - -if !exists("g:gofmt_command") - let g:gofmt_command = "gofmt" -endif - -if g:go_fmt_commands - command! -buffer Fmt call s:GoFormat() -endif - -function! s:GoFormat() - let view = winsaveview() - silent execute "%!" . g:gofmt_command - if v:shell_error - let errors = [] - for line in getline(1, line('$')) - let tokens = matchlist(line, '^\(.\{-}\):\(\d\+\):\(\d\+\)\s*\(.*\)') - if !empty(tokens) - call add(errors, {"filename": @%, - \"lnum": tokens[2], - \"col": tokens[3], - \"text": tokens[4]}) - endif - endfor - if empty(errors) - % | " Couldn't detect gofmt error format, output errors - endif - undo - if !empty(errors) - call setqflist(errors, 'r') - endif - echohl Error | echomsg "Gofmt returned error" | echohl None - endif - call winrestview(view) -endfunction - -let b:did_ftplugin_go_fmt = 1 - -" vim:ts=4:sw=4:et |