Skip to content

the-pawel-wojcik/vim-cfour

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vimc4

A Vim plugin for CFOUR.

Install

  1. Install vim-plug
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

How to use vim-plug

  1. 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()
  1. Restart vim.
  2. Issue the command :PlugInstall.

Other vim-plug commands

Features

  1. Colored ZMAT.
  2. Colored elements of the output.
  3. Folded output. Unfold with za read at :help usr_28. Learn how to en/dis-able below.

Conditional features

  1. 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 named showit.sh visible from your PATH
#!/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>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published