Are there any shortcuts to surround embedded Coffeescript (in eco templates) in VIM?
<%= @something %>
Whether in insert mode or not?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The surround plugin can do this. You will have to set up a custom replacement to do this. One of the examples in the surround help file actually does exactly what you want. The example says to add the line
to your
.vimrc.In this the
\ris the placeholder for whatever text you are surrounding and the61in the variable name means that ASCII character 61 will be the shortcut for this surround, which is=. To use this you then use one of surround’s bindings and type=as the surround character. For example the commandysiW=would surround the current word with<%= ... %>. Theyspart is the key binding to add surrounding text.iWis the motion that will be surrounded (it represents “inside word”) and then=is the surround to use, which here is set up to be a custom surround.