There are a couple of links on sublime forum, on how to get Sublime Text 2 to work with Fortran 90 here http://www.sublimetext.com/forum/viewtopic.php?f=4&t=770, but they don't quite seem to work as the comment identifier "!" is not treated well.
I quickly assembled a solution using the original suggested Punchcard.tmLanguage file and modifying the first block in dictionary to treat "!" as comment (available here: https://gist.github.com/4209445).
Sublime Text 2 is a great text editor and having it support Fortran might be helpful for many people in Theoretical physics and Finance. So if anyone knows a better solution, please let me know.
Thanks!
đź–Ť Text Marker (Highlighter) Simply use Alt + Space to mark selected text.
If you are just opening new files and pasting text in, the default syntax is “Plain Text”, thus no highlighting. You can set the syntax in the buffer by opening the command palette and searching for "Set Syntax: ".
Modern-Fortran syntaxModern-Fortran is a Sublime Text language syntax for highlighting of Fortran code. It highlights modern Fortran (Fortran 90 and newer) and incorporates features introduced in Fortran 2003, 2008, and 2018.
The plugin at the fortran.tmBundle works for me. I created a Fortran
subfolder in Packages
and put all the files in the tmBundle there (not just the .tmLanguage
files). It selects Fortran - Punchcard as the default type for .for
and Fortran - Modern for .f90
files. These both treat !
just fine on my system - what problem are you having?
I also use Fortran (Modern) with Sublime Text (now I'm using version 3) and there was just a little glitch handling comments. Look at this example:
As you can see, the second line starts with an exclamation mark, but it's not recognized. But if I start the first line with "! " (including a space), then everything works:
If I put a dash after the ! of the second line, it reconizes it as a comment, but the problem goes to the third line:
I don't understand the language of the syntax file, but I've looked at the MinimalFortran package to fix this (this package works great and can be installed using Package Control, but it misses lots of syntaxes). I just changed the
<string>!-</string>
to
<string>[!]</string>
on the "Fortran - Modern.tmLanguage" file and it all worked:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With