Today I Learned

hashrocket A Hashrocket project

vim-surround is different for selected text

If you tried using vim-surround after selecting text in visual mode, just to get your text deselected and have nothing happen, it's because visual mode uses a different trigger for vim-surround:

In visual mode use S, followed by your surrounding character (e.g. S)).

This is different from the normal mode way of doing it ys[text-object] (e.g. ysap{)

I like thinking of this one as "yes, surround! [my text object]" and prefer it to selecting, but some cases require visually selecting.

See More #vim TILs
Every developer at Hashrocket is a Vim expert. Check out our development environment, Dotmatrix, and if you are in Chicago, come to the Vim Chicago Meetup hosted at our Chicago office.