Fortran syntax for kakoune editor

Made a start -

4 Likes

Welcome @freevryheid and thank you for this. I haven’t heard of Kakoune before this so I went to take a look and may even try it.

this is strictly free-form format and I don’t have plans right now to develop kak syntax for pre-f90 or fixed format files.

This seems sensible to me. With f90.kak, will Kakoune render a .f file without any syntax highlighting or will it assume free-form for that as well?

See relevant discussions on this here and here.

2 Likes

Yep, the top lines in the f90.kak file define the syntax. Detection is done by regex examining the filename extension. Currently the following is used:

hook global BufCreate .*\.(f90|f95|f03|f08) %{
    set-option buffer filetype fortran
}

To use .f as free-form, just append “|f” as in:

hook global BufCreate .*\.(f90|f95|f03|f08|f) %{
    set-option buffer filetype fortran
}

Also, I forgot to mention - kak can be extended as a language server client to the fortran-language-server.

1 Like

Welcome @freevryheid. Awesome, thanks for doing this. Here is the link to the editor, I never heard of it before: https://kakoune.org/