Vim可以用Fortran完成子程序参数吗
我不知道这是否可能,但仍然。。。问也无妨 我正在使用Vim编辑fortran文件,旧的和新的(.for和.f90)。我正在尝试完成,类似于Visual Studio,因此当我在一个文件中定义了多个子例程时:Vim可以用Fortran完成子程序参数吗,vim,autocomplete,intellisense,fortran,Vim,Autocomplete,Intellisense,Fortran,我不知道这是否可能,但仍然。。。问也无妨 我正在使用Vim编辑fortran文件,旧的和新的(.for和.f90)。我正在尝试完成,类似于Visual Studio,因此当我在一个文件中定义了多个子例程时: subroutine init ( ibc, nquad, ul, ur, xl, xr ) subroutine output ( f, ibc, indx, nsub, nu, ul, ur, xn ) subroutine phi ( il, x, phii, phiix, xleft
subroutine init ( ibc, nquad, ul, ur, xl, xr )
subroutine output ( f, ibc, indx, nsub, nu, ul, ur, xn )
subroutine phi ( il, x, phii, phiix, xleft, xrite )
我在某处给他们打电话:
call init(<cursor is here>
ldigas edit2:2个答案已撤回。。。有趣
最近的一个应该是。不幸的是,它还不支持Fortran…我认为最接近的功能可能是vim功能,它的工作原理与intellisense类似,但让我们使用语法突出显示文件作为基础。下面看一下我的.vimrc文件,以获取一个示例。基本上,它为每个列出的类型设置自动完成:如果文件类型受omnisense支持,它将使用它,否则它将使用语法突出显示文件
syntax on
colorscheme elflord
set tabstop=4
set shiftwidth=4
set nu!
set et!
filetype on
filetype plugin on
autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType sql set omnifunc=sqlcomplete#Complete
autocmd FileType c set omnifunc=ccomplete#Complete
if has("autocmd") && exists("+omnifunc")
autocmd Filetype *
\ if &omnifunc == "" |
\ setlocal omnifunc=syntaxcomplete#Complete |
\ endif
endif
另一种可能是查看vim.org网站。例如,我在那里发现了以下内容(即使它不是您想要的,但它只是一个示例)
希望这有帮助部分答案:
好的,我得到了第一部分:
Vim的整条生产线完成由
<Ctrl-X, Ctrl-L>
(其中“&”是一个延续标记)这种方式不起作用。有没有人(来编写vimmers脚本)知道避免这种行为的方法?快速和肮脏:
VIM非常理解标签。不幸的是,这并不是你想要的那种圆滑的行为:你会在窗户之间弹跳,但我认为这很好,因为我没有其他东西
也许有用,但我从未用过。然而,由于它是开源和可配置的,你可能会发现有人已经走上了你的道路,例如,似乎有一个。YMMV.是的,我在谷歌搜索时看到了这一点。不幸的是,正如你所说,这没有帮助。我还发现人们在这里或那里提到了一些其他(更像vim)的替代品,但与fortran无关。希望其他人能知道更多……不幸的是,onmnifunc似乎与fortran不太兼容。至少不是以我需要的方式。至于第二部分,我知道Michael Goerz的插件,但这不是我需要的。他做的是做一个插件,一种代码片段插件。周围有很多,snipmate,xptemplate。。。仅举几个例子。长话短说,这里运气不好。尽管如此,我还是很感激你的努力。我目前也使用CTAG,它工作得很好,但在窗口之间跳转确实很烦人。像OP那样的自动完成很好,但是我只发现C++。
syntax on
colorscheme elflord
set tabstop=4
set shiftwidth=4
set nu!
set et!
filetype on
filetype plugin on
autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType sql set omnifunc=sqlcomplete#Complete
autocmd FileType c set omnifunc=ccomplete#Complete
if has("autocmd") && exists("+omnifunc")
autocmd Filetype *
\ if &omnifunc == "" |
\ setlocal omnifunc=syntaxcomplete#Complete |
\ endif
endif
<Ctrl-X, Ctrl-L>
call assemble ( adiag, aleft, arite, f, h, indx, nl, node, nu, nquad, &
nsub, ul, ur, xn, xquad )