Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 85808 - syntax highlighting for dhcpd.conf in vim
Summary: syntax highlighting for dhcpd.conf in vim
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Vim Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-18 12:09 UTC by Bjarke Istrup Pedersen (RETIRED)
Modified: 2005-03-24 15:38 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2005-03-18 12:09:41 UTC
It would be really nice if there where syntax highlighting for the dhcpd.conf file in vim.
I don't know how big a task it would be to implement :)

Reproducible: Always
Steps to Reproduce:
Comment 1 Ciaran McCreesh 2005-03-21 11:48:05 UTC
http://www.vim.org/scripts/script.php?script_id=744

^^ try that. If it's any good I'll make a -syntax package for it.
Comment 2 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2005-03-21 13:04:32 UTC
I tried downloading it to /usr/share/vim/vim63/syntax and run vim on dhcpd.conf, but it highlights nothing, is there something I should do to "load" the syntax file?
Comment 3 Ciaran McCreesh 2005-03-21 13:20:43 UTC
You'll need to do :setf dhcpd for now. If we go with this one I'll add an ftdetect file for it that'll do this for you.
Comment 4 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2005-03-21 13:25:30 UTC
It works nice, though it cannot tell if I define two servers as etc. ntp-servers like this:
option ntp-servers 193.162.159.194, 192.168.3.1;
"option ntp-servers" is green.
"193.162.159.194," is white (should be red).
"192.168.3.1;" is red.
Comment 5 Ciaran McCreesh 2005-03-24 08:44:02 UTC
--- dhcpd.vim.orig	2005-03-24 16:41:59.755564944 +0000
+++ dhcpd.vim	2005-03-24 16:42:15.894111512 +0000
@@ -33,7 +33,7 @@
 " Base constructs {{{
 syn match dhcpdString +"[^"]*"+
 syn match dhcpdDecNumber "\<-\?\d\+\(;\|\s\|$\)"
-syn match dhcpdIPv4 "\<\(\d\{1,3}\.\)\{3}\d\{1,3}\(;\|\s\|$\)"
+syn match dhcpdIPv4 "\<\(\d\{1,3}\.\)\{3}\d\{1,3}\(;\|\s\|,\|$\)"
 syn match dhcpdMAC "\<\(\x\x\?:\)\{5}\x\x\?\(;\|\s\|$\)"
 syn match dhcpdDate "\<[0-6]\s\d\{4}/\d\d/\d\d/\s\d\d:\d\d:\d\d\(;\|\s\|$\)"
 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" }}}

How's that?
Comment 6 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2005-03-24 15:18:19 UTC
Yep, that works :)
Comment 7 Ciaran McCreesh 2005-03-24 15:38:38 UTC
app-vim/dhcpd-syntax