Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

What I'm looking for is the Notepad++ feature where I can highlight words on right clicking and choosing one of the 5 styles (so that all instances of that word get highlighted with that color), in some editor in linux (Red hat). I find that it helps me in understanding new code.

share|improve this question
add comment

3 Answers

up vote 2 down vote accepted

Emacs can do it. Once you've loaded a file, press:

Alt + s then h and finally r

or alternatively if your version of Emacs doesn't recognize the previous shortcut:

Alt + x then type highlight-regexp and press Enter

Emacs will ask you the regexp (a simple word or phrase will work too) to highlight, then it will ask you the color name too, usually starting with hi- e.g. hi-yellow (you can use Tab to complete). That's all.

It may sound complicated but that's Emacs; there are plenty of ways to speed up this process if you want to mess up with it. And I suggest you to do so.

share|improve this answer
    
I have come to the conclusion that all the stereotypes about emacs are, in fact, not stereotypes. –  Darth Android Oct 28 '10 at 20:37
    
Yes, it's true. But IMHO Emacs it's the best "text" editor around. –  cYrus Oct 28 '10 at 20:59
1  
C-x M-c M-butterfly... –  dmckee Oct 28 '10 at 22:34
    
BTW @cYrus, my emacs doesn't seem to believe in that keybinding. What version are you using, and what command is bound that way? –  dmckee Oct 28 '10 at 22:38
1  
@dmckee: The command is called highlight-regexp (so you can invoke it with M-x highlight-regexp RET). The key binding was introduced in Emacs 23, and I think there were other improvements to the highlighting features. –  Gilles Oct 28 '10 at 23:08
show 1 more comment

I believe you can use jEdit and the highlight plugin to achieve what you are looking for...

Highlight: Highlights words (or matched regexps) with different colors.

share|improve this answer
add comment

Use Geany. It is the best native linux alternative for Notepad++:

Geany is a text editor using the GTK2 toolkit with basic features of an integrated development environment. It was developed to provide a small and fast IDE, which has only a few dependencies from other packages. It supports many filetypes and has some nice features.

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.