[libcode-tidyall-perl] 310/374: add

Jonas Smedegaard js at alioth.debian.org
Sun Sep 29 22:26:41 UTC 2013


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository libcode-tidyall-perl.

commit e9589845b09a9381efa8824dba3a8902e06b4659
Author: Jonathan Swartz <swartz at pobox.com>
Date:   Tue Oct 9 22:26:02 2012 -0700

    add
---
 etc/editors/tidyall.vim |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/etc/editors/tidyall.vim b/etc/editors/tidyall.vim
new file mode 100644
index 0000000..7dacd7d
--- /dev/null
+++ b/etc/editors/tidyall.vim
@@ -0,0 +1,22 @@
+" Run tidyall on the current buffer. If an error occurs, show it and leave it
+" in tidyall.ERR, and undo any changes.
+
+command! TidyAll :call TidyAll()
+function! TidyAll()
+    let cur_pos = getpos( '.' )
+    let cmdline = ':1,$!tidyall --mode editor --pipe %:p 2> tidyall.ERR'
+    execute( cmdline )
+    if v:shell_error
+        echo "\nContents of tidyall.ERR:\n\n" . system( 'cat tidyall.ERR' )
+        silent undo
+    else
+        call system( 'rm tidyall.ERR' )
+    endif
+    call setpos( '.', cur_pos )
+endfunction
+
+" Uncomment to set leader to ,
+" let mapleader = ','
+
+" Bind to ,t (or leader+t)
+map <leader>t :TidyAll<cr>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libcode-tidyall-perl.git



More information about the Pkg-perl-cvs-commits mailing list