Reputation: 800
s
in command mode normally deletes the character under the cursor and enters Insert mode. But typing s
now opens a prompt like this (in the lower-left corner)
>
instead of the usual substitution mode.
What I checked:
No keys are being remapped in .vimrc
:map s
shows:
x s <Plug>Sneak_s n s <Plug>Sneak_s
Is that remapping x-s or s?
Edit: I am using the vundle plugin manager. And removing this line from .vimrc solves the problem.
call vundle#end()
Edit 2: As @yolenoyer notes, the vundle#end() is required, or all plugins are disabled. Using that advice, narrows it down to the vim-sneak plugin which even says in it's documentation:
Upvotes: 1
Views: 945
Reputation: 9445
I don't see any other way than mapping to alter the behaviour of s
normal command.
Are you really sure there's no mapping? Please check again your mappings, by running the following command:
:map s
Don't remove the call vundle#end()
line in your .vimrc
: it will disable all the plugins you installed.
Instead, try to comment each plugin listed just before this line (lines beginning with Plugin
), each time launching vim again to check if the behaviour changed.
When you type s
in normal mode, you don't enter in any 'substitution' mode, but in insert
mode after having deleted one (or more) char(s) in front of the cursor.
The confusion you make by using the word 'substitution' (in your title and your question content) is
problematic because it makes people think you're talking about the :s
command (which can be really
called ... the substitute command!)
Upvotes: 1
Reputation: 1358
Vim's search and replace (substitute) does not require any additional module or mapping in .vimrc
. You can simply use :%s/foo/bar/g
to replace any instance of foo
with bar
. For more information checkout here.
Note that substitute command s
without :
(normal command) which may be prefixed with a number x
, deletes x
characters and switches to insert mode.
Upvotes: 0