Vim: Jump if endif in fortran

For C or C ++, [{ or ]} can be used in vim to jump to the beginning or end of a code block. Is there a similar shortcut to go for code block between if and endif in vim for Fortran?

The problem is related to not-so-well-formatted code, including many nested if's , which makes reading difficult. Any solutions for such a case?

+6
source share
1 answer

The built-in, but disabled by default matchit plugin should help you with this.

Add this line to your vimrc :

 runtime macros/matchit.vim 

After restarting Vim, you can press % to switch from if to endif and vice versa.

+7
source

All Articles