apt Syndicate content

warning: Creating default object from empty value in /www/htdocs/w0065fc9/milianw/modules/taxonomy/taxonomy.pages.inc on line 33.

» recent GeSHi contributions (apache, xorg, apt, performance, ...)

Wed, 06/18/2008 - 22:46

Your favourite syntax highlighter for web applications, GeSHi, recently got some new features and bug fixes. By yours sincerely. A rough summary of what I contributed:

  • various performance improvements, i.e. some speed optimizations and reduced memory consumptions (especially peak memory usage is down by roughly 1MB when highlighting geshi.php by itself)
  • minor bugfixes, including one which prevents some nasty PHP notices on PHP 5 systems to contaminate your precious log files
  • improved language files: bash, apache
  • added language files: GNU Gettext, Xorg configuration and Apt sources.list

Some of those features were already shipped with the recent release. But the two new language files and the improvements to the existing apache language file are currently only available via SVN. Wait for the next stable release which should be 1.0.8.

To see two pretty examples, read on after the break:

» highlighted APT sources.list in nano

Tue, 04/10/2007 - 18:17

And here another syntax file for Nano. This time it highlights the /etc/apt/sources.list:

  1. ## syntax highlighting for /etc/apt/sources.list
  3. syntax "apt/sources.list" "sources\.list(\.old|~)?$"
  4. # component
  5. color brightmagenta "^deb(-src)? ((http|file|ftp):/[^ ]+|cdrom:\[[^\]]+\]/|cdrom:\[[a-zA-Z0-9\._-\(\) ]+\]/) [^ ]+ .+$"
  6. # distribution
  7. color brightred "^deb(-src)? ((http|file|ftp):/[^ ]+|cdrom:\[[^\]]+\]/|cdrom:\[[a-zA-Z0-9\._-\(\) ]+\]/) [^ ]+"
  8. # URI
  9. color brightgreen "(http|file|ftp):/[^ ]+"
  10. # cdroms
  11. # [^\]] does not work…
  12. color brightgreen "cdrom:\[[a-zA-Z0-9\._-\(\) ]+\]/"
  13. # deb / deb-src
  14. color cyan "^deb"
  15. color brightblue "^deb-src"
  16. # comments
  17. color brightyellow "#.*"

» Syntax Highlighting in Nano

Tue, 04/10/2007 - 17:14

When I’m messing around with config files on the command line my editor of choice is Nano. It’s simple, fast and pretty much straight forward. You don’t have to learn any commands and can use keyboard shortcuts just like in GUI programs.


Today I had a look on the project website and saw that there are tons of settings which I really missed before. Just have a look into your /etc/nanorc for a default config file with all settings and their default values. Here are those I like most:

  • smooth (scrolling)
  • autoindent
  • mouse (though I use it rarely)
  • smarthome
  • tabsize (8 is far to much, I love 4)
Syntax Highlighting

Yes! Nano supports syntax highlighting! And I never knew it, but heck - it’s never to late. Not for neat features like this one, though I really wonder why this is not activated by default…

In the aforementioned /etc/nanorc are already some default languages which just wait to be commented out. You might also want to have a look into /usr/share/nano, there are some languages you can include in your nanorc file with:

include “/usr/share/nano/html.nanorc”

Additionally I found some more languages on the gentoo wiki. And of course I’ll post any homebrew syntax files in my Snippets section.

my syntax highlighting files