A lua plugin for making it easy to work with Fortran and it's ecosystem of community maintained tools such as
- fortls (Fortran Language Server)
- fpm (Fortran Package Manager)
- fprettify (Fortran Code Formatter)
- fypp (Fortran Preprocessor)
- Sets up
fortlsfor you without any further configuration (customizable as well) - Integrates with
fpmand provides a number of User Commands such asFpmRun,FpmBuildto run from within neovim instance - Integrates with
fprettifyand provides a commandFpmFormatto format the whole document according to your options provided - optionally also sets up an autocmd to format the document on save
- Sets the
filetypeoffyppfiles as appropriately, enabling the use of syntax highlighting and language server on such files.
- You need to install
fortls,fprettify,fpmfrom your respective package manager. - load this before the plugin https://github.com/neovim/nvim-lspconfig
return {
"wassup05/fortran.nvim",
lazy = true,
-- load the plugin when `ft` is fortran
ft = { "fortran" },
opts = {
-- all your configuration options go here
}
}-- default config
{
server_opts = {
enabled = true,
path = "fortls",
args = {
"--notify_init",
"--lowercase_intrinsics",
"--hover_signature",
"--hover_language=fortran",
"--use_signature_help",
"--enable_code_actions",
},
filetypes = { "fortran" },
settings = {},
},
fpm_opts = {
enabled = true,
path = "fpm",
args = {
-- fpm args go here exactly as you would pass them to fpm
},
terminal = true,
},
formatter_opts = {
enabled = true,
path = "fprettify",
format_on_save = true,
args = {
-- fpretiffy args go here exactly as you would pass them to fprettify
},
},
}- Customization of display of output
Fpmsubcommands (to a terminal, vertical splits etc) - Adding more commands
- Handling arguments of given to the commands
There is a lot of scope for improvment, So bug reports and contributions are very much welcome