: By the power of this magic string: ex: set ft=markdown ;:<<'```shell' #
, this file is now both a markdown document and an executable shell script. chmod +x
it and try running it!
The above line does just what it says. More specifically, when placed within in the first 5 lines and preceded only by blank lines or #
-prefixed markdown headers:
- The first part of the magic string makes github and various editors (e.g. atom with the vim-modeline packge) treat the file as having markdown syntax (even if the file doesn't have an extension)
- The second part (if run in a shell), makes the shell skip execution until it encounters the next
```shell
block.
(The line also has to start with a :
so that it's valid shell code.)