What are the alternatives to vi's command :hi Comment in Emacs?

  • Thread starter heartless
  • Start date
In summary, the conversation is about finding an alternative for vi's command that highlights comments in Emacs. The person asking the question is also looking for a way to turn off background completely in Emacs. It is suggested to use .el files in Emacs to highlight specific commands and there is an option to turn on global highlighting in plain text files.
  • #1
heartless
220
2
Hello,
I'm looking for an alternative of vi's command: :hi Comment... in Emacs,
anyone knows?

p.s Is there a method to turn off background complitely in Emacs?

Thanks,
 
Computer science news on Phys.org
  • #2
What does the vi command do?
 
  • #3
oh, sorry for not mentioning. It highlights all the comments in a text.
 
  • #4
In emacs you generally have .el (elisp) files which, as one option - stuff will appear as buttons at the top of your window, allow you to highlight...

eg. If you have the matlab.el file, you can highlight all the MATLAB commands...

Also lots of these will be built in (with the emacs compilation), eg. global highlighting for c++ (.cc) files and .tex files + executables .sh

Plain text though, I'm not sure...

Assuming it's .txt, hit the Options button at the top of the window and switch on the global highlighting - though I can't think waht it would highlight in a standard txt file?
 

1. What is the difference between Emacs and vi?

Emacs and vi are both popular text editors used in the field of computer science. However, they have different design philosophies and user interfaces. Emacs is a more comprehensive and extensible editor, while vi is known for its simplicity and efficiency.

2. Can Emacs be used as an alternative to vi?

Yes, Emacs can be used as an alternative to vi. While vi is a standalone editor, Emacs is a complete operating system that includes a text editor. It has a steep learning curve, but once mastered, it offers more features and customization options than vi.

3. What are the advantages of using Emacs over vi?

Emacs offers a wide range of features such as syntax highlighting, auto-completion, and built-in debugging tools that are not available in vi. It also has a powerful macro system and supports multiple programming languages, making it a preferred choice for programmers.

4. Is it possible to use vi commands in Emacs?

Yes, it is possible to use vi commands in Emacs by using the vi emulation mode. This mode allows vi users to use their familiar commands and key bindings in Emacs, making the transition between the two editors easier.

5. Which editor is better for beginners, Emacs or vi?

Both Emacs and vi have their own learning curves, but vi is generally considered to be more beginner-friendly due to its simple and intuitive interface. However, with proper training and knowledge, Emacs can be a powerful tool for beginners as well.

Similar threads

  • Computing and Technology
Replies
13
Views
5K
Replies
3
Views
853
  • Computing and Technology
Replies
14
Views
1K
Replies
10
Views
2K
  • Computing and Technology
Replies
2
Views
3K
  • Programming and Computer Science
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
1K
  • Introductory Physics Homework Help
Replies
7
Views
1K
  • Electrical Engineering
Replies
12
Views
2K
  • Programming and Computer Science
Replies
6
Views
3K
Back
Top