You are not logged in.

#1 2012-07-10 20:26:29

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

[Solved] Vim ignoring modelines

This line is at the end of a load of my bash scripts, but none of the settings are getting applied (for the several files I've tried).
It's the last line in my file.

# vim:set ts=4 sw=4 ft=sh et:

I've got no modeline setting in my vimrc, so no idea why it's being ignored unless there's one. I've read though the vim help and have done a quick internet search, but can't find anything obvious.
Any ideas?

Last edited by skanky (2012-07-11 09:32:43)


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#2 2012-07-11 08:56:56

pshevtsov
Member
From: Novosibirsk, Russia
Registered: 2011-01-20
Posts: 52

Re: [Solved] Vim ignoring modelines

What is the output of the command

:set modelines

when it is run in vim?

Offline

#3 2012-07-11 09:02:29

JackH79
Member
From: Australia
Registered: 2009-06-18
Posts: 663
Website

Re: [Solved] Vim ignoring modelines

I think the expandoption shouldn't have a colon. What happens if you try:

# vim: ts=4 sw=4 ft=sh et

Offline

#4 2012-07-11 09:25:25

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: [Solved] Vim ignoring modelines

pshevtsov wrote:

What is the output of the command

:set modelines

when it is run in vim?

modelines=5


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#5 2012-07-11 09:32:19

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: [Solved] Vim ignoring modelines

JackH79 wrote:

I think the expandoption shouldn't have a colon. What happens if you try:

# vim: ts=4 sw=4 ft=sh et

That doesn't change behaviour, and  I think it goes against what the help says.

However, it looks like the issue is elsewhere, as looking at the settings, the modeline isn't getting ignored, it's the behaviour isn't as I expect from those settings. This could be user error, but whatever it is, it isn't modelines getting ignored. So I'll mark this as solved and look into the behaviour issue.

Many thanks for your replies. smile


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

Board footer

Powered by FluxBB