Vim:如果在fortran endif跳跃 [英] Vim: Jumping to if endif in fortran

查看:152
本文介绍了Vim:如果在fortran endif跳跃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆