2013년 5월 22일 수요일

Make Vim Highlight Syntax for Vasp INCAR

The syntax of the Vasp INCAR file can be highlighted if we treat it as a fortran file. The following is how to do it.

1. Edit the filetype.vim file by


Open vi

:cd $VIMRUNTIME/

Quit vi, goto that directory with cd

sudo vi filetype.vim

add these lines:


" VASP INCAR
au BufNewFile,BufRead INCAR                     setf fortran

Then whenever we open the INCAR file, fortran syntax highlighting is applied.

2. Setting for free form fortran

However, the default setting for the fortran seems to be fixed-form. To chage it to free-form, 

open ~/.vimrc,

add 

:let fortran_free_source=1

Note that this setting will make your vi regard any fortran file as free form.

That's all.

Example view



댓글 없음:

댓글 쓰기