aboutsummaryrefslogtreecommitdiff
path: root/doc/vertical_region.txt
blob: cc07b5db689aace02f78b6241287131721a40cd7 (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
*vertical_region.txt*	For Vim version 7.0	Last change: 2018 Aug 10

DESCRIPTION				*vertical_region*

This plugin provides 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.

REQUIREMENTS				*vertical_region-requirements*

This plugin only loads if 'compatible' is not set.

MAPPINGS				*vertical_region-mappings*

Six mappings are provided:

					*<Plug>(VerticalRegionUpNormal)*
`<Plug>(VerticalRegionUpNormal)` moves up to the previous line with non-space
characters before or in the current column, in normal mode.

					*<Plug>(VerticalRegionDownNormal)*
`<Plug>(VerticalRegionDownNormal)` moves down to the next line with non-space
characters before or in the current column, in normal mode.

					*<Plug>(VerticalRegionUpOperator)*
`<Plug>(VerticalRegionUpOperator)` moves up to the previous line with
non-space characters before or in the current column, in visual mode.

					*<Plug>(VerticalRegionDownOperator)*
`<Plug>(VerticalRegionDownOperator)` moves down to the next line with
non-space characters before or in the current column, in operating-pending
mode.

					*<Plug>(VerticalRegionUpVisual)*
`<Plug>(VerticalRegionUpVisual)` moves up to the previous line with non-space
characters before or in the current column, in visual mode.

					*<Plug>(VerticalRegionDownVisual)*
`<Plug>(VerticalRegionDownVisual)` moves down to the next line with non-space
characters before or in the current column, in visual mode.

All of them accept a [count] prefix to move by more than one matching line.

There are no default key mappings; you should define those yourself in your
|vimrc|. Here are the author's choices, using \{ and \} in all three modes:
>
	nmap <Bslash>{ <Plug>(VerticalRegionUpNormal)
	nmap <Bslash>} <Plug>(VerticalRegionDownNormal)
	omap <Bslash>{ <Plug>(VerticalRegionUpOperator)
	omap <Bslash>} <Plug>(VerticalRegionDownOperator)
	xmap <Bslash>{ <Plug>(VerticalRegionUpVisual)
	xmap <Bslash>} <Plug>(VerticalRegionDownVisual)
<
AUTHOR					*vertical_region-author*

Written and maintained by Tom Ryder <tom@sanctum.geek.nz>.

CREDITS					*vertical_region-credits*

Thanks to Antony in Freenode #vim for providing a working implementation of a
very similar approach for reference, and informing the choice of plugin name.

Antony has a funny habit of always already having written some form of what
you're currently writing in Vimscript.

LICENSE					*vertical_region-license*

Licensed for distribution under the same terms as Vim itself (see |license|).

 vim:tw=78:ts=8:ft=help:norl: