Monday, September 21, 2015

Re: Weird 's' command behavior.

2015-09-21 1:55 GMT+03:00 sycc <sycc90@mail.com>:
> Greetings everyone!
> So far I've always managed to google my way out of whatever came up in vim,
> but this time I have no idea what's going on and would really appreciate
> some help.
>
> A couple of days ago I've started noticing some weird behavior with the 's'
> command. I'd be using vim for a couple of minutes, maybe even hours, and
> suddenly this would start happening. When I hit the 's' key expecting to
> replace ONE character and go into insert mode, it would replace TWO
> characters instead. Pretty much the same that would happen if you hit '2s'
> instead, which I'm certain I did not.
> Once this is happening, if I enter '2s' it would replace 3 characters
> instead of 2, and '3s' would 4. As far as I'm aware there's no configuration
> that can be done for the 's' command that would cause this behavior... at
> least I haven't found it, that's why I'm here after all. The only way to go
> back is restarting vim.
> I haven't changed anything in my .vimrc file, it's been pretty much the same
> for months now so that can't really be it.
>
> I can only imagine I'm accidentally hitting some kind of sequence that
> causes this... but I can't for the life of me figure out what. Not to
> mention that I'm not using the 's' command *all* the time, so if that's
> indeed the case I might not even notice until quite a while later.

First thing you should check is that such behaviour is not triggered
when you press `s` when Vim is launched using

vim -u NONE -i NONE -N

. Second is the same thing, but with `-u NORC` (`-u NONE` disables
sourcing anything, including vimrc and plugins, NORC disables only
vimrc).

After this check what `verbose nmap s` reports: it normally should
report "No mapping found". `verbose` will tell you where the mapping
is defined if the problem is some mapping using `s` key. There is no
need to configure `s` command: you can use mappings to replace `s`
command with *any* other command or command sequence with any
behaviour.

>
> So here I am asking all of you nice people for help =)
> 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 vim_use+unsubscribe@googlegroups.com.
> 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 vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: