aboutsummaryrefslogtreecommitdiff
path: root/plugin/vertical_region.vim
blob: cd7caa159bc2dc99ece5f70c725f11e5392ca79b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"
" vertical_region.vim: Mapping targets to move up or down to lines that have
" non-space characters before or in the current column, usually to find lines
" that begin or end blocks in languages where indenting is used to show or
" specify structure.
"
" Author: Tom Ryder <tom@sanctum.geek.nz>
" License: Same as Vim itself
"
if exists('loaded_vertical_region') || &compatible
  finish
endif
if v:version < 700
  finish
endif
let loaded_vertical_region = 1

" Define plugin maps
nnoremap <silent> <Plug>(VerticalRegionUp)
      \ :<C-U>call vertical_region#(v:count1, 1, 'n')<CR>
nnoremap <silent> <Plug>(VerticalRegionDown)
      \ :<C-U>call vertical_region#(v:count1, 0, 'n')<CR>
onoremap <silent> <Plug>(VerticalRegionUp)
      \ :<C-U>call vertical_region#(v:count1, 1, 'o')<CR>
onoremap <silent> <Plug>(VerticalRegionDown)
      \ :<C-U>call vertical_region#(v:count1, 0, 'o')<CR>
xnoremap <silent> <Plug>(VerticalRegionUp)
      \ :<C-U>call vertical_region#(v:count1, 1, 'x')<CR>
xnoremap <silent> <Plug>(VerticalRegionDown)
      \ :<C-U>call vertical_region#(v:count1, 0, 'x')<CR>