tpope / vim-surround

surround.vim: Delete/change/add parentheses/quotes/XML-tags/much more with ease
https://www.vim.org/scripts/script.php?script_id=1697
13.35k stars 443 forks source link

[Feature]: Surround 'if' statement #5

Closed bogdan closed 14 years ago

bogdan commented 14 years ago

An idea to have the 'sif' command that surrounds selected text with if conditional statement like

Ruby example. Before: article.publish!

After: if article.publish! end

The problem is that it depends on the current buffer file type e.g. Ruby, ERB, JavaScrit etc. Is that possible to implement with surround.vim?

graywh commented 14 years ago

You should read the help on |surround-customizing|.

tpope commented 14 years ago

Yes, the referenced help does explain how to do custom surroundings on a per file-type basis.