Code Editors/IDEs used for Fortran

Do results round to 1% or I am I the only Sublime user? :nerd_face:

On occasion I also use Notepad++ (Windows), or nano/vim (remote, terminal). I tried Atom once, but found it slow in comparison with Sublime. Iā€™ve been avoiding both Atom and VS Code since they are based on Electron and Iā€™m distrustful of JavaScript developers (donā€™t take me seriously).

I use the same editors also for Python, C/C++ and other ASCII text documents.

2 Likes

I use Jedit (http://www.jedit.org/).
I started using it a loooong time ago and never found anything that made me want to switch.

3 Likes

VSCode is terrific for Fortran (when you install the extensions mentioned above). The extension ecosystem is great for whatever language you want. Easy to install and get started on Windows and Mac (havenā€™t tried it on linux). Try telling a beginner to install Emacs on Windows. :slight_smile: Itā€™s also great to have top-notch Fortran support in the editor that many programmers are already using (e.g., for Python or Julia or whatever).

I used Atom for a while (VSCode seems like a better Atom to me). Sublime is great, but I donā€™t think can complete with the VSCode ecosystem at this point.

5 Likes

I am happy with Kate in Kubuntu. The projects I work on are generally just a few thousands lines long, and Kate does everything I need.

Sometimes I use GEdit when working in Fedora.

And vim when I work in a terminal and need to make small edits. I had started to read the book ā€œPractical Vimā€, but I have not yet succeeded in memorizing enough shortcuts to use it in a more advanced wayā€¦

1 Like

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.

1 Like

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

3 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