[time-nuts] Semi OT - TIP Use Vim to color code NTP.CONF

Ron Frazier (NTP) timekeepingntplist at c3energy.com
Tue Mar 27 14:45:43 UTC 2012


Hi all,

Here's a neat trick I just discovered.  If you like to put lots of 
comments in NTP.CONF, as I do, it's sometimes a challenge to find where 
the active lines are and where the comments are.

I just discovered that, if you use the VIM programmer's editor to edit 
the file, all the comment lines are automatically color coded blue and 
all the active lines are color coded black.  This makes it very easy to 
see the structure of the file.  Not wishing to start a firestorm 
discussion of editors, you could use any programmer's editor that 
recognizes and color codes the lines with # as a comment.  VIM is even 
smart enough to recognize in line comments after an active command.

I've also extracted almost all my explanatory comments and put them in 
special sections with two blank lines before and after like so:


#########################################################
###          explanatory comments
###  here's the theory of how the next commands work
###  so on and so forth etc etc etc
#########################################################


That also makes it easier to read the file.

See the following:

http://dl.dropbox.com/u/9879631/vim%20sample%20image.png

http://dl.dropbox.com/u/9879631/ntp.conf-normal

VIM is available for almost any platform, including graphical versions, 
which I prefer.  The graphical version for Ubuntu is called gnome-vim or 
is it vim-gnome in the repository, and gvim once it's installed.  I have 
no idea if it works with Unity.

http://www.vim.org/

Sincerely,

Ron


-- 

(PS - If you email me and don't get a quick response, don't be concerned.
I get about 300 emails per day from alternate energy mailing lists and
such.  I don't always see new messages very quickly.  If you need a
reply and have not heard from me in 1 - 2 weeks, send your message again.)

Ron Frazier
timekeepingdude AT c3energy.com




More information about the time-nuts mailing list