I'm trying to configure the NERDCommenter plugin to handle multiline ruby comments (i.e., nested inside =begin
and =end
).
The relevant setting is something like this:
let g:NERDCustomDelimiters = {
\ 'ruby': {'left': '# ', 'leftAlt': "=begin\n", 'rightAlt': "\n=end" }
\ }
except this gives me the ^@
control character instead of an actual newline.
Found this in a primer on vimscript
Note that strings can be specified with either double-quotes or single-quotes as delimiters. Double-quoted strings honor special "escape sequences" such as "\n" (for newline), "\t" (for tab), "\u263A" (for Unicode smiley face), or "\" (for the escape character).
and made sure to place the strings inside double quotes. Still no dice. What gives?
\\n
instead of\n
), does it change anything? I had a similar problem, and I remember solving it by putting one or more backslashes in front of the newline character. If a double escape fails, maybe try with 3 or 4 escapes.