source: contrib/mpvim/ftplugin/portfile.vim @ 61336

Last change on this file since 61336 was 61336, checked in by mnick@…, 8 years ago
  • new MPpatch command to show vimdiffs for patches hosted on trac
  • MPpatch documentation
File size: 873 bytes
Line 
1" ============================================================================
2" Vim filetype plugin for portfile
3" Maintainer: Maximilian Nickel <mnick@macports.org>
4" ============================================================================
5
6if exists("b:did_ftplugin")
7        finish
8endif
9let b:did_ftplugin = 1
10
11if !exists("g:did_mpftplugin") 
12        function PortfileGetErrors()
13                if !empty(getqflist())
14                        exe "copen"
15                end
16        endfunction
17
18        function TracPatch(url)
19                let patchfile="$TMPDIR/portfile.patch"
20                let url = substitute(a:url, "/attachment/", "/raw-attachment/", "")
21                let cmd = "!curl --progress-bar -o \"" . patchfile . "\" \"" . url . "\""
22                exe cmd
23                exe "diffpatch " . patchfile
24        endfunction
25
26        let g:did_mpftplugin = 1
27endif
28
29au QuickFixCmdPre make exe "cclose"
30au QuickFixCmdPost make call PortfileGetErrors()
31command! -nargs=1 MPpatch :call TracPatch("<args>") 
Note: See TracBrowser for help on using the repository browser.