Fix missing slashes in short dir.
[profile.git] / .vim / plugin / NrrwRgn.vim
1 " NrrwRgn.vim - Narrow Region plugin for Vim
2 " -------------------------------------------------------------
3 " Version:         0.31
4 " Maintainer:  Christian Brabandt <cb@256bit.org>
5 " Last Change: Sat, 16 Feb 2013 22:28:31 +0100
6 "
7 " Script: http://www.vim.org/scripts/script.php?script_id=3075
8 " Copyright:   (c) 2009, 2010 by Christian Brabandt
9 "                          The VIM LICENSE applies to histwin.vim
10 "                          (see |copyright|) except use "NrrwRgn.vim"
11 "                          instead of "Vim".
12 "                          No warranty, express or implied.
13 "        *** ***   Use At-Your-Own-Risk!   *** ***
14 " GetLatestVimScripts: 3075 31 :AutoInstall: NrrwRgn.vim
15 "
16 " Init: {{{1
17 if version < 702
18   finish
19 endif
20
21 let s:cpo= &cpo
22 if exists("g:loaded_nrrw_rgn") || &cp
23   finish
24 endif
25 set cpo&vim
26 let g:loaded_nrrw_rgn = 1
27
28 " Debug Setting
29 let s:debug=0
30 if s:debug
31         exe "call nrrwrgn#Debug(1)"
32 endif
33
34 " ----------------------------------------------------------------------------
35 " Public Interface: {{{1
36
37 " Define the Command aliases "{{{2
38 com! -range -bang NRPrepare :<line1>,<line2>NRP<bang>
39 com! -range NarrowRegion :<line1>,<line2>NR
40 com! -bang NRMulti :NRM<bang>
41 com! -bang NarrowWindow :NW
42 com! -bang NRLast :NRL
43
44 " Define the actual Commands "{{{2
45 com! -range -bang NR     :<line1>, <line2>call nrrwrgn#NrrwRgn(<q-bang>)
46 com! -range NRP  :exe ":" . <line1> . ',' . <line2> . 'call nrrwrgn#Prepare()'
47 com! -bang -range NRV :call nrrwrgn#VisualNrrwRgn(visualmode(), <q-bang>)
48 com! NUD :call nrrwrgn#UnifiedDiff()
49 com! -bang NW    :exe ":" . line('w0') . ',' . line('w$') . "call nrrwrgn#NrrwRgn(<q-bang>)"
50 com! -bang NRM :call nrrwrgn#NrrwRgnDoPrepare(<q-bang>)
51 com! -bang NRL :call nrrwrgn#LastNrrwRgn(<q-bang>)
52
53 " Define the Mapping: "{{{2
54 if !hasmapto('<Plug>NrrwrgnDo')
55         xmap <unique> <Leader>nr <Plug>NrrwrgnDo
56 endif
57 if !hasmapto('<Plug>NrrwrgnBangDo')
58         xmap <unique> <Leader>Nr <Plug>NrrwrgnBangDo
59 endif
60 if !hasmapto('VisualNrrwRgn')
61         xnoremap <unique> <script> <Plug>NrrwrgnDo <sid>VisualNrrwRgn
62 endif
63 if !hasmapto('VisualNrrwRgnBang')
64         xnoremap <unique> <script> <Plug>NrrwrgnBangDo <sid>VisualNrrwBang
65 endif
66 xnoremap <sid>VisualNrrwRgn :<c-u>call nrrwrgn#VisualNrrwRgn(visualmode(),'')<cr>
67 xnoremap <sid>VisualNrrwBang :<c-u>call nrrwrgn#VisualNrrwRgn(visualmode(),'!')<cr>
68
69 " Restore: "{{{1
70 let &cpo=s:cpo
71 unlet s:cpo
72 " vim: ts=4 sts=4 fdm=marker com+=l\:\"