I have a config file under my python project, called "logging.conf", the file looks like:
[formatters] keys: console, logging [formatter_console] format: %(asctime)s | %(message)s [formatter_logging] format: %(message)s etc etc etc
Tried :syntax on
, nothing happened, the .conf files look very plain. Is there anyway I can turn on some syntax to make the .conf file more colorful and readable?
To enable Syntax Highlighting feature in VI editor, open the file called /etc/profile. Add the alias function to VI by pointing to VIM in /etc/profile file. This file is used to set alias functions globally. If you would like to set user specific aliases and functions, then you need to open the file .
Add the text, “syntax on” anywhere in the file to enable syntax highlighting permanently for vim editor. Save and close the file by typing ':x'. For disabling the feature, just re-open . vimrc file, change the text “syntax on” to “syntax off” and save the file.
vim/syntax/ folder, they cannot be loaded from anywhere else. So even though syntax/python. vim comes bundled with Vim and is available in /usr/share/vim/vim72/syntax/python. vim , if an alternative version is instead loaded from ~/.
You can check vim.org or the Internet for a suitable syntax.
As a first approximation, this somewhat looks like DOS / Windows INI files. Vim comes with a syntax for them; try
:setf dosini
If that suits you, you can add a filetype detection rule:
:autocmd BufRead,BufNewFile logging.conf setf dosini
See :help ftdetect
for details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With