Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim: Jumping to if endif in fortran

Tags:

vim

fortran

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

The issue is due to not-so-well formatted code, involving a lot of nested if's making the readability difficult. Any solutions for such case?

like image 690
SKPS Avatar asked Sep 15 '15 12:09

SKPS


1 Answers

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

Add this line to your vimrc:

runtime macros/matchit.vim

After you restarted Vim you should be able to press % to jump from if to endif and back.

like image 150
romainl Avatar answered Nov 04 '22 15:11

romainl