vimf90+


Ⅰ. 插件描述

fortran (90+) IDE for vim

Ⅱ. 基本信息

创建日期:  2014-05-23
使用用户:  2
Github星:  8
插件作者:  Rudra Banerjee

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'rudrab/vimf90'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'rudrab/vimf90'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'rudrab/vimf90'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/rudrab/vimf90

Ⅳ. 文档说明

# Introduction

This is a fortran ide for vim. It is intended to make the coding with fortran easier and
faster in vim.

Features

  • an ide like environment for fortran 90+
  • increases development speed considerably.
  • easy to add new subprograms
  • auto completion of program blocks, like if-endif etc.
  • popup menu for standard and user defined modules and subroutines
  • support for menu mode
  • support for gnu-autotools (configure, make)

Install

The easiest way of installation is to use a vim plugin manager.

 Plugin 'rudrab/vimf90' 
 Plug 'rudrab/vimf90' 

Dependencies

  1. Ultisnips: (Essential) Snippetes

Features

Default leader key used here is `. You can change this by using:

let g:VimF90Leader = "your chosen key"

in your .vimrc.

Completions

There are two ways to do the completions. One is Inbuilt Completions and
Completions using Ultisnips

Inbuilt

if,do,select etc statements, that are closed by a corresponding end
is defined here. after typing the first line, pressing <f7> will
complete the construct. for example:
you type:

trial: do i=1,10<f7>        

you will get:

trial: do i=1,10
  &#9014;
end do trial
Subprograms

These key-combinations makes program and subprograms header. it supports program(`prg),
module(`mod), subroutine(`sub) and function(`fun). For example,

`prg

will yeild:

!this is file : <your file name>
! author= <users login name>
! started at: <current time>
! 
program  <filename>
implicit none
  <++start typing++>
end program  <filename>
available constructs
type:get:
`prgprogram header
`modmodule header
`subsubroutine header
`funfunction header
Constructs:
type:get
[name:]do[iterator]<f7>do construct
[name:]if(condition)then<f7>if construct
selectcase<f7>select construct
forall<f7>forall construct
type::name<f7>type construct

NB: this part is shamelessly copied from
fortran-codecomplete

Statements

Some statements is included here for less typing. these are mostly one-liner or part of the line:

you type:you get
`wrwrite(⌶,*)<++>
`rdread(⌶,*)<++>
`rereal(⌶)::<++>
`intinteger(⌶)::<++>
`chcharacter(len=⌶)::<++>
`parparameter
`sreselected_real_kind(⌶)
`sieselected_integer_kind(⌶)

The <++> is a nice option, a <c-j> will put your cursor in that position. Use

inoremap <c-j> <Esc>/<++><CR><Esc><cf>

in your .vimrc for this feature.

Ultisnips

Completions can also be achieved using Ultisnips (Few snippets are supplied with this code, as
ultisnips does not provide fortran snippets. More snippets are welcome!). if, do, do while
etc is inbuilt. You should define your ultisnips trigger in your vimrc(<c-b> here).

TypeGet
do<c-b>do construct
if<c-b>if construct

and so on. Please check vimf90/Ultisnips/fortran.snippets in your .vim/ for complete list.
(Too lazy to type all.)

Fortran subprogram complete

vimf90 now supports subprogram completions. <leader>use and <leader>call will popup a list of
modules and subroutine inside present working dirs and fortran's standard module and subroutines.

Update: _Moving completions completely to coc-nvim and LSP implemented there. See
dependencies section._

Linting

Basic linting is enabled. So, when a operator is typed preceded by a space, e.g. A =B⌶, a space is
automatically inserted, yielding A = B⌶.
This basically enables pep8's whitespace rule in fortran.
You can enable/disable linting behaviour using

let g:VimF90Linter =0/1/-1

where

  • 0: linting as you write. But this will check every keystroke. Use cautiously. Mostly for
    testing purpose.
  • 1: Default. Lint only when you save a buffer
  • -1: Disable Linting.

For more, use dedicated linting packages like
fortran-syntax or ALE.

Menu

Menu is added for gui-help. it helps building project using
gnu-autotool. Every fortran file will open with fortran90 element
in the menubar.
it currently has the option of compile(make, make clean, `build current
file), automake`( a rudimentary configure.ac and makefile.am file
generator) and programing blocks (as given in Subprograms).

Other Suggested Plugins

  1. coc-nvim: (Highly Recommended) Autocompletion and
    language server protocol.
  2. ALE: (Recommended) Dedicated plugin for Linting
    and syntax checking.

Contact

The preferred way of contacting me is via github project page.

My other apps

Other apps I have developed:

添加新评论