Wednesday, November 20, 2013

Re: File type detection.

On Wed, Nov 20, 2013 at 2:46 PM, Bartosz Gradzik <bartosz.gradzik@yahoo.com> wrote:
Hi Gary,

Thanks for the answer. I made couple of tests and this is what I found out.

It works perfect when I run "vim -N -u NONE" as you did.
When I run "vim -N --noplugin" there are some things I do not understand.

Test 1: "vim -N --noplugin" (no ~/.vimrc and no ~/.vim/filetype.vim)
:set rtp?

runtimepath=~/.vim,/usr/share/vim/vimfiles,/usr/share/vim/vim74,/usr/share/v
im/vimfiles/after,~/.vim/after
:scriptnames
  1: /etc/vimrc
  2: /usr/share/vim/vim74/syntax/syntax.vim
  3: /usr/share/vim/vim74/syntax/synload.vim
  4: /usr/share/vim/vim74/syntax/syncolor.vim
  5: /usr/share/vim/vim74/filetype.vim
  6: /usr/share/vim/vim74/ftplugin.vim

Why does VIM load /etc/vimrc if the directory is not in rtp?
 
[snip]
 
I am pretty sure all problems are made because /etc/vimrc. I do not
understand why VIM loads that file.
Right now I not able to touch that file since I have no permission (this is
computer at work).

Regards,
Bartosz

     The usual convention on this mailing list is to reply at the bottom.  (I am doing this even though Gmail makes it inconvenient.)  I only ask that you avoid mixing top-reply and bottom-reply on the same thread.

     As a practical solution to your original question, simply use
:set ft=mytype
in your personal filetype.vim instead of
:setf mytype

     As for /etc/vimrc, it is almost certainly the system vimrc file.  What sort of system are you using?  If it is Red Hat, then I am not surprised that /etc/vimrc is causing trouble.  Do they still patch vim without updating their version of the docs?

:help :setf
:help :startup
:help system-vimrc

HTH
-- 
Benji Fisher 

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
 
---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: