I don't save my shell scripts with a .sh extension. So when i launch a new file with vim using vim <filename>, it identifies the script type by reading the shebang. Naturally, this only happens after I have typed in the shebang, saved and then reopened the file... Was wondering if there is some command line option or vim command mode option so I can avoid these unnecessary steps of saving and reopening, and vim just knows that i am working on a shell script.
How to make vim recognize the script type and turn on autoindent and syntax highlighting, without needing to save and reopen file?
computronium
- 878
- 11
- 19