Monday, September 21, 2015

Re: Weird 's' command behavior.

Hello everyone, thank you for your responses!

That's what's weird actually, I've been using the same vimrc file for
years (just minor tweaks here and there) and never experienced such
behavior. I'm sure there's nothing mapped to 's', but just to be certain
'verbose nmap s' reporst "No mapping found".
This does *not* happen as soon as I start vim, it's from minutes to
hours after having been using it... and that's really a problem because
it's hard to diagnose. I've made a quick test with both commands you've
suggested and haven't noticed the problem yet, but I'll have to use it
more extensively tonight before I can really comment on it.

Given all that, I was left thinking I might be accidentally hitting some
command sequence that would change its behavior, I'm breaking in a new
keyboard and making quite a bit of mistakes while typing so it's a
possibility I think... I didn't try to nmap the 's' when it happens
though, so next time it does that'll be the very first thing I do.

Thank you all for the advice! I'll let you know what happens but I'm not
holding my breath for it being in the vimrc =P


On 09/21/2015 04:58 AM, Nikolay Pavlov wrote:
> 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: