Character s is not work on vim maps

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

Character s is not work on vim maps

吴江
Hi,

When I use noremap <C-S> :update<CR> to map ctrl-s to save file, it's not work, and I use noremap <C-S-l> :update<CR> to map ctrl-shift-s works, since character s is not work and s will be translate only into shift in map? Thanks.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Character s is not work on vim maps

Charles E Campbell Jr
Hello-I suspect you're using vim (as opposed to gvim) - and your terminal is taking the ctrl-s.

C Campbell

> On Oct 24, 2015, at 7:05 AM, 吴江 <[hidden email]> wrote:
>
> Hi,
>
> When I use noremap <C-S> :update<CR> to map ctrl-s to save file, it's not work, and I use noremap <C-S-l> :update<CR> to map ctrl-shift-s works, since character s is not work and s will be translate only into shift in map? Thanks.
>
> --
> --
> 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
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> For more options, visit https://groups.google.com/d/optout.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Character s is not work on vim maps

Sven Guckes-3
* 吴江 <[hidden email]>:
> When I use noremap <C-S> :update<CR> to map ctrl-s to save file,
> it's not work, and I use noremap <C-S-l> :update<CR> to
> map ctrl-shift-s works, since character s is not work
> and s will be translate only into shift in map? Thanks.

* Dr. Charles E. Campbell, Jr. <[hidden email]> [2015-10-25 00:49]:
> Hello-I suspect you're using vim (as opposed to gvim) -
> and your terminal is taking the ctrl-s.

that's what i thought, too.  but why does c-s-l work then?

anyway.. wujiangthu - it's not the 's' that doesnt work -
it is the CTRL-S which has a special meaning for terminals.
the CTRL-S is usually the "stop" command for them.
so the terminal "eats" it before vim gets to see it.

if you do use vim within a terminal then you
can unset the "stop" which CTRL-S gives it:
    $ stty stop ""

now start vim and you will see that when you switch
to insert mode and type CTRL-S that a "^S" shows up.

however, you might want stop+start with CTRL-S
and CTRL-Q in your terminal at times.  if so then
consider mapping command to other key combinations.

as the comma is on the same key with
DE+EN layouts i use ",," for updating:
    map ,, :upd<cr>

Sven

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Character s is not work on vim maps

Christian Brabandt
Hi Sven!

On So, 25 Okt 2015, Sven Guckes wrote:

> * 吴江 <[hidden email]>:
> > When I use noremap <C-S> :update<CR> to map ctrl-s to save file,
> > it's not work, and I use noremap <C-S-l> :update<CR> to
> > map ctrl-shift-s works, since character s is not work
> > and s will be translate only into shift in map? Thanks.
>
> * Dr. Charles E. Campbell, Jr. <[hidden email]> [2015-10-25 00:49]:
> > Hello-I suspect you're using vim (as opposed to gvim) -
> > and your terminal is taking the ctrl-s.
>
> that's what i thought, too.  but why does c-s-l work then?

I believe this is parsed as Ctrl-Shift-L, e.g. Ctrl-L


Best,
Christian
--
Das einzige Mittel, den Irrtum zu vermeiden, ist die Unwissenheit.
                -- Jean Jacques Rousseau

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Character s is not work on vim maps

Tony Mechelynck
In reply to this post by Sven Guckes-3
On Sun, Oct 25, 2015 at 1:00 AM, Sven Guckes <[hidden email]> wrote:

> * 吴江 <[hidden email]>:
>> When I use noremap <C-S> :update<CR> to map ctrl-s to save file,
>> it's not work, and I use noremap <C-S-l> :update<CR> to
>> map ctrl-shift-s works, since character s is not work
>> and s will be translate only into shift in map? Thanks.
>
> * Dr. Charles E. Campbell, Jr. <[hidden email]> [2015-10-25 00:49]:
>> Hello-I suspect you're using vim (as opposed to gvim) -
>> and your terminal is taking the ctrl-s.
>
> that's what i thought, too.  but why does c-s-l work then?
>
> anyway.. wujiangthu - it's not the 's' that doesnt work -
> it is the CTRL-S which has a special meaning for terminals.
> the CTRL-S is usually the "stop" command for them.
> so the terminal "eats" it before vim gets to see it.
>
> if you do use vim within a terminal then you
> can unset the "stop" which CTRL-S gives it:
>     $ stty stop ""
>
> now start vim and you will see that when you switch
> to insert mode and type CTRL-S that a "^S" shows up.
>
> however, you might want stop+start with CTRL-S
> and CTRL-Q in your terminal at times.  if so then
> consider mapping command to other key combinations.

Yes, I recommend using the F keys (except <F1> = Help and sometimes
<F10> = Menu), with or without Shift, as {lhs} for mappings, because
they don't have a default binding. (On Linux, at least, Ctrl-Fn
combinations are usually preempted by the window manager; and
Ctrl-Alt-Fn, or Alt-Fn in non-X11 consoles, switch virtual consoles.)
Twelve F keys, times two for shift or no shift, minus two already
defined, that's a total of 22 keys available for mapping: one for
every Hebrew letter or Tarot arcana ;-)

>
> as the comma is on the same key with
> DE+EN layouts i use ",," for updating:
>     map ,, :upd<cr>

I use F3 to "save all my work":
    map <F3> :wa|wv<CR>
    map! <F3> <C-O>:wa|wv<CR>

This, of course, needs care: if a file mustn't be modified on disk, it
has become second nature to me to open it with :view or :sview, not
:edit or :new, so that any attempt to write it this way causes an
error.

>
> Sven
>


Best regards,
Tony.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.