bash vi mode: What does # -*- mode: ruby -*- # vi: set ft=ruby : mean?

Solution 1:

Those lines are modelines which tell an editor (e.g. emacs or vi) to choose a specific editing mode for a file. An editing mode affects how editor e.g. higlights and indents contents of the file.

You can read more about modelines for emacs (which are called file-local variables) here and modelines for vim here.