I'm working on reorganizing my .bashrc. I moved my aliases to .bash_aliases (which is sourced by .bashrc, but I can't figure out how to enable syntax highlighting for this file. vim seems unable to figure out what language the file is in. It works fine for .bashrc. Any ideas?
| |||
|
feedback
|
|
Go to vim and run:
Usually the value will be something like:
That's it, now it should work. | |||||
feedback
|
|
The answer is in this: vimdoc - setf but to throw you a bone, if you just want the syntax & syntax highlighting to work you can do:
Another possiability which I just realized when I was answering another VIM question was that you could also add this section to your .vimrc file and it would automatically enable syntax highlighting for the .bash_aliases file everytime you edit it without needing a modeline or having to manually type in :setf bash each time you open the file.
Thirdly as Mugen Kenichi below in the comments points out, you could also add a modeline to the .bash_alias file also as such:
| |||||||||
feedback
|