Sublime Forum

Modeline without plugin?

#1

I am running Sublime Text 4200 on Windows 10.

I opened up a file which was not named makefile or anything close. It did have an emacs-style modeline at the top of the file:

#-*-Makefile-*-

Sublime Text indeed interpreted the contents as a makefile.

However, I know I am not running any plugins to perform modeline detection.

Does Sublime Text natively support modelines?
If so, where can I find out all of the capability of this support?

(I am looking to see if I can embed in a modeline commands to use spaces instead of tabs, and set the tab width = 4)

Thanks!

0 Likes

#2

No, it does not natively support modelines, at least in the manner that you want.

The reason that this works is that the Packages/Makefile/Makefile.sublime-syntax contains this:

first_line_match: |-
  (?xi:
    ^ \#! .* \bmake\b |                          # shebang
    ^ \s* \# .*? -\*- .*? \bmakefile\b .*? -\*-  # editorconfig
  )

Or if you will, it recognizes if there is what appears to be the part of a modeline that tells it that it’s a makefile. For other options, you would need a plugin to interpret the other portions.

1 Like

#3

Thanks!

Regarding other modeline parsing plugins, are you aware of one which is suitable for Sublime Text 4200? The ones I have seen reference Sublime Text 2 or 3, and I am not sure which would still be compatible.

0 Likes

#4

Generally speaking anything for ST3 should work with ST4 just fine.The main thing that changed in regards to plugins is that a newer version of Python is included, but the older version is still there to execute plugins that don’t declare that they should be run with the new one.

1 Like

#5

Hello, my teacher, where did you go and leave your YouTube channel? I found out about it by chance yesterday and I loved your content. Thank you, my follower from Egypt.

0 Likes

#6

I haven’t posted to YT in a while due to a combination of burnout and the logistics of moving across the country and getting settled. I’m currently working on new content to refresh what’s currently on the channel, but no ETA at the moent

2 Likes

#7

Hello, I use Sublime Text for CP and i use “FastOlympicCoding” package in this packge the default button to run code in right side in pic is “ctrl + alt + b” i want to chang it to f1 for example.


please help me in this problem i post it but no answer yet

0 Likes