Thursday, 28 January 2010

 

Automatically Enable VIM Syntax Highlighting for a non-standard file extension

:syntax on

"enable perl syntax highlighting for a file with a non-standard extension
:autocmd BufReadPost *.plx set syntax=perl

" some odd useful abbreviations
:cab synh set syntax=html
:cab synp set syntax=php

Labels:


Monday, 18 January 2010

 

Reading MS Word Documents with VIM

Put this in your .vimrc
autocmd BufReadPost *.doc %!antiword "%"

install antiword on your PC, comes with Cygwin and as a win32 executable.

then vou can do

gvim cv.doc

Remember this is READY ONLY you cannot Modify a Word Document but nevertheless very useful for fishing out the text you need from a Microsoft Word document or alternatively reading a Word document with all the advantages of Vims powerful search options

" set up vim to read MS Word documents read only
autocmd BufReadPre *.doc set ro
autocmd BufReadPre *.doc set hlsearch!
autocmd BufReadPost *.doc %!antiword "%"

Labels: ,


This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]