Basic Emacs configuration in Linux

Source: Internet
Author: User

It is really difficult to get started with Emacs. After the two days of use, we will summarize the following:

 

1: Install. Run the sudo apt-Get install Emacs command in Ubuntu. I am using Ubuntu 10.04 and use two sources that are said to be 163.

1.1: how to update the fast source, enter sudo gedit/etc/APT/sources. List in the terminal to add the two addresses, I tested the speed quite fast.

Deb http://ubuntu.cn99.com/ubuntu/ karmic main restricted universe multiverse

Deb-Src http://ubuntu.cn99.com/ubuntu/ karmic main restricted universe multiverse

Add the two addresses to the top and save the file.

 

Run sudo apt-Get update to update the file.

 

1.2: Then you can use sudo apt-Get install Emacs to install Emacs. After installation, enter Emacs in the terminal to open the editor.

 

1.3, later, the source of the E-Science and Technology Department was added quickly in his version!

 

 

2: simple configuration. All online changes. emacs file. After my exploration, I found that if the file installed above does not exist, please create it in the main folder (that is, location-> main folder. emacs file. For example, if my username is sunyanan, I will create an empty. emacs file under/home/sunyanan)

 

You may be talking about hidden files on the Internet. You can open this folder and choose View> show hidden files.

 

Enter some test configuration statements in it. There are a lot of online statements, just write them as needed. I posted an online tool on the following. It looks very good to remove the Emacs tool bar. Generally, tool bar wood is of little use. It uses command line. Copy the text and save the file. Then you can re-open Emacs to see the effect.

 

 

The above is purely original. If it is reproduced, please be noted below.

The following configuration file is found online:

 

 

; Appearance settings

; Color settings, in fact there is a color-theme.el can be set Emacs colorful, very beautiful, but start a little slow, I just chose some color settings.

; Remove the toolbar

(Tool-bar-mode nil)

; Remove the menu bar. I will bind F10 to the display menu bar. If you forget something, you can press F10 to bring it up. Press F10 to remove the menu.

(Menu-bar-mode nil)

; Do not scroll the bar. Now you can scroll the bar without having to scroll it.

(Scroll-bar-mode nil)

; Change the title of the Emacs title bar

(Setq frame-title-format "% B @ Alex-gdlc ")

; Allow Emacs to be pasted with other external programs

(Setq X-select-enable-clipboard T)

; Displays the column number

(Setq column-number-mode t)

; Enable syntax highlighting.

(Global-font-lock-mode 1)

; Set the tab to the width of four spaces

(Setq default-tab-width 4)

(Setq C-Basic-offset 4)

; Set the start Interface

(Set-cursor-color "wheat ")

(Set-mouse-color "wheat ")

(Set-foreground-color "wheat ")

(Set-Background-color "darkslategray ")

(If window-System

(Setq default-frame-alist

(Append

'(Top. 80)

(Left. 100)

(Width. 110)

(Height. 35 ))

Default-frame-alist ))

)

; Maximize startup

; (Setq initial-frame-alist '(top. 0) (Left. 0) (width. 97) (height. 49 )))

; Enable the time display settings on the minibuffer bar (forgot what it is)

(Display-time-mode 1)

; The time is in the 24-hour format.

(Setq display-time-24hr-format T)

; Time Display includes date and specific time

(Setq display-time-day-and-date t)

; The frequency of time change, in what unit?

(Setq display-time-interval 10)

; The mouse automatically avoids the pointer. For example, when you enter the pointer, the pointer is reached, and the mouse is a little out of sight.

(Mouse-avoidance-mode 'animate)

; Pointer should not flash, I have to spend my eyes

(Blink-cursor-mode-1)

; Highlight the content to be copied

(Transient-mark-mode 1)

; When the pointer to a bracket, the matching brackets are automatically displayed.

(Show-Paren-mode 1)

; Is to use the scroll mouse

(Mouse-wheel-mode t)

;;;;Backup settings

; Emacs also has an automatic save function. The default value is ~ /. 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)

; Enables 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.

(Setq kept-New-versions 5)

; Delete versions not in the above 7 versions

(Setq Delete-old-versions T)

;;;;Set the path of the backup file

(Setq backup-directory-alist '(("."."~ /. Emacs. tmp ")))

; Backup setting method, direct copy

(Setq backup-by-copying T)

; Automatic disk storage

(Setq auto-save-mode t)

;;;;Remove annoying warning ringtones

(Setq visible-bell nil)

; It is more comfortable to scroll the page. Do not scroll the whole page.

(Setq scroll-Step 1

Scroll-margin 3

Scroll-Conservatively 10000)

;;;;;Use c-k to delete the pointer to the last part of the modified row.

(Setq-default kill-whole-Line T)

;;;;Set the deletion and storage record to 200, which can be easily restored in the future.

(Setq kill-ring-max 200)

; Is to use the Aspell program as the spelling check for Emacs.

(Setq-default ispell-Program-name "Aspell ")

; This thing must be placed at the end

; Desktop. El is a State that can be saved when you disabled Emacs last time and restored to the last closed state at the next startup. Just like VMware's suspend.

; Because I want to use sawfish-mode, wiki-mode, HTML-helper-mode, and put it here to ensure that the mode required by the file can be correctly recognized at next startup.

(Load "desktop ")

(Desktop-load-default)

(Desktop-read)

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.