I have a file called .aliases for bash and zsh, I put this line

# vim: set filetype=bash: 

but if I make

: echo &ft

I get conf

link|improve this question

64% accept rate
feedback

1 Answer

That should work. I tried that line myself and it worked. I could be that your 'modeline' option got set to 'nomodeline'. Try executing this and see what you get.

:verbose set modeline?

That will tell you the value of the 'modeline' option and if not the default, where it was last set.

Some Linux distributions set 'nomodeline' in /etc/vimrc or /usr/share/vim/vimrc as a security measure, even though the security problems with 'modeline' have long been fixed.

link|improve this answer
modeline Last set from ~/.vimrc – juanpablo Aug 16 '11 at 5:06
for security, I change the modeline to add this to my ~/.vimrc au BufNewFile,BufRead .*aliases set filetype=sh – juanpablo Aug 16 '11 at 5:24
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.