2013년 11월 7일 목요일

Make Vim Highlight Syntax for Vasp INCAR : without sudo

This post is continuation of the last one, "Make Vim Highlight Syntax for Vasp INCAR"

If we use server, than we can't use sudo command which was used in the last page.

Then, (Ubuntu)

1) If ~/.vim/ftdetect doesn't exist, than make it


mkdir  ~/.vim
cd ~/.vim
mkdir ftdetect
cd ftdetect


2) INCAR.vim


Make INCAR.vim in the folder ftdetect whose content is this:


"VASP INCAR
au BufNewFile,BufRead INCAR                     setf fortran



That's all.

Then vasp's INCAR file is highlighted according to the syntax rule of fortran.

Example view


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