edenzik / macvim

Automatically exported from code.google.com/p/macvim
0 stars 0 forks source link

Filetype detection doesn't work when used through the mvim script #104

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
To reproduce the problem, type $ lines below in the terminal and follow 
instructions.

$ touch test.py
$ mvim test.py

The filetype hasn't been detected. If you instead open it by:

$ mvim .

...and opening the file through the browser. The filetype is detected. And it's 
also detected if I 
open it through File->Open window.

This is on MacVim Version 7.1 (32)

I'm not really sure if this issue is related to issue 52, because there should 
not be any case-
sensitivity issues in here.

Original issue reported on code.google.com by vaino.ja...@gmail.com on 8 Jul 2008 at 12:06

GoogleCodeExporter commented 9 years ago
Works for me. Where do you have the `filetype on` line? This needs to be in your
_vimrc to enable file type detection, and as far as I know it needs to be after 
`set
nocompatible` (which needs to be the first command in your _vimrc). If the line 
is in
your _gvimrc, it might be possible file type detection is not yet activated when
MacVim reads the file.

Original comment by nicotha...@gmail.com on 8 Jul 2008 at 6:17

GoogleCodeExporter commented 9 years ago
set nocompatible is before filetype settings, filetype settings are inside 'if 
has("autocmd")'  branch.

Original comment by vaino.ja...@gmail.com on 9 Jul 2008 at 8:58

GoogleCodeExporter commented 9 years ago
Can you post the contents of your vimrc?

Original comment by nicotha...@gmail.com on 11 Jul 2008 at 9:02

GoogleCodeExporter commented 9 years ago
Here is my vimrc as an attachment

Original comment by vaino.ja...@gmail.com on 15 Jul 2008 at 6:03

Attachments:

GoogleCodeExporter commented 9 years ago
I'm having this problem right now. Is there a solution?

Original comment by leehb...@gmail.com on 14 Feb 2009 at 9:29

GoogleCodeExporter commented 9 years ago
First of all, make sure that it isn't your .vimrc/.gvimrc files or .vim folder 
that
are causing the problems.  Rename all of those and create a minimal .vimrc file 
only
containing the following two lines:

set nocompatible
filetype plugin indent on

Does that fix the problem?

Original comment by bjorn.winckler@gmail.com on 14 Feb 2009 at 9:37

GoogleCodeExporter commented 9 years ago
I have discovered that if I totally delete my .vim directory (renamed to 
.vim-x) then
I can start MacVim with mvim fileName and the filetype is detected. But as soon 
as I
create a .vim directory, even if the .vim directory is totally empty, starting 
MacVim
through mvim fileName no longer detects the filetype and the syntax coloring is 
not
loaded. If I open a file with mvim test.php I can then issue the command 
:filetype
detect and syntax coloring is turned on. This seems really odd since the .vim
directory start out totally empty. But after launching mvim there is a .vim/view
directory automatically created. In it there appears to be a file for every 
file I
have opened using mvim. For example, I have opened a file called 
rename-files.php and
there is a file called .vim/view/~=+bin=+rename-files.php=

Original comment by leehb...@gmail.com on 14 Feb 2009 at 10:12

GoogleCodeExporter commented 9 years ago
Deleting my .vimrc and my .gvimrc files and using the bare bones .vimrc file 
does
work. Very strange problem, Thanks for the help!

set nocompatible
filetype plugin indent on

Original comment by leehb...@gmail.com on 14 Feb 2009 at 10:17

GoogleCodeExporter commented 9 years ago
Try commenting out all lines in your .[g]vimrc files and uncomment one line at 
a time
until you find the offending line.  It would be nice to know exactly what is 
causing
this problem in case other users come across it.  Thanks!

Original comment by bjorn.winckler@gmail.com on 17 Feb 2009 at 5:25

GoogleCodeExporter commented 9 years ago

Original comment by bjorn.winckler@gmail.com on 28 Nov 2009 at 6:25

GoogleCodeExporter commented 9 years ago
I encountered same problem.  After debugged line by line I found out the 
following
two lines were the culprit:

"au BufWinLeave * silent! mkview
"au BufWinEnter * silent! loadview

Not sure why though...

Original comment by dty...@gmail.com on 26 Apr 2010 at 1:45