Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs setup for fortran

Tags:

emacs

fortran

I currently work on a big Fortran project with emacs, but I have the feeling that my current setup is inadequate to the task.

I use f90-mode with auto-complete (without fortran-specific setup, so I only have completion for opened files), and I really miss function header information on hover (as in elisp code), code-folding, lists of subroutines in the current buffer, lists of included files, info on the origin of subroutines and used variables (C-xC-f to open the source file?), …

How can I best add modern supporting functionality for fortran in my emacs?

Mostly I need tools which help me understanding the projects code.

The project uses its own build tool and copies files from different directories into a build directory before building, actually overwriting some files with different versions of the code, so I need a quite flexible tool which can cope with that.

like image 767
Arne Babenhauserheide Avatar asked Oct 16 '12 16:10

Arne Babenhauserheide


2 Answers

Using fortran-language-server (after installation simply start fortls in the terminal) and lsp-mode in emacs works perfectly.

like image 192
pawel_winzig Avatar answered Oct 16 '22 14:10

pawel_winzig


There's a small Emacs plugin called Fortran-tags. It can find the definition of any variable or procedure under the cursor, so it's similar to Ctags, except that it is able to correctly identify all local and global variables and has some additional features. Also, it is developed with the focus on modern Fortran.

like image 43
Raul Laasner Avatar answered Oct 16 '22 14:10

Raul Laasner