Sponsored Content
The Lounge What is on Your Mind? New Code Tags (Syntax Highlighting) Post 303019458 by Corona688 on Friday 29th of June 2018 01:11:45 PM
Old 06-29-2018
I may be in the minority here, but I'm not sure I like it - yet. It's a good idea, and the line numbering is especially helpful, but the feature needs to be thought through.

This disrupts our habitual use of [color=red] to highlight important changes, for one thing. Either it needs to be opt-in a la [code=bash] or the syntax highlighting colors should be more subdued.

And unless it's done very well, syntax highlighting can be misleading. The one thing which really needs to work perfectly here, the detection of lines and strings, has done a hash job. It looks great, until you think about it -- it's highlighting "shell code" inside quoted and unquoted string literals! It's finding strings inside strings! I really don't want to explain to new programmers why I'm right and the website is wrong.

Last edited by Corona688; 06-29-2018 at 02:58 PM..
This User Gave Thanks to Corona688 For This Post:
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Emacs color syntax highlighting

So... i cant get it to work. I had already posted this but it got deleted. Details: Im running SSH shell on Windows XP, connecting to a server whose term is vt100 (someone asked me that last time) Im trying to get the syntax highlighting in cc mode to work in color, but its black and... (0 Replies)
Discussion started by: viejid
0 Replies

2. UNIX for Dummies Questions & Answers

color highlighting with 'more','grep' and 'vi'

Hi all, i would to find out how can i turn on color hightlighting with the 'more' command. When i view a big file, i tend to use the 'more' command and i would search for a interested string with the '/' command. Something the search returns more than 1 line found on the screen, how can i... (0 Replies)
Discussion started by: new2ss
0 Replies

3. Programming

Vim highlighting annoyance

I was using vim about an hour ago doing abit of python (i only just started using vim). And I think i typed something wrong, and all of a sudden the letter i is always highlighted. Turning syntax off and on didn't work. and i couldent find the solution online. Thanks in advanced. (1 Reply)
Discussion started by: vimhelp
1 Replies

4. UNIX and Linux Applications

gedit/gtksourceview: Updating types for syntax highlighting?

I wrote a new .lang file for syntax highlighting a language I use frequently. It works fine, except that it doesn't glob onto the files automatically. Is there a utility I need to run to update a gtksourceview database? Here's the relevant portion of the code. <language id="pari"... (0 Replies)
Discussion started by: CRGreathouse
0 Replies

5. Shell Programming and Scripting

How to stop Vim from highlighting lines 73+

I am slowly developing my .vimrc and would like to know how to turn off the highlighting (black text on orange background) which starts at line 73. This doesn't seem to be controlled by any selected/customized colorscheme. I do CFD, and some older codes I use are written in F77, for which this... (2 Replies)
Discussion started by: drbones
2 Replies

6. AIX

[Vim] Question about syntax highlighting

Hi all, my sysadmin installed Vim packages (vim-enhanced-6.3-1 & vim-common-6.3-1) on an Aix system (7.1.0.0). I log in using Putty (vs 0.54) and got an annoying underline issue. All strings and var names are underlined as you can see on the attached file Is it possible to get rid of that... (4 Replies)
Discussion started by: Fundix
4 Replies

7. UNIX for Dummies Questions & Answers

Reapplying syntax highlighting in vim

I had a bash script (ma_report.sh) that I was editing when my VPN connection died. So, when I reconnected, I recovered my changes and reopened the file. Everything looks fine except that there is no longer any syntax highlighting. Using ':syntax on' does not work. Other bash scripts in vim do... (1 Reply)
Discussion started by: treesloth
1 Replies

8. Shell Programming and Scripting

Highlighting duplicate string on a line

Hi all I have a grep written to pull out values; below (in the code snip-it) is an example of the output. What I'm struggling to do, and looking for assistance on, is identifying the lines that have duplicate strings. For example 74859915K74859915K in the below is 74859915K repeated twice but... (8 Replies)
Discussion started by: brighty
8 Replies
Arch::FileHighlighter(3pm)				User Contributed Perl Documentation				Arch::FileHighlighter(3pm)

NAME
Arch::FileHighlighter - syntax-highlight file's content using markup SYNOPSIS
use Arch::FileHighlighter; my $fh = Arch::FileHighlighter->new( [ 'internal(pm+c)', 'none(txt), 'enscript', 'internal', ] ); my $html_ref = $fh->highlight($0); print $$html_ref; print ${$fh->highlight('file.c', '/* some code */')}; DESCRIPTION
This class processes file contents and produces syntax highlighting markup. This may be used together with css that defines exact text colors and faces. The default is to use the builtin "internal" processing, that is pretty poor; only very basic file types and syntax constructions are supported. It is suggested to configure and use the external "enscript" utility. GNU enscript understands quite a rich number of file types and produces a useful syntax highlighting. "enscript" filter is used by default if /usr/bin/enscript is found. It is possible to configure different filters ("none", "internal", "enscript") depending on file name extension. In any case the resulting markup is always unified, i.e. all special characters are HTML-encoded using SGML entities, and the markup that looks like <spanclass="syntax_foo">bar</span> is used. METHODS
The following methods are available: new, instance, highlight. new [filters] Create a new instance of Arch::FileHighlighter. filters is arrayref of strings of the form filter(ext1+ext2+...)", where filter is one of "enscript", "internal" or "none". Special extension ":xml" is a shortcut for "html+htm+sgml+xml+wml+rss+glade". The filters optionally constrained by file extensions are probed sequentially and the first passed one is used. Note that if enscript is configured in the sequence, but is not installed, then its probing may print a warning to stderr. The "enscript" filter is handled a bit specially, it may take parameters "mono" (less colors) and "asis" instead of the file extensions. If enscript returns html without any tags, then the filter is handled as failed, unless "asis" is given. By default, filters is [ 'internal' ], or [ 'enscript', 'internal' ] depending on presense of '/usr/bin/enscript'. instance [filters] Alternative constructor. Return the last created instance of Arch::FileHighlighter or create a new one. The purpose of this alternative constructor is to allow the singleton behaviour as well as certain Aspect Oriented Programming practices. highlight filename [content] Process filename using configured filters (as described in the constructor) and produce the file content with embeded <span class="class">...</span> markup. class is one of: syntax_keyword syntax_builtin syntax_comment syntax_special syntax_funcdef syntax_vartype syntax_string syntax_constant If content is provided (either string or reference to string), it is used, otherwise the content of filename is loaded. BUGS
Awaiting for your reports. AUTHORS
Mikhael Goikhman (migo@homemail.com--Perl-GPL/arch-perl--devel). SEE ALSO
For more information, see enscript, Arch::Util, Syntax::Highlight::Perl. perl v5.10.1 2005-10-23 Arch::FileHighlighter(3pm)
All times are GMT -4. The time now is 06:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy