on my ubuntu server vim got no syntax highlighting when i open files (configurations, scipts...).
i have tried with
:syntax on :syntax enable
and it ways in vim that its enabled, but it doesnt work
someone knows how to fix it?
vim detects filetype by extension.
assuming the file is a bash script. ft stands for filetype. Similarly you can get syntax highlighting for other files by setting filetype to xml,html,php,python accordingly. If you need more info on this,
Hope this helps.
edit:For retaining filetypes.
Add this to your vimrc file. This code stores the filetype and other local options set for the file when vim exits. You need to set the filetype only once.
Do you have at least an empty .vimrc in HOME?
AFAIK, if that file is missing, vim will start in vi-compatible mode. That might be a reason for missing syntax highlighting.
Adding as a comment to your comment;
The shebang at the beginning of the file indicates for vim what kind of a script it is. IIRC, sometimes you have to save the file and then reopen it before syntax highlighting turns on, as well.
Since it's a server configuration, the problem is likely that you don't have the