Wednesday, September 22, 2010

Re: Find mappings for

On Sep 22, 12:42 pm, ZyX <zyx....@gmail.com> wrote:
> Ответ на сообщение <<Re: Find mappings for <ctrl>>>,
> присланное в 23:17:14 22 сентября 2010, Среда,
> отправитель Bee:
>
> > Still not sure about the -p because it does not look like it is open a
> > tab.
>
> > --OR--
>
> > Is this:
>
> > - move one line upward
> > p Put the text after the cursor
>
> No, see :h :p. :{range}p is equivalent to
> :echo join(getline(startline, endline), "\n").
> `-' is just a shortcut to `-1', so `,/^$/-' means
> ``from the current line to the line before next empty line''.
> See `:h cmdline-ranges' if you want to write stuff like this.

Ah, yes, thank you.

:[range]p[rint] [flags]
Print [range] lines (default current line).
Note: If you are looking for a way to print your text
on paper see |:hardcopy|. In the GUI you can use the
File.Print menu entry.
See |ex-flags| for [flags].

5. Ex command-line flags *ex-flags*
These flags are supported by a selection of Ex commands. They print
the line
that the cursor ends up after executing the command:
l output like for |:list|
# add line number
p output like for |:print|

I added an ex-flag to show line numbers:

:h windows.txt | g/^CTRL-W/,/^$/-p#

Then I noticed that many lines are repeated:

132 CTRL-W s *CTRL-
W_s*
133 CTRL-W S *CTRL-W_S*
134 CTRL-W CTRL-S *CTRL-
W_CTRL-S*
135 :[N]sp[lit] [++opt] [+cmd] *:sp*
*:split*
136 Split current window in two. The result is two
viewports on
137 the same file. Make new window N high (default is
to use half
138 the height of the current window). Reduces the
current window
139 height to create room (and others, if the
'equalalways' option
140 is set, 'eadirection' isn't "hor", and one of them
is higher
141 than the current or the new window).
142 Note: CTRL-S does not work on all terminals and
might block
143 further input, use CTRL-Q to get going again.
144 Also see |++opt| and |+cmd|.
133 CTRL-W S *CTRL-W_S*
134 CTRL-W CTRL-S *CTRL-
W_CTRL-S*
135 :[N]sp[lit] [++opt] [+cmd] *:sp*
*:split*
136 Split current window in two. The result is two
viewports on
137 the same file. Make new window N high (default is
to use half
138 the height of the current window). Reduces the
current window
139 height to create room (and others, if the
'equalalways' option
140 is set, 'eadirection' isn't "hor", and one of them
is higher
141 than the current or the new window).
142 Note: CTRL-S does not work on all terminals and
might block
143 further input, use CTRL-Q to get going again.
144 Also see |++opt| and |+cmd|.
134 CTRL-W CTRL-S *CTRL-
W_CTRL-S*
135 :[N]sp[lit] [++opt] [+cmd] *:sp*
*:split*
136 Split current window in two. The result is two
viewports on
137 the same file. Make new window N high (default is
to use half
138 the height of the current window). Reduces the
current window
139 height to create room (and others, if the
'equalalways' option
140 is set, 'eadirection' isn't "hor", and one of them
is higher
141 than the current or the new window).
142 Note: CTRL-S does not work on all terminals and
might block
143 further input, use CTRL-Q to get going again.
144 Also see |++opt| and |+cmd|.

How can it be rewritten to eliminate the repetition?

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment