Vim:如果在fortran endif跳跃 [英] Vim: Jumping to if endif in fortran
问题描述
对于C或C ++,可以在 vim中使用
跳转到代码块的开头或结尾。是否有类似的快捷方式跳转到 [{
或]}
if 和
endif
中 vim之间的代码块 for Fortran?
这个问题是由于格式不太好的代码造成的,涉及到很多嵌套 if
使可读性困难。对于这种情况下的任何解决方案?
默认情况下matchit插件可以帮助您。 / p>
将此行添加到 vimrc
:
运行时宏/ matchit.vim
重新启动Vim后,您应该能够按%
从跳转if if
到 endif
和返回。
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?
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.
这篇关于Vim:如果在fortran endif跳跃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!