1 " NrrwRgn.vim - Narrow Region plugin for Vim
2 " -------------------------------------------------------------
4 " Maintainer: Christian Brabandt <cb@256bit.org>
5 " Last Change: Sat, 16 Feb 2013 22:28:31 +0100
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"
12 " No warranty, express or implied.
13 " *** *** Use At-Your-Own-Risk! *** ***
14 " GetLatestVimScripts: 3075 31 :AutoInstall: NrrwRgn.vim
22 if exists("g:loaded_nrrw_rgn") || &cp
26 let g:loaded_nrrw_rgn = 1
31 exe "call nrrwrgn#Debug(1)"
34 " ----------------------------------------------------------------------------
35 " Public Interface: {{{1
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
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>)
53 " Define the Mapping: "{{{2
54 if !hasmapto('<Plug>NrrwrgnDo')
55 xmap <unique> <Leader>nr <Plug>NrrwrgnDo
57 if !hasmapto('<Plug>NrrwrgnBangDo')
58 xmap <unique> <Leader>Nr <Plug>NrrwrgnBangDo
60 if !hasmapto('VisualNrrwRgn')
61 xnoremap <unique> <script> <Plug>NrrwrgnDo <sid>VisualNrrwRgn
63 if !hasmapto('VisualNrrwRgnBang')
64 xnoremap <unique> <script> <Plug>NrrwrgnBangDo <sid>VisualNrrwBang
66 xnoremap <sid>VisualNrrwRgn :<c-u>call nrrwrgn#VisualNrrwRgn(visualmode(),'')<cr>
67 xnoremap <sid>VisualNrrwBang :<c-u>call nrrwrgn#VisualNrrwRgn(visualmode(),'!')<cr>
72 " vim: ts=4 sts=4 fdm=marker com+=l\:\"