Code Editors/IDEs used for Fortran

I use BBEdit (but is macOS only) which now supports the normal Python based Fortran Language Server too since version 14.x. Also use CLion with the Fortran plugin if I want something a bit more IDE orientated than ‘just’ an editor. Occasionally I use neovim when I hate myself.

Only joking neovim (or vim) is great for editing on a remote system via ssh, and is my preferred terminal editor when needed.

1 Like

Other:
We, and our colleagues at Sector7 use UltraEdit. We make extensive use of Beyond Compare (Scooter software) for file transfer and version control. When we venture onto Windows we use Visual Studio but it has problems with symbolic links.

1 Like

Note: VSCode can also remote edit via ssh. It is magical! :slight_smile:

3 Likes

Yes, indeed. I wanted to mention that Remote Development (remote ssh docs) are extremely useful, but I get the impression that a lot of users prefer lightweight editors for remote work and not a full blown VS Code session that runs over ssh or Docker.

3 Likes

I checked “Other.” I usually use Simply Fortran on whatever platform that I happen to be using, but that usage isn’t surprising since I also develop Simply Fortran.

4 posts were split to a new topic: Language server support in Simply Fortran IDE

I have the same experience with VSCode. And I am using it for Fortran and python. I also like Code :: block as I spend good amount of time on it learning Fortran. In additon to that vi, gedit, and geany are used.

I use Vim exclusively, too. And I believe it is the same as with Emacs: 50% editor, 50% lifestyle. Especially in the first days or weeks, vim is a full time job & wife/husband, but once you got a configuration that fits your needs, you will never miss it.
Currently I’m using neovim with lua-config (packer, nvim-cmp, cmp-nvim-lsp, LuaSnip, etc.). The language server integration runs like a charm. If I would configure my vim a little bit further, it could do anything a modern IDE can do.

1 Like

The topic is very much prone to “flame editor wars”… It didn’t turn to that, and that’s a good thing - except even devoted programmers enjoy their little flame war nonsense from time to time. :laughing:
Anyway, the best editor/IDE is the one you like the most and/or the one you are familiar with. I used Vim for several years in the past (and I liked it), but switched to Emacs at some point, which I use more or less as an operating system, not just an editor. You can’t really compare those two, or the others mentioned in this thread. They are not the same thing and they are not designed with the same goals in mind.

2 Likes

After using vim for ages, I also switched to Emacs recently, attracted by what themos once put forward best “never ever leave Emacs”. Would you mind mentioning some Emacs packages to use for Fortran editing? At the moment things like syntax highlighting for deeply nested types, etc are not to my liking.

Too early for me to share a track this seasoned with you. Though I like to use Emacs’ orgmode to write small programs because one .org file then contains all code and corresponding documentation one may export to other formats (tex, pdf, html, odt, etc.). When needed, the files necessary are exported (tangled by chord C-c C-v t) to work and report back their results (if wanted) for further processing. Once adjusted, this approach works well both for interpreted and compiled languages (e.g., bash, AWK, Python, Fortran).

The example video e.g., org mode is awesome by John Kitchin by 2014 might appear as a bit old (some functions are available now with different key strokes) and incomplete (just sub-set of what is possible today), but you might get an idea. His examples how to execute code start around minute 11, briefly Fortran is shown around minute 14. Because orgmode trades Makefiles, their assistance offered (like in Daniel Price’ tutorial) is equally available to you.

Tip 1: Ensure to state f90 when specifying the language as about Fortran at the beginning code blocks. Otherwise, stating fortran refers to FORTRAN (e.g., the leading spaces).
Tip 2: The reformatter fprettify by Patrick Seewald has got a port frprettify.el.

1 Like

Do you know any good book (not too old) about Emacs?

In a recent Hacker News thread about Emacs someone wrote

Mastering Emacs by Mickey Petersen is a solid book on Emacs and a good companion to the official manual. Mickey usually has an update to Mastering Emacs not long after a new version is released, which is great.

The book costs $40 – the site has free articles by Petersen.

I like Emacs because I can run a shell in one of the buffers (CMD on Windows, bash on Linux). I can compile from that buffer and see results sent to stdout while viewing code in other buffers.

2 Likes

Thanks a lot, I will put it in on my list for my next book order!
I would like to use more often either vim or Emacs (I am agnostic!).

1 Like

Learn Vimscript the Hard Way by Steve Losh
:help 42

2 Likes

There is a big difference between those two. Vim is an editor or, to be precise, an “editor with benefits”. Despite the common belief, Emacs is not an editor . Essentially, Emacs is an Elisp interpreter. What it does is running programs written in Elisp, a special (built-in) version of Lisp. Now, countless of Elisp programs, even huge packages, do exist (major and minor “modes” in Emacs terminology). Those make Emacs able to do whatever the developer wants, including… editing text. And even editing text can be done in many ways, for example you can make Emacs behave pretty much like… Vim (this is jokingly called the “evil mode”).
But since you are not restricted to editing text, you will find pretty much every kind of Emacs applications, too many to mention them all. Some of them are: web browser, pdf viewer, image viewer, screen reader, computer algebra system GUI with LaTeX pretty printing, several games, or even its own window manager. And that is the tip of the iceberg; I didn’t even touch the beast called org mode, mentioned above by @nbehrnd. People did all kinds of crazy things for Emacs (for example, you can be completely blind an play Tetris, all within Emacs).
For all those reasons, some people semi-seriously call Emacs an “operating system”, in the sense you can turn on your computer, run Emacs and never leave it. In fact, I do that often at home, and always when I am not at home, since for extra portability I only have an old Netbook with me. The real operating system doesn’t matter, I just launch Emacs and that’s it.
Now, Emacs’ default text editor is huge, and many of the extra modes are enabled by default (that’s why some people call Emacs “bloated”) - it is, however, extremely customizable, so you can set your own default state however you wish. In short, as an editor, Emacs means… be prepared to hit Control+something or Alt+something a lot.

Vim, on the other hand, is a very good editor, with a different philosophy than most other text editors: it’s based on two different modes, the command and editing mode. This might be frustrating in the beginning, but you get used to it quickly. In short, be prepared to Hit Esc and “:” a lot. It has a lot to offer, and it can be used as an IDE (I did that in the past for several years, until I decided to give Emacs a serious try).

Overall, I’d say Vim is easier to learn, while Emacs has a more steep learning curve - but in my opinion it pays off. Which one is “better”? None. They are different things, even if you are just looking for a new editor, so I don’t think you can really compare them.
I would say, give them both a try and see which one fits your needs. They both have built-in tutorials and help, so you don’t need a book to start using them. Whenever you end up needing a book, that would probably mean you know which one you like, and you are looking for more “special” features. If Emacs is that one, the book mentioned by @Beliavsky is a great choice.

3 Likes

Thank you all for voting and having these interesting discussions about your favourite editors. I think the poll validates my hunch about having a large VS Code user-base here in Fortran Lang. Hopefully we can use this to our advantage in the days to come to provide better tooling for the Fortran community.

The plan is for the repo transfer to occur sometime next week, with hopefully, minimal disruption to the end users.

My available free time for development of the extension is expected to be limited in the coming months so I was hoping I could see some of you contribute to the project.

On that note I will be closing the poll. Thank you all again for participating!

Just a small note, your modern Fortran extension isn’t on the open source versions of VS Code(VS Codium and Code OSS). If it is, I am not sure how to enable it :frowning:

I am not sure what that means. Could you please elaborate?

There are open source binaries of Microsoft VS code. When trying to install your “Modern Fortran” extension. It doesn’t appear in the extension store for these binaries.