As of 2016-02-26, there will be no more posts for this blog. s/blog/pba/
Showing posts with label highlight. Show all posts

I never thought I would see italics text in terminal, but I did. I didn't realize what change made this happening when I suddenly saw searching highlights in less had been rendered in italics text. Later, I found out it's the tmux update 1.4->1.5.

A second later, I knew I hate that. It's so hard to see the highlights, I can only be sure there is one hit at the first line of current view. If there is more in the same view, I wouldn't be able to see it. Regular text and italic text look so alike in terminal at first 1000 glances.

Anyway, I found a backward solution, I chose "screen-noit."

I still don't know whose fault is, but clearly it's not as if tmux broke something. In fact, it fixed something what we used to think that's right. However, after all, that really felt suck, and I didn't read anything about it from tmux's changelog 1.4->1.5.

Using colorIT resource


Updated on 2011-07-22

I decided to drop screen-noit and got back to normal screen terminfo with resource setting:

Rxvt*colorIT: #ff0000



I think it's better and prettier, though you might not agree with my color choice. (I ain't no artist!) Anyway, it's now rendered in italic and bloody red style. I can't be missing any highlighted text.

I think highlight.js is better than SyntaxHighlighter. It supports more languages and you don't need to specify. It has pre-defined styles and they looks quite good.

You can download it here. If you are lazy to set up, you can just use mine. I picked up Bash, C#, C++, CSS, Django, HTML, XML, Javascript, PHP, Python, Python profile, and diff. I use Zenburn style with one modification, I make footer bar's background color of code block as transparent.

Installation

You can add a HTML/JavaScript gadget to your footer with the code like:
<script src="http://yandex.st/highlightjs/6.1/highlight.min.js"></script>
<script>
  var hl_style = document.createElement('link');
  hl_style.setAttribute('rel', 'stylesheet');
  hl_style.setAttribute('type', 'text/css');
  hl_style.setAttribute('href', 'http://yandex.st/highlightjs/6.1/styles/zenburn.min.css');
  document.getElementsByTagName('head')[0].appendChild(hl_style);
  hljs.initHighlightingOnLoad();
</script>
If you have your highlight.pack.js, please replace first line with your location. For CSS, please replace sixth line with your CSS location. If you want my settings, just leave them all.

Usage

Wrap your code like
<pre><code>First line of code
Second and ...
</code></pre>

Changelog

  • 2012-02-23 - Update links to script and stylesheet, using the Yandex CDN.