Click to See Complete Forum and Search --> : Vim question


Qubit
04-06-2002, 04:41 PM
OK, I've searched myself stupid on this one, but I can't figure out how to make vim (6.0, under windows) open .pp files by default in Pascal mode. I've made a file with the lines

augroup filetypedetect
au BufNewFile,BufRead *.pp setf pascal
augroup END

and then the Vim docs tell me to put it under $VIMRUNTIME/ftplugin, but that doesn't work. I've tried moving it around, pasting the code in my .vimrc, but nothing works. Any help?

BTW, I feel like preaching to the converted, but Vim under Windows is awesome! The power of Vim combined with the flexibility of a GUI, it's great!

bwkaz
04-07-2002, 12:49 AM
Originally posted by Qubit:
<STRONG>The power of Vim combined with the flexibility of a GUI, it's great!</STRONG>

Have you never seen gvim 6?

:rolleyes:

As for your actual problem, I have no idea. There are probably docs at www.vim.org (http://www.vim.org) if you haven't tried there already.

Qubit
04-07-2002, 02:42 AM
Have you never seen gvim 6?


Yes, I have now! I just think it's cool to have a windows app with the power of the linux thing...


I went through the docs that came with vim a couple of times already. In usr_043.txt it describes how to set up your vim to recognize other file types, but that's what I did and it still doesn't work, that's why I asked.

bwkaz
04-07-2002, 11:13 AM
Oh, I see. I misunderstood.

What's the first directory you get when you open vim and do a ":set runtimepath"? Make an ftplugins directory under there, if it isn't there already. It's important that the .pp matching happens first, otherwise the "setf" may not actually set anything.

You'll need to change the syntax highlighting code to recognize Pascal syntax. You will probably also need to change the indentation code to work when filetype is pascal.

You can do a ":set filetype" after you've loaded a .pp file, to make sure the filetype setting is correct. If it's pascal, then your problem is most likely with the syntax/indentation setup.

Qubit
04-09-2002, 02:31 PM
Sorry, it doesn't work. I even tried putting the ftplugin directory in every directory in my runtimepath, but still no success...

bwkaz
04-09-2002, 06:47 PM
When you load a .pp file, then do a ":set filetype", what comes back?