I have to edit big files to conform to Oracle standards with plsql syntax highlighting. Can I modify the plsql.syn file to hightlight all words in these files that contain more that 30 charaters in length? Oracle does not allow object names to be greater than 30 charaters.
TIA
HD
highlighting words greater than 30 characters long
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
- Bob Hansen
- Posts: 1516
- Joined: Sun Mar 02, 2003 8:15 pm
- Location: Salem, NH
- Contact:
some workarounds
There are some workarounds you could try though ..
The quickest one is to use this regular expression in the Find dialog to highlight words of more than 30 chars in length:
.. This will take you to each exception individually within the context of the document.
Taking this a step further, you can get a quick summary if you then use the [Mark All] button, and then step through the hits with the [Next Bookmark] command or hotkey (i have mine mapped to F2)
And one more step further, you can copy out the bookmarked lines for separate inspection (Edit > Copy Other > Bookmarked lines ).
You can even modify this approach with external RegExp commandline utilities such as sed and grep, in order to give you a hot-link index into the document where targets are found. More details on request 8)
One last workaround to consider, depending on your needs. If you really want to, you can actually HIGHLIGHT exceptions to the 30-char rule in a format for presentation (ie where you use the syntax file's colouring feature to achieve the highlight effect). The way to do this is to cunningly abuse these parameters in the syn file:
or
or
.. The idea is to choose characters that are not normally part of your Oracle standards, insert these characters into your document where the 30-char rule is broken. Assuming you choose the CommentStartAlt and CommentEndAlt characters (~) above, you would apply the following RegExp replacement:
Find what..
Replace All with..
Effectivley this will wrap each exception in a pair of tildes (~), identifying the text to the syn file as Comments2-type text.
Then, choose colour highlights for your document class to display/print Comments2 text in a suitably gaudy hue. Like bright green on red
Hope this helps!
The quickest one is to use this regular expression in the Find dialog to highlight words of more than 30 chars in length:
Code: Select all
\<[^ \t=]{31,}\>
Taking this a step further, you can get a quick summary if you then use the [Mark All] button, and then step through the hits with the [Next Bookmark] command or hotkey (i have mine mapped to F2)
And one more step further, you can copy out the bookmarked lines for separate inspection (Edit > Copy Other > Bookmarked lines ).
You can even modify this approach with external RegExp commandline utilities such as sed and grep, in order to give you a hot-link index into the document where targets are found. More details on request 8)
One last workaround to consider, depending on your needs. If you really want to, you can actually HIGHLIGHT exceptions to the 30-char rule in a format for presentation (ie where you use the syntax file's colouring feature to achieve the highlight effect). The way to do this is to cunningly abuse these parameters in the syn file:
Code: Select all
CommentStart = #.
CommentEnd = .#
Code: Select all
CommentStartAlt = ~
CommentEndAlt = ~
Code: Select all
CharStart = [
CharEnd = ]
Find what..
Code: Select all
\<[^ \t=]{31,}\>
Code: Select all
~&~
Then, choose colour highlights for your document class to display/print Comments2 text in a suitably gaudy hue. Like bright green on red
Hope this helps!