Vim doesn't respect fileformat setting on windows share [Solved]

1

I have mounted several SMB shares (folders are located on windows server) on my linux machine

gvfs-mount smb://user@domain@fileserver/sharedfolder

I can access files and edit them in vim, but vim enforces fileformat=unix on save. :set ff=dos affect anything. On local files there is no problem.

Update: It turned out that the cause was the old version Shougo/vimfiler plugin. It was not so clear for me at first because I very seldom use this plugin, not for opening remote files especially.

Just update Vimfiler plugin from repo. Preserving fileformat in Vim is working fine now.

AMasz

Posted 2016-05-23T10:35:52.587

Reputation: 11

What file paths does Vim show for opened files? – user1686 – 2016-05-23T10:39:11.053

File path showed in vim: '/run/user/1685001118/gvfs/smb-share:server=fileserver,share=sharedfolder,user=user%40domain/testpf.txt' – AMasz – 2016-05-23T10:49:10.350

That looks okay, I was thinking it might have been using its own SMB access instead of GNOME's. – user1686 – 2016-05-23T11:08:32.280

@AMasz : You can put :au BufWrite *.* :set ff=unix in your ~/.vimrc.And try. It might solve the problem – SibiCoder – 2016-05-28T13:38:15.173

No answers