Helpful utilities for the OpenFOAM programmer.
Matthew C. Jones [email protected]
Install using vim-plug,
Plug `vim-foam-programmer`
This plugin provides additional support for creating, editing, or viewing OpenFOAM source code files using Vim. The specific features are listed.
- Automatically searches OpenFOAM makefiles for linked header files and adds
them Vim's path.
- Allows for opening included header files inside Vim with
gf
- Allows for built-in Vim include and definition searching
- Use
[_CTRL-i
,[_CTRL-d
,CTRL-w_i
,CTRL-w_d
, etc. - See
:help include-search definition-search
- Use
- Allows for opening included header files inside Vim with
- Convenient command to build Ctags that references custom user files as well
as OpenFOAM source code.
- Run
:FoamCtags
to generate tags file - Use
g]
Ctrl-]
andCtrl-t
to navigate through functions and variables of interest - See
:help tag-matchlist
- Requires external dependency: exuberant-ctags or universal-ctags
- Run
- Automatically set OpenFOAM files to cpp filetype for better readability. This is disabled by default. To enable, place the following line in your vimrc file.
let g:foam#programmer#syntax = 'true'
-
Vim-Foam for syntax highlighting.
-
YouCompleteMe and YCM-Generator for text completion. Use the following command in the project base directory.
:YcmGenerateConfig -verbose --preserve-environment --force
Copyright (c) 2020 Matthew C. Jones. Distributed under The MIT License (MIT). See LICENSE file.