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
"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: vim syntax
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 "%"
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 "%"
Subscribe to Posts [Atom]