Find mappings for <ctrl>

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

Find mappings for <ctrl>

Oivvio Polite-2
:map S
 will show all mappings starting with W and
:map ,
 will show all mappings starting with ,

but how do I show all mappings starting with <ctrl> or <space> or
<escape>?

Oivvio

--
http://pipedreams.polite.se/about/


--
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
Reply | Threaded
Open this post in threaded view
|

Re: Find mappings for <ctrl>

Nikolay Aleksandrovich Pavlov
Ответ на сообщение «Find mappings for <ctrl>»,
присланное в 23:28:36 20 сентября 2010, Понедельник,
отправитель Oivvio Polite:

There are no mappings starting with <Ctrl>, you can have only mappings starting
with <C-something> (<C-something> sends one character). Mappings starting with
either <Space> and <escape> can be viewed using `map <Space> | map <Esc>' (if
you want to view both with one command).

Текст сообщения:

> :map S
>
>  will show all mappings starting with W and
>
> :map ,
>
>  will show all mappings starting with ,
>
> but how do I show all mappings starting with <ctrl> or <space> or
> <escape>?
>
> Oivvio

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Find mappings for <ctrl>

Oivvio Polite-2
On Tue, Sep 21, 2010 at 12:40:25AM +0400, ZyX wrote:
> There are no mappings starting with <Ctrl>, you can have only mappings starting
> with <C-something> (<C-something> sends one character). Mappings starting with
> either <Space> and <escape> can be viewed using `map <Space> | map <Esc>' (if
> you want to view both with one command).
>

Ok, say I want to find all mappings starting with <ctrl-w>. How would I
do that?

oivvio


--
http://pipedreams.polite.se/about/


--
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
Reply | Threaded
Open this post in threaded view
|

Re: Find mappings for <ctrl>

Asis Hallab
Use:
map <c-w>


cheers

2010/9/21 Oivvio Polite <[hidden email]>
On Tue, Sep 21, 2010 at 12:40:25AM +0400, ZyX wrote:
> There are no mappings starting with <Ctrl>, you can have only mappings starting
> with <C-something> (<C-something> sends one character). Mappings starting with
> either <Space> and <escape> can be viewed using `map <Space> | map <Esc>' (if
> you want to view both with one command).
>

Ok, say I want to find all mappings starting with <ctrl-w>. How would I
do that?

oivvio


--
http://pipedreams.polite.se/about/


--
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



--
Asis Hallab
Rothehausstr. 6 - 12
50823 Köln

Skype: asis.hallab.cgn
Fest (Köln) 42346046
Mobil  (O2) 0176 63370211
Fax 01212 - 5 - 30697106

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Find mappings for <ctrl>

Oivvio Polite-2
On Tue, Sep 21, 2010 at 11:07:22AM +0200, Asis Hallab wrote:
> Use:
> map <c-w>
>

That gives my "No mapping found" although all of the window handling
stuff is prefixed by <ctrl-w> as per default.

oivvio

--
http://pipedreams.polite.se/about/


--
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
Reply | Threaded
Open this post in threaded view
|

Re: Find mappings for <ctrl>

Nikolay Aleksandrovich Pavlov
Ответ на сообщение «Re: Find mappings for <ctrl>»,
присланное в 11:10:14 22 сентября 2010, Среда,
отправитель Oivvio Polite:

Map commands show only custom user mappings. If you want to list builtin
commands, use either tab completion on `:h CTRL-W' or `:helpgrep \*CTRL-W'. I do
not know any way to show both builtin commands and custom user mappings.

Текст сообщения:
> On Tue, Sep 21, 2010 at 11:07:22AM +0200, Asis Hallab wrote:
> > Use:
> > map <c-w>
>
> That gives my "No mapping found" although all of the window handling
> stuff is prefixed by <ctrl-w> as per default.
>
> oivvio

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Find mappings for <ctrl>

Christian Brabandt
In reply to this post by Oivvio Polite-2
Hi Oivvio!

On Mi, 22 Sep 2010, Oivvio Polite wrote:

> On Tue, Sep 21, 2010 at 11:07:22AM +0200, Asis Hallab wrote:
> > Use:
> > map <c-w>
> >
>
> That gives my "No mapping found" although all of the window handling
> stuff is prefixed by <ctrl-w> as per default.

These "mappings" are defined in the help:
:h windows.txt | g/^CTRL-W/,/^$/-p

regards,
Christian

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Find mappings for <ctrl>

Gary Johnson-4
In reply to this post by Oivvio Polite-2
On 2010-09-22, Oivvio Polite wrote:
> On Tue, Sep 21, 2010 at 11:07:22AM +0200, Asis Hallab wrote:
> > Use:
> > map <c-w>
> >
>
> That gives my "No mapping found" although all of the window handling
> stuff is prefixed by <ctrl-w> as per default.

You can find default key bindings documented here:

    :help index

The commands that begin with Ctrl-W are listed here:

    :help CTRL-W

Regards,
Gary

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Find mappings for <ctrl>

Bee-9
In reply to this post by Christian Brabandt
On Sep 22, 3:03 am, Christian Brabandt <[hidden email]> wrote:

> Hi Oivvio!
>
> On Mi, 22 Sep 2010, Oivvio Polite wrote:
>
> > On Tue, Sep 21, 2010 at 11:07:22AM +0200, Asis Hallab wrote:
> > > Use:
> > > map <c-w>
>
> > That gives my "No mapping found" although all of the window handling
> > stuff is prefixed by <ctrl-w> as per default.
>
> These "mappings" are defined in the help:
> :h windows.txt | g/^CTRL-W/,/^$/-p

ok, this is very cool
Please explain this part g/^CTRL-W/,/^$/-p

g/^CTRL-W/  global find all lines starting with CTRL-W

,           ??? additional items

/^$/        ??? empty lines

-p          open a new (tab?) page

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Find mappings for <ctrl>

Bee-9
On Sep 22, 11:38 am, Bee <[hidden email]> wrote:

> On Sep 22, 3:03 am, Christian Brabandt <[hidden email]> wrote:
>
> > Hi Oivvio!
>
> > On Mi, 22 Sep 2010, Oivvio Polite wrote:
>
> > > On Tue, Sep 21, 2010 at 11:07:22AM +0200, Asis Hallab wrote:
> > > > Use:
> > > > map <c-w>
>
> > > That gives my "No mapping found" although all of the window handling
> > > stuff is prefixed by <ctrl-w> as per default.
>
> > These "mappings" are defined in the help:
> > :h windows.txt | g/^CTRL-W/,/^$/-p
>
> ok, this is very cool
> Please explain this part g/^CTRL-W/,/^$/-p
>
> g/^CTRL-W/  global find all lines starting with CTRL-W
>
> ,           ??? additional items
>
> /^$/        ??? empty lines
>
> -p          open a new (tab?) page

I think I understand:

g/^CTRL-W/  global find all lines starting with CTRL-W

,           range

/^$/        until an empty line

-p          open a new (tab?) page

Still not sure about the -p because it does not look like it is open a
tab.

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Find mappings for <ctrl>

Bee-9
On Sep 22, 11:50 am, Bee <[hidden email]> wrote:

> On Sep 22, 11:38 am, Bee <[hidden email]> wrote:
> > On Sep 22, 3:03 am, Christian Brabandt <[hidden email]> wrote:
>
> > > Hi Oivvio!
>
> > > On Mi, 22 Sep 2010, Oivvio Polite wrote:
>
> > > > On Tue, Sep 21, 2010 at 11:07:22AM +0200, Asis Hallab wrote:
> > > > > Use:
> > > > > map <c-w>
>
> > > > That gives my "No mapping found" although all of the window handling
> > > > stuff is prefixed by <ctrl-w> as per default.
>
> > > These "mappings" are defined in the help:
> > > :h windows.txt | g/^CTRL-W/,/^$/-p
>
> > ok, this is very cool
> > Please explain this part g/^CTRL-W/,/^$/-p
>
> > g/^CTRL-W/  global find all lines starting with CTRL-W
>
> > ,           ??? additional items
>
> > /^$/        ??? empty lines
>
> > -p          open a new (tab?) page
>
> I think I understand:
>
> g/^CTRL-W/  global find all lines starting with CTRL-W
>
> ,           range
>
> /^$/        until an empty line
>
> -p          open a new (tab?) page
>
> Still not sure about the -p because it does not look like it is open a
> tab.

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

That makes more sense, but is it correct?

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Find mappings for <ctrl>

Nikolay Aleksandrovich Pavlov
Ответ на сообщение «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.

Текст сообщения:

> On Sep 22, 11:50 am, Bee <[hidden email]> wrote:
> > On Sep 22, 11:38 am, Bee <[hidden email]> wrote:
> > > On Sep 22, 3:03 am, Christian Brabandt <[hidden email]> wrote:
> > > > Hi Oivvio!
> > > >
> > > > On Mi, 22 Sep 2010, Oivvio Polite wrote:
> > > > > On Tue, Sep 21, 2010 at 11:07:22AM +0200, Asis Hallab wrote:
> > > > > > Use:
> > > > > > map <c-w>
> > > > >
> > > > > That gives my "No mapping found" although all of the window
> > > > > handling stuff is prefixed by <ctrl-w> as per default.
> > > >
> > > > These "mappings" are defined in the help:
> > > > :h windows.txt | g/^CTRL-W/,/^$/-p
> > >
> > > ok, this is very cool
> > > Please explain this part g/^CTRL-W/,/^$/-p
> > >
> > > g/^CTRL-W/  global find all lines starting with CTRL-W
> > >
> > > ,           ??? additional items
> > >
> > > /^$/        ??? empty lines
> > >
> > > -p          open a new (tab?) page
> >
> > I think I understand:
> >
> > g/^CTRL-W/  global find all lines starting with CTRL-W
> >
> > ,           range
> >
> > /^$/        until an empty line
> >
> > -p          open a new (tab?) page
> >
> > Still not sure about the -p because it does not look like it is open a
> > tab.
>
> 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
>
> That makes more sense, but is it correct?

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Find mappings for <ctrl>

Bee-9
On Sep 22, 12:42 pm, ZyX <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

Re: Find mappings for <ctrl>

Benjamin Fritz
In reply to this post by Nikolay Aleksandrovich Pavlov


On Sep 22, 3:14 am, ZyX <[hidden email]> wrote:
>
> Map commands show only custom user mappings. If you want to list builtin
> commands, use either tab completion on `:h CTRL-W' or `:helpgrep \*CTRL-W'.

Or potentially even better, type :h CTRL-W (9 keystrokes) and then hit
CTRL-D (two keystrokes). This will give you a list of all the matches
including CTRL-W in the :help (there are many).

> I do
> not know any way to show both builtin commands and custom user mappings.
>

That's because there is no way to do this with a single built-in
command.

--
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