Easy way to find unmatched quote in vim?
I'm writing a ksh script and apparently have an unmatched double quot开发者_如何学Goe ("
) in my code. Ksh unfortunately just tells me that the last line of the script doesn't match it, but the error is almost certainly well before the end of my script. I'm writing this in VIM. Is there some way I can narrow down where the actual quote issue is?
Probably go to the end (G$
) and search for a double quote backwards (?"
)
Otherwise, lookup for lines with only one double quote (/^[^"]*"[^"]*$
) could help if your script is simple.
If you're using a terminal that supports color and you turn on syntax highlighting, it should be easy to spot unusually long strings. To turn on syntax highlighting, go into command mode and type:
syntax on
You can read more about syntax highlighting in the vim documentation:
http://vimdoc.sourceforge.net/htmldoc/syntax.html
精彩评论