Learning Linux programming with me (iii) ------ tools

Source: Internet
Author: User

This time I will talk about the remaining two tools.
Emacs is a heavyweight editor in Linux. In fact, it is not just an editor. You can regard it as an integrated development environment, which will be mentioned at the end of the article. Emacs is designed to focus on editing. It provides support for shell and other tools, but is completed in its editing environment. There are a lot of shortcut keys for a stable editing environment, which is very different from Windows's habits. However, it should be noted that all operations in Emacs can be completed through shortcut keys, and when you make it a part of your life, it is very efficient. Of course, here I would like to thank the people who have made great contributions to the GNU World, not much.
It took me two days to practice these shortcuts. Then I threw away my notepad in windows and installed a notepad for Windows.
There are two shortcut keys in Emacs: CTRL (C) and ESC (a variant of Emacs) can be replaced by Alt, represents the form of the full version of the shortcut key, commonly used Shortcut Keys include the following:
C-x C-F open the file
C-x C-s save the file
C-x s stores all open Buffers
 
C-x O to another window
C-x 1 maximizes the current window
C-x 2 splits the current window into two vertical windows
C-x 3 splits the current exit into two horizontal windows.

ESC-x C-set-style can be used in C mode, for example, indent mode or something.
Simple, huh, I will mention other things later. The more you know about tools, the higher your productivity. When foreigners regard Emacs as a file, they can see its impact. In China, a book about it seems to be called (version 2). The name is forgotten, I just look at what I learned. Finally, many people are using another editor VI, which is also a powerful tool, but I have never used it, so it cannot be compared.
The last one is GDB, a program debugging tool in character mode. Why do we need to use the character mode instead of the graphic mode? In other words, not all Linux systems support the graphic mode, but all Linux systems support this mode. Although there are some debugging tools in the graphic mode, you may know what you need most after reading the final description in this article. I remember someone saying that if you are not happy, you don't know how to seek happiness. Okay, let's talk about GDB. Open GDB first, and then use the open command to open the executable program to be debugged, provided that your program uses the-G parameter during compilation to add debugging information. Run the program, kill the program, watch the program, and break the breakpoint. Here we will describe that you can run the program in the form of a row number, you can also use a file in the form of a function. For C ++, you can use the class name: the form of a member function; Use the continue to continue running; Use the step to step in; use next for one-step execution without entering the function. There are many other commands, which are the most commonly used.

You may say that this is much different from the development environment in windows. Do we need to switch back and forth between different applications? No, no. These four tools are combined in Linux to form a powerful integrated development environment. This allows you to execute all the operations in a program, their adhesive is Emacs, which uses ESC-x compile to compile the files in the current working directory. The program will automatically open a window to display the compilation result, use C-x '(~ You can specify the wrong position without shift. You can use ESC-x GDB to debug the program, when a breakpoint is interrupted, emacs automatically searches for the file and points it to the current row, which is the same as that of VC. If you want to execute shell, you can use ESC-x shell to do this. Of course, it can also open other shells. If you want to use Emacs to integrate a tool named RVs, it has never been used. Sorry, I use CVs. With such a powerful tool, do you still need an integrated development environment? I think we still need it, such as cbx, haha. Why do we need it, because not all Linux systems have cbx, I don't want to say it again. Let's get there today. Well, let me know what else to talk about.
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.