Syntax highlighting for the Gnome text editor gedit is now available. It can be found here.
Feedback is appreciated, so give it a try and tell us your opinions and experiences.
A project by DCS Computing and CFDEMresearch
Syntax highlighting for the Gnome text editor gedit is now available. It can be found here.
Feedback is appreciated, so give it a try and tell us your opinions and experiences.
This website uses cookies to ensure you get the best experience on our website. By continuing to browse the site you are agreeing to our use of cookies. This website uses cookies. By continuing to browse the site you are agreeing to our use of cookies. More info
richti83 | Thu, 01/19/2012 - 08:54
Thanks
this is really cool !
greez, Christian
Silias | Wed, 03/28/2012 - 11:07
Highlighting not working
Hy everybody,
I copied the file into the folder /usr/share/gtksourceview-2.0/language-specs, restarted my gedit sessions and selected the LIGGGHTS Highlighting-View but all I can see are black letters...?
I work on a suse linux instead of an ubuntu system, could that be the reason?
Regards,
Sebastian
dbreton | Thu, 01/19/2012 - 15:27
other possibilities
I have the following lammps.nanorc file (modified from the awk.nanorc file) for those of you who use nano. To make it work, you'll need to add this line to the end of your ~/.nanorc file:
include "/home/dbreton/lammps.nanorc"
and then save the following code as the file lammps.nanorc in your home directory.
#########################################################
## lammps.nanorc -- an example for LAMMPS/LIGGGHTS input scripts.
## Valid colors are "green", "red", "blue", "white", "yellow", "cyan", "magenta" and
## "black", with the optional prefix "bright" for foreground colors.
## syntax highlighting rules applied in the order they are read in.
########################################################
## Apply this highlighting for files ending in .lmp -- edit as you see fit
syntax "lmp" "\.lmp$"
## variables with leading $
icolor green "\$[0-9A-Z_!@#$*?-]+"
## most keywords -- edit as you see fit
color red "\<(atom_style|atom_modify|boundary|newton|read_data)\>"
color red "\<(group|communicate|neighbor|neigh_modify|pair_style|pair_coeff)\>"
color red "\<(timestep|run|dump|compute|dump|thermo|thermo_modify)\>"
color red "\<(compute_modify|thermo_style|displace_atoms|mass)\>"
## some other keywords
color brightred "\<(region|write_restart|read_restart|create_box)\>"
color magenta "\<(property|units)\>"
## variable definitions
color brightgreen "\<(variable)\>"
## operators
color green "(\{|\}|\(|\)|\;|\]|\[|\\|<|>|!|=|&|\+|-|\*|%|/|\?:|\^|\|)"
## flow control
color brightyellow "\<(label|if|while|do|else|in|delete|exit)\>"
color brightyellow "\<(jump|break|continue|return)\>"
## I/O statements
color brightgreen "\<(print)\>"
color brightgreen "\<(shell)\>"
## fix and set
color brightmagenta "\<(fix|unfix|set)\>"
## String highlighting.
color brightyellow "<[^= ]*>" ""(\\.|[^"])*""
## Comment highlighting
color brightblue "(^|[[:space:]])#.*$"
## Trailing whitespace -- not really necessary
color ,green "[[:space:]]+$"
## END ##########################################
good luck
DAN
Philippe | Mon, 01/23/2012 - 08:31
Thank you!
Thank you Dan, this may be very helpful to some users!
Philippe
maxxum | Wed, 07/10/2013 - 12:14
errors
Hello. I tried to get this syntax highlighting to work. I use a RHEL6 server and I run KDE, but there is gedit installed. I asked the system admin to put the file in the correct place, and I see there are other .lang files there. Upon starting gedit, it shows LIGGGHTS as one of the options for syntax highlighting but it does not highlight. With this preference set, now whenever I start gedit from a command line, I get a bunch of errors in the console:
--------------------------
(gedit:17854): GtkSourceView-WARNING **: in file /usr/share/gtksourceview-2.0/language-specs/liggghts.lang on line 33: Expecting element match, got start
(gedit:17854): GtkSourceView-WARNING **: in file /usr/share/gtksourceview-2.0/language-specs/liggghts.lang on line 33: Element context failed to validate content
(gedit:17854): GtkSourceView-WARNING **: in file /usr/share/gtksourceview-2.0/language-specs/liggghts.lang on line 33: Expecting element include, got start
(gedit:17854): GtkSourceView-WARNING **: in file /usr/share/gtksourceview-2.0/language-specs/liggghts.lang on line 33: Element context failed to validate content
(gedit:17854): GtkSourceView-WARNING **: in file /usr/share/gtksourceview-2.0/language-specs/liggghts.lang on line 28: Invalid sequence in interleave
(gedit:17854): GtkSourceView-WARNING **: in file /usr/share/gtksourceview-2.0/language-specs/liggghts.lang on line 28: Element definitions failed to validate content
(gedit:17854): GtkSourceView-WARNING **: Failed to load '/usr/share/gtksourceview-2.0/language-specs/liggghts.lang': in file /usr/share/gtksourceview-2.0/language-specs/liggghts.lang on line 33: Invalid attribute class for element context
--------------------------------------------
maxxum | Thu, 07/11/2013 - 10:32
works in unity based Ubuntu 13.04
Following up on my previous error report, I was able to get it to work on a Ubuntu 13.04 virtual machine. So the problem is because of either Red Hat or KDE on my server.
pfalkingham | Tue, 08/30/2016 - 19:18
Notepad++ basic syntax
I put together a few keywords to start a notepad++ syntax:
https://1drv.ms/u/s!Am5GkbZS_98Xoe49inDEgXxdy8IduA
(can't guarantee how long that link will be active, sorry)
I'd really like to see syntax for sublime text or Visual Studio Code, but haven't had time to make those.
pfalkingham | Tue, 09/26/2017 - 10:32
Visual Studio Code extension
I've put together an extension for Visual Studio code that offers basic highlighting for *.liggghts files.
You can download it from here: https://1drv.ms/u/s!Am5GkbZS_98XraFHxgkES1DMDtZFqQ (I'll try and keep the link up for at least a month or so)
Then install manually through the extensions pane in Visual Studio Code.
If this is of use to people, I'm happy to continue development and publish it to the Visual Studio Code Extensions Market Place, which would make download and installation easier.
paul | Thu, 09/28/2017 - 11:09
Much appreciated! I'll try it
Much appreciated! I'll try it out as soon as I get a chance.
safranyikf | Wed, 11/25/2020 - 17:28
Syntax highlighting for the Gnome text editor not available
Dear Philippe,
the link is not availabel. Can you help me?
thanks in advance, Feri