Some things about Emacs (dispute with VI and use)

Source: Internet
Author: User

the difference between the VI and Emacs

VI Emacs
Shortcut key command VI determines a command by recording a key sequence to form a path in the decision tree. Emacs executes the command immediately by combining keys.
Memory Footprint and customization Because of historical reasons, VI is small and fast, but it is more limited in customization. Emacs starts slowly and takes up more memory, but is highly customizable and contains a lot of complex features. It is basically an execution environment for a Lisp program.
User interface VI previously exclusive command line terminal, no graphical user interface (GUI). Later derivative versions, such as Macvim and Gvim, all feature a full-featured GUI. Emacs was originally designed for the terminal, but it was early with a GUI, and the modern version offers many GUI versions.
Features/Navigation VI named explicit editing mode. Emacs uses the function key combination.

the advantages of the VI type Editor [edit ]
    • Follow the concept of "simple tools, diverse combinations".
    • Small, in line with the Unix philosophy of "do one thing and do it well", avoid the spread of functionality.
    • Faster than Emacs (at least in history).
    • Can run on any system that implements the C standard library, including UNIX, Linux, AmigaOS, DOS, Windows, Macs, BeOS and POSIX compliant systems, and more.
    • Let the "QWERTY" keyboard user keep the finger on the default key so that the finger moves less when editing.
    • More popular. Basically, all Unix and Unix-like systems provide VI or its variants by default.
Advantages of Emacs [edit ]
    • Conforms to the "kitchen sink" concept, providing more features than VI.
    • One of the most widely ported non-trial computer programs. It can run on a variety of operating systems, including most Unix-like systems (Gnu/linux, various BSD, Solaris, AIX, IRIX, AmigaOS, Mac OS X[1][2], etc.), MS-DOS, Microsoft Windows[3][4][5] and OpenVMS. UNIX systems, regardless of free version or commercial version, provide Emacs with the system.
    • Extensible and Customizable (Lisp variant-Emacs Lisp), features include:
      • Special editing mode, supporting a large number of programming languages, markup language, typesetting language, such as bash, C, Delphi, Java, Lisp, LaTeX, MediaWiki, Python, etc.
      • Can simulate VI ("Viper-mode").
      • Powerful extensible File Manager (dired), Smart Debugger, and a large number of tools.

Emacs Installation and configuration under Windows

1. Download
To this URL can be downloaded to the Windows version of Emacs: http://ftp.gnu.org/pub/gnu/emacs/windows/
Only one compressed document is required, such as Emacs-22.3-bin-i386.zip

2. Installation
In the D packing directory to create a new folder, named Emacs22.2 (also can be other paths, depending on personal preferences), Emacs-22.2-bin-i386.zip files extracted into this directory, so in d:/emacs22.2/bin, TEC, Info, Leim, Lisp, Site-lisp and other directories.

Double-click on the Addpm.exe in the Bin folder to install, the GNU Emacs/emacs link will be generated from the Start menu and click this link to activate Emacs. You can also double-click the Runemacs.exe in the Bin folder to start. Note that there is a file in the bin directory that is Emacs.exe, double-clicking it can also be started, but a console window will appear

3. Modify the Registration Form
Open the registry, locate Hkey_local_machine/software/gnu/emacs (if not, add the item manually), add the string value under this key, and the name is home, and the value is d:/emacs22.2. The goal is to make d:/emacs22.2 the home path of Emacs (the legendary Home path, where you will often see "home directories", "Home directory", and so on).

4. Create the. EMACS.D directory and the. emacs File
Believing that the. emacs.d directory and. Emacs files are a long-lasting problem, there is an easy way to solve this problem. To activate Emacs, click on the Options menu with your mouse and click on one or two options, such as click on active region highlighting and click Save Options. Don't worry about what you're going to spoil, so the goal is to have Emacs create the. EMACS.D directory and the. emacs file Automatically! Observing the last line of your Emacs window, do you see "wrote D:/emacs22.2/.emacs"? If that's right, when you choose the Save options, Emacs generates the. emacs file under the home path and writes the configuration information into this file. Now look at your d:/emacs22.2/directory to produce these two things?

5. Load the. El file
The Lisp directory contains the Lisp source file (*.el) and the compiled Lisp file (*.ELC), and you can also place your. El file in this directory later, and then insert the related statement in the. emacs file. For example, you have a file called Abcd.el, copy it to the Lisp directory, and then open the. emacs file to insert a sentence (require ' ABCD) on it (including parentheses, no extension. el).

If you do not like Lisp folder, you can also create a new one yourself, such as in the home directory to build a folder called XYZ, and then put Abcd.el in the XYZ directory, in the. emacs file Insert the following two sentences:
(Setq Load-path (cons "~/xyz" Load-path))
(Require ' ABCD)
The first sentence tells Emacs to load your XYZ directory first, then the second sentence to load Abcd.el. Note that "~/" is a Linux system usage that represents the home directory.
If you and I are learning the Sams Teach yourself Emacs in Hours book, I think you need to sams-lib.el this file! Can be downloaded to this URL:
http://www.cs.virginia.edu/~wh5a/personal/Emacs/
After you find Sams-lib.el, right click on "Save Target as"!

Above: The path and environment variable settings, that is, hoem worth setting some contradictions, with the cadence of the work of the path contradiction, the back of the cadence of the path changed.

1. Download
To this URL can be downloaded to the Windows version of Emacs: http://ftp.gnu.org/pub/gnu/emacs/windows/
Only one compressed document is required, such as Emacs-22.3-bin-i386.zip

2. Installation
In the D packing directory to create a new folder, named Emacs22.2 (also can be other paths, depending on personal preferences), Emacs-22.2-bin-i386.zip files extracted into this directory, so in d:/emacs22.2/bin, TEC, Info, Leim, Lisp, Site-lisp and other directories.

Double-click on the Addpm.exe in the Bin folder to install, the GNU Emacs/emacs link will be generated from the Start menu and click this link to activate Emacs. You can also double-click the Runemacs.exe in the Bin folder to start. Note that there is a file in the bin directory that is Emacs.exe, double-clicking it can also be started, but a console window will appear

3. Modify the Registration Form
Open the registry, locate Hkey_local_machine/software/gnu/emacs (if not, add the item manually), add the string value under this key, and the name is home, and the value is d:/emacs22.2. The goal is to make d:/emacs22.2 the home path of Emacs (the legendary Home path, where you will often see "home directories", "Home directory", and so on).

4. Create the. EMACS.D directory and the. emacs File
Believing that the. emacs.d directory and. Emacs files are a long-lasting problem, there is an easy way to solve this problem. To activate Emacs, click on the Options menu with your mouse and click on one or two options, such as click on active region highlighting and click Save Options. Don't worry about what you're going to spoil, so the goal is to have Emacs create the. EMACS.D directory and the. emacs file Automatically! Observing the last line of your Emacs window, do you see "wrote D:/emacs22.2/.emacs"? If that's right, when you choose the Save options, Emacs generates the. emacs file under the home path and writes the configuration information into this file. Now look at your d:/emacs22.2/directory to produce these two things?

5. Load the. El file
The Lisp directory contains the Lisp source file (*.el) and the compiled Lisp file (*.ELC), and you can also place your. El file in this directory later, and then insert the related statement in the. emacs file. For example, you have a file called Abcd.el, copy it to the Lisp directory, and then open the. emacs file to insert a sentence (require ' ABCD) on it (including parentheses, no extension. el).

If you do not like Lisp folder, you can also create a new one yourself, such as in the home directory to build a folder called XYZ, and then put Abcd.el in the XYZ directory, in the. emacs file Insert the following two sentences:
(Setq Load-path (cons "~/xyz" Load-path))
(Require ' ABCD)
The first sentence tells Emacs to load your XYZ directory first, then the second sentence to load Abcd.el. Note that "~/" is a Linux system usage that represents the home directory.
If you and I are learning the Sams Teach yourself Emacs in Hours book, I think you need to sams-lib.el this file! Can be downloaded to this URL:
http://www.cs.virginia.edu/~wh5a/personal/Emacs/
After you find Sams-lib.el, right click on "Save Target as"!

Some things about Emacs (dispute with VI and use)

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.