Easy way to find an unrivaled quote in vim?

I am writing a ksh script and apparently have an unmatched double quotation mark ( " ) in my code. Ksh, unfortunately, just tells me that the last line of the script does not match it, but the error is almost certainly long before the end of my script. I am writing this is in VIM. Is there any way that I can narrow the scope of the actual problem with quotes?

+4
source share
2 answers

Probably go to the end ( G$ ) and find the double quote back ( ?" )

Otherwise, finding strings containing only one double quote ( /^[^"]*"[^"]*$ ) may help if your script is simple.

+5
source

If you use a terminal that supports color and you turn on syntax highlighting, it should be easy to notice unusually long lines. To enable syntax highlighting, go to command mode and enter:

syntax on

You can read more about syntax highlighting in the vim documentation:

http://vimdoc.sourceforge.net/htmldoc/syntax.html

+6
source

Source: https://habr.com/ru/post/1337498/


All Articles