- Install vim-plug
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
- Add this to your
.vimrc
file
call plug#begin()
" The default plugin directory will be as follows:
" - Vim (Linux/macOS): '~/.vim/plugged'
" - Vim (Windows): '~/vimfiles/plugged'
" - Neovim (Linux/macOS/Windows): stdpath('data') . '/plugged'
" You can specify a custom plugin directory by passing it as the argument
" - e.g. `call plug#begin('~/.vim/plugged')`
" - Avoid using standard Vim directory names like 'plugin'
" Make sure you use single quotes
Plug 'the-pawel-wojcik/vim-cfour'
call plug#end()
- Restart vim.
- Issue the command
:PlugInstall
.
Other vim-plug commands
- Colored ZMAT.
- Colored elements of the output.
- Folded output. Unfold with
za
read at:help usr_28
. Learn how to en/dis-able below.
- Display molecule from the ZMAT file.
Requirements: cfour parser,
jmol and
CFOUR installed on your computer (only
if
xjoda
is needed from CFOUR). Additionally you should have the following script namedshowit.sh
visible from yourPATH
#!/usr/bin/bash
home=$(pwd)
tmpdir=$(mktemp -d)
cp ZMAT $tmpdir
cd $tmpdir
# The output needs to be surrounded by the section opening and closing labels
# otherwise the parser will not be interested in parsing.
c4out=output.c4
echo "--invoking executable--" > $c4out
which xjoda >> $c4out
# See man 1 time for the environmental variable TIME
export TIME="--executable xjoda finished with status %x in %e seconds (walltime)."
# For the $TIME to work you need to use the full program not the bash's builtin
/usr/bin/time xjoda >> $c4out 2>> $c4out
python -m cfour_parser -j "$c4out" > "$c4out".json
# this one will be available online soon
~/Code/chemistry/cfour/processors/geometry.py -x "$c4out".json > $home/geometry.xyz
cd $home
rm -r $tmpdir
jmol.sh -L -g2000x1000 geometry.xyz
After all this effor you can type :make
to view the molecule. I use the extra
remap
nnoremap <leader>m <cmd>make<CR>