add edgy syntax highlighting to sources.list

Bug #30796 reported by KarlGoetz
8
Affects Status Importance Assigned to Milestone
vim
Fix Released
Undecided
Unassigned
vim (Ubuntu)
Fix Released
Low
Sebastian Dröge

Bug Description

When using VIM to edit apts sources.list, it uses syntax highlighting for Debian (main, contrib, nonfree), instead of Ubuntus main, restricted, universe, and multiverse.
As of the time of posting, it also lacks colouration of the word `dapper`, however all previous versions of ubuntu are colourised.

Bellow is a diff (produced with diff -u) that should help to fix the syntax highlighting.

--- debsources.vim 2006-02-08 18:27:14.000000000 +1030
+++ debsources.vim2 2006-02-08 18:28:06.000000000 +1030
@@ -22,15 +22,15 @@
 setlocal iskeyword+=-

 " A bunch of useful keywords
-syn keyword sourcesKeyword deb deb-src
-syn keyword sourcesKeyword main contrib non-free
+syn keyword sourcesKeyword deb deb-src
+syn keyword sourcesKeyword main restricted universe multiverse

 " Match comments
 syn match sourcesComment /#.*/

 " Match uri's
 syn match sourcesUri +\(http://\|ftp://\|file:///\)[^' <>"]\++
-syn match sourcesDistrKeyword +\([[:alnum:]_./]*\)\(woody\|sarge\|etch\|old-stable\|stable\|testing\|unstable\|sid\|experimental\|warty\|hoary\|breezy\)\([[:alnum:]_./]*\)+
+syn match sourcesDistrKeyword +\([[:alnum:]_./]*\)\(warty\|hoary\|breezy\|dapper\)\([[:alnum:]_./]*\)+

 " Associate our matches and regions with pretty colours
 if version >= 508 || !exists("did_debsources_syn_inits")

Revision history for this message
KarlGoetz (kgoetz) wrote :

its not so important, so minor, and i dont know if there is a way to make it not on `vim (upstream)`, since its our (ubuntus) problem.

Revision history for this message
Venkat Raghavan (venkatraghavan) wrote : Patch for correct syntax hilighting

Correct Synatax Hilighting in the one true editor is very important :)

Please also find the diff attached. generated using 'diff -u' in /usr/share/vim/vim64/syntax/

KarlGoetz (kgoetz)
Changed in vim:
status: Unconfirmed → Confirmed
Revision history for this message
KarlGoetz (kgoetz) wrote : Re: Syntax highlighting in sources.list is wrong

changed to confirmed since the 2 people who confirmed it were using ubuntu (one Ubuntu one Kubuntu), and its not a big issue(so set to minor)

Changed in vim:
status: Unconfirmed → Confirmed
Revision history for this message
Barry deFreese (bddebian) wrote :

I am adding a debdiff. Can someone that knows vim better than me, test it? Thanks.

Changed in vim:
status: Confirmed → Needs Info
Revision history for this message
Barry deFreese (bddebian) wrote : Patch for Highlighting

Someone please test. :-)

Revision history for this message
KarlGoetz (kgoetz) wrote : Re: Syntax highlighting in sources.list is wrong

This fixes the "universe" and "multiverse" entries.
 dapper-updates dapper-security restricted
Are all still uncolourised. (the dapper part is colourised, the -updates and -security bits not)

Revision history for this message
KarlGoetz (kgoetz) wrote : Final update for sources

This debdiff should take vim from 2ubuntu2 (repos version) to 2ubuntu4, which includes the previous patch posted by Barry deFreese.

Revision history for this message
Martin Pitt (pitti) wrote : Re: Syntax highlighting in sources.list is wrong

Taking, looks easy enough. Thanks to all for the provided patches!

Changed in vim:
assignee: nobody → pitti
status: Needs Info → In Progress
Revision history for this message
Martin Pitt (pitti) wrote :

 vim (1:6.4-006+2ubuntu3) dapper; urgency=low
 .
   * debian/updates/deb{control,sources}.vim: Add Ubuntu releases and
     components. Thanks to Karl Goetz <email address hidden> and
     Barry deFreese <email address hidden> for their initial patches.
     Closes: LP#30796

I didn't remove the Debian keywords, since it's not unreasonable to edit Debian apt sources with Ubuntu's vim.

Changed in vim:
status: In Progress → Fix Released
Revision history for this message
Alan Tam (at) wrote :

How about adding edgy to the list? etch was on the list.

Revision history for this message
Martin Pitt (pitti) wrote :

@Alan: will do that for edgy.

Changed in vim:
status: Fix Released → Confirmed
Revision history for this message
KarlGoetz (kgoetz) wrote : Re: [Bug 30796] Re: Syntax highlighting in sources.list is wrong

AlanTam wrote:
> How about adding edgy to the list? etch was on the list.
>
good idea. (and thanks martin for changing the summary).
Edgy hadn't been announced yet when Barry and I did our trys :)
kk

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

Edgy added

Changed in vim:
status: Confirmed → Fix Released
Revision history for this message
KarlGoetz (kgoetz) wrote :

This bug has reared its head again on my to systems -
edgy
-security
-updates
universe
multiverse
restricted
are all uncoloured again.

$ apt-cache policy vim
vim:
  Installed: 1:7.0-017+8ubuntu2
  Candidate: 1:7.0-017+8ubuntu2
  Version table:
 *** 1:7.0-017+8ubuntu2 0

Revision history for this message
KarlGoetz (kgoetz) wrote :

I just checked the changelog in /usr/share/doc/vim/ :
vim (1:7.0-017+8ubuntu2) edgy; urgency=low

  * Cleaned up cruft in debian/rules diff.
  * Build vim-full, since we can build it in main.
  * Restore old changelog entries.
  * patches/901_debchangelog: Add *-security and *-updates pockets for Ubuntu
    releases.

^^^^^^ Last point hasnt happened that i can see, and i dont know if its related, but theres issues with changelogs and 'dapper' entries - it highlights them in red.
kk

Changed in vim:
assignee: pitti → nobody
status: Fix Released → Confirmed
Revision history for this message
KarlGoetz (kgoetz) wrote :

(sorry for spaming)
its (-updates, -security) in the file ./patches/901*diff, but it doesnt seem to have any effect. for my binary vim.

Revision history for this message
KarlGoetz (kgoetz) wrote :

This is also the case on a dapper live cd, so a post as a summary:

Vim in Edgy isnt colouring these strings:
edgy
restricted
universe
multiverse
-updates
-security

Vim in Dapper isnt colouring these strings:
-updates
-security

I'll try and make a patch, but atm i'm a bit confused by the source package :)

Revision history for this message
KarlGoetz (kgoetz) wrote :

fix should add:
dapper + edgy + -security + -updates

restricted + universe + multiverse

to the vim syntax highlighting, so this might get fixed in edgy, but probably not dapper :)
kk

Revision history for this message
KarlGoetz (kgoetz) wrote :

asigning to slomo as per request in -motu. patch wanted is the bottom one ;)

Changed in vim:
assignee: nobody → slomo
Revision history for this message
Sebastian Dröge (slomo) wrote :

Should be fixed with 7.0-035+1ubuntu2

Changed in vim:
status: Confirmed → Fix Released
Revision history for this message
KarlGoetz (kgoetz) wrote :

(just changing this for my sanity looking down my reported buglist)

Changed in vim:
status: Unconfirmed → Fix Committed
Revision history for this message
KarlGoetz (kgoetz) wrote :

now maybe it will disapear from my buglist... 2 fix released's

Changed in vim:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.