简体   繁体   中英

specific settings in after/ftplugin/fortran.vim not working

My after/ftplugins/fortran.vim has the following lines

let fortran_fold=1
let fortran_fold_multilinecomments=1
set foldmethod=syntax foldlevel=1 foldnestmax=2
let fortran_free_source=1
let fortran_do_enddo=1

If I open a fortran file, I don't see folded code, but when I change foldmethod to indent it works and I see code folded based on indentation.

The same settings work if I put them in init.vim . I also have

syntax on
filetype indent plugin on

in my init.vim .

Nvim enables filetype plugin indent on and syntax on by default ( :h nvim-defaults ). So, just nvim test.for (without any init.vim ) would do the right thing.

But when doing it manually, the order does matter! This is correct:

filetype plugin indent on
syntax on

Vim suffers the same issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM