Introduction to Emacs (ii) Installation and simple configuration

Source: Internet
Author: User
Get Emacs

The current version is 24.1. For details, see http://www.gnu.org/software/emacs /. Supported operating systems include:

       
GNU FreeBSD Solaris Windows MS
GNU/Linux NetBSD Mac OS X MS DOS
GNU/kFreeBSD OpenBSD AIX  

Get Emacs

  • Windows: http://ftp.gnu.org/pub/gnu/emacs/windows/
  • Mac OsX: http://emacsformacosx.com/
  • Unix/Linux: You can use the built-in software package for management. For example, Ubuntu: sudo apt-get install Emacs

Installation Method: Decompress the package for Windows. After Ubuntu is installed, it can be used. Mac OSX is the same. If you download the source package (ftp://ftp.gnu.org/gnu/emacs/), you need to compile.

Configure Emacs

In Windows, you need to modify and configure the Home directory.

  • If the HOME environment variable is set, use its value as the home directory ~
  • If the registry key value HKCU \ SOFTWARE \ GNU \ Emacs \ HOME exists, use its value as the home directory ~
  • If the registry key value HKLM \ SOFTWARE \ GNU \ Emacs \ HOME exists, use its value as the home directory ~ (The difference with 2 is that 2 is only for the current user's registry path, and 3 is for all users)
  • If C: \. emacs exists, use C: \ as the home directory ~
  • If none of the above exists, use \ Users \ AppData \ Roaming as the home directory ~ (For XP and earlier windows users, go to the Documents and Settings directory to find them)

Mac OSX and Unix-like systems are both in the default user directory, that is, the HOME personal folder. The default emacs configuration file contains three (For details, refer to: http://www.gnu.org/software/emacs/manual/html_node/emacs/init-file.html:

  • ~ /. Emacs
  • ~ /. Emacs. el
  • ~ /. Emacs. d/init. el

We usually use the. emacs file for configuration, but some of the most popular ones are placed in the. emacs. d folder. However, though it is a configuration file, the official name is the initialization file. For some simple user-defined and configuration items for searching on the internet, refer:

(Set-cursor-color "white"); set the mouse color to white (set-mouse-color "white ");; set the background color and font color (set-foreground-color "white") (set-background-color "darkblue"); set other colors: set-face-foreground 'highlight "white ") (set-face-background 'highlight "blue") (set-face-foreground 'region "cyan") (set-face-background 'region "blue ") (set-face-foreground 'secondary-selection "skyblue") (set-face-background 'secondary-selection "darkblue ");; setq calendar-load-hook (lambda () (set-face-foreground 'diary-face "skyblue ") (set-face-background 'holiday-face "slate blue") (set-face-foreground 'holiday-face "white ")))
 
; Appearance settings; remove the tool-bar-mode nil; remove the menu bar and bind F10 to the display menu bar. In case something is forgotten, you can press F10 to bring up the menu bar, and press F10 to remove the menu (menu-bar-mode nil); Do not scroll the bar. Now you can use the scroll axis mouse, you do not need to scroll the bar (scroll-bar-mode nil); Backup Settings; emacs also has an automatic save function, which is default in ~ /. Emacs. d/auto-save-list: This is very useful. I have not changed it here. For details, see Sams teach yourself emacs in 24 hours (I am referred to as sams24); Enable version control, that is, you can back up multiple times (setq version-control t); back up the original version twice, record the document before the first edit, and the document before the second edit (setq kept-old-versions 2); back up the latest version five times, understand the same as above (setq kept-new-versions 5 );; delete A version not in version 7 (setq delete-old-versions t); and set the path of the backup file (setq backup-directory-alist '((". ". "~ /. Emacs. tmp "); backup setting method, direct Copy (setq backup-by-copying t); Automatic completion function, which is directly copied from Wang Yin's website, you can set the following method to complete hippie-expand. It is a priority list, and hippie-expand will use the function at the top of the table to complete; this is to say, first use the current buffer to complete, if not found, find it in other visible windows. If not, find it in all opened buffers. If not ...... Go to kill-ring, go to the file name, go to the abbreviation list, go to list ,...... The matching method is displayed in the echo area.; It is particularly interesting to try-expand-line, which can help you complete a full line of text. I often have two lines of text that are roughly the same, but only a few words are different, but I am too lazy to copy and paste the following. Then I will enter the first few words in this line of text. Then press M-/to obtain the row. (Global-set-key [(meta? /)] 'Hippie-expand) (setq hippie-expand-try-functions-List' (try-expand-line-all-buffers try-expand-list-all- buffers try-expand-dabbrev-visible try-expand-dabbrev-all-buffers try-expand-dabbrev-from-kill try-complete-file-name try- complete-file-name-partially try-complete-lisp-symbol-partially try-expand-whole-kill ));; timestamp settings Set (time-stamp) to set the last saved information of the document; as long as there is a Time-stamp: Setting in your document, the timestamp will be automatically saved ;; enable time-stamp (setq time-stamp-active t); remove the time-stamp warning? (Setq time-stamp-warn-inactive t); set the time-stamp format. An example is obtained in the following format: 

However, we know that Emacs is more important to its expansion and increasing features. We can use some to add some modes and functions.

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.