Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim-surround not working for me. s key deletes instead of surrounds

Tags:

vim

vim-plugin

Just installed the surround plugin.

New buffer, type Hello World. Say I want to surround that with quotes.

In normal mode, V to get into visual mode, s to get into surround

Except it doesn't, s deletes the entire line.

like image 939
Bob Avatar asked Nov 21 '12 16:11

Bob


2 Answers

The default visual mode mapping of surround.vim is Shift-S, not lowercase s.

You can check whether it's defined with :verbose vmap S. Do the other surround.vim mappings (ys, cs, ...) work? If not, check :scriptnames and :set runtimepath? for troubleshooting.

like image 190
Ingo Karkat Avatar answered Sep 28 '22 06:09

Ingo Karkat


This can also be a key binding collision with the yankstack plugin. To fix it, append call yankstack#setup() to your .vimrc file. For more info, see the discussion on GitHub.

like image 31
Jay B. Martin Avatar answered Sep 28 '22 06:09

Jay B. Martin