I am using a compiler that uses .LIB files like they were .h
files. My problem is that when I load one of these files into
VIM it gets highlighted strangely - black text with a red
background. I would like to have VIM highlight a .LIB file the
same as a .c or a .h file. Can anyone tell me how?
Thanks.
--
gnat.
:help new-filetype
Following the instructions there, your filetype.vim should look like
this:
if exists("did_load_filetypes")
finish
endif
augroup filetypedetect
au! BufRead,BufNewFile *.lib,*.LIB setfiletype c
augroup END
HTH,
Gary
perfect :)
Thanks.
--
gnat.
Win/*nix?
*nix:
~/.vim/filetype.vim
au BufNewFile,BufRead *.LIB setf c
Also can be in your .vimrc
m.
--
LaTeX + Vim = http://vim-latex.sourceforge.net/
Learn Touch Typing with Vim? Oui. Ja. Yes. Tak:
http://vim.sourceforge.net/script.php?script_id=461
vim.pl - http://skawina.eu.org/mikolaj
> gnat scripsit:
>
>>Hello,
>>I am using a compiler that uses .LIB files like they were .h
>>files. My problem is that when I load one of these files into
>>VIM it gets highlighted strangely - black text with a red
>>background. I would like to have VIM highlight a .LIB file the
>>same as a .c or a .h file. Can anyone tell me how?
>
>
> Win/*nix?
>
> *nix:
> ~/.vim/filetype.vim
>
> au BufNewFile,BufRead *.LIB setf c
>
> Also can be in your .vimrc
>
> m.
I am using Win - i can't seem to get it to work when i put it in
my _vimrc file (though other things in there work).
It's kind of academic because i got the .LIB highlighting working
with the filetype.vim file (just have to remember to back it up
if i want to re-install.
One more question relating to this topic - I was going through
the filetype.vim file and I was wondering if i can make the set
number command run on selected file types (i.e. c, cpp, h, LIB,
etc.).
I guess a better question is where can i go to learn how to do
vim scripting :)
Thanks.
--
gnat.
You can/have to create vimfiles directory (inside vim dir) and there
create alternative tree structure. Vimfiles won't be overwritten.
> One more question relating to this topic - I was going through
> the filetype.vim file and I was wondering if i can make the set
> number command run on selected file types (i.e. c, cpp, h, LIB,
> etc.).
:help ftplugin
> I guess a better question is where can i go to learn how to do
> vim scripting :)
:h usr_toc