Emacs configuration file in Ubuntu9.10

Source: Internet
Author: User
Emacs configuration file in Ubuntu9.10; -------------------- color topic ------------------------- (setqload-path (cons "~ /. Emacs. d "load-path) (require 'color-theme) (color-theme-initialize) (color-theme-dark-blue );;------

Emacs configuration file in Ubuntu 9.10

; ---------------- Color topic ---------------------------
(Setq load-path (cons "~ /. Emacs. d "load-path ))
(Require 'color-theme)
(Color-theme-initialize)
(Color-theme-dark-blue)

; -------------------- The following is my shortcut key settings ---------------------
; ----------------------- Short Cut -------------------------
(Global-set-key [(meta g)] 'Goto-line)
; (Global-set-key [(meta? /)] 'Hippie-expand)

; F12 t create a task from the current Buffer
(Global-set-key (kbd" T ") 'planner-create-task-from-buffer)
; F12 g switch to the task of the current day
; (Global-set-key (kbd" G ") 'planner-goto-today)
(Global-set-key (kbd" G ") 'planner-goto-today)
(Global-set-key (kbd" P ") 'Plan)
; F12 r add current memo
(Global-set-key (kbd" R ") 'Remember)
; F12 c switch to calendar
(Global-set-key (kbd" C ") 'calendar)

; F2: Enter the wiki-mode
(Global-set-key [(f2)] 'emacs-wiki-find-file)

; F3: Switch to dired Mode
(Global-set-key [(f3)] 'd D)

; F4: Switch to shell mode
(Global-set-key [(f4)] 'ansi-term)


; F5: Open speedbar
(Global-set-key [(f5)] 'speedbar)

; F7: Call compile
(Global-set-key (kbd" ") 'Compile)

; Alt + s: Give speedbar focus
(Global-set-key (kbd "M-s") 'speedbar-get-focus)

; F9: list my bookmarks
(Global-set-key (kbd" ") 'LIST-bookmarks)

; F10: add the current page to the bookmarks
(Global-set-key [(f10)] 'bookmark-set)

; F12 u updates the current version
(Global-set-key (kbd" U ") 'vc-next-action)

; ------------------------ End of Short Cut ---------------------

; ----------------------- Disable the 'boot Screen '------------ at startup '------------
(Setq inhibit-startup-message t)

; ------------------------- Display the column number --------------------------
; (Setq column-number-mode t)
; Display the column number and line number
(Setq column-number-mode t)
(Setq line-number-mode t)
(Global-linum-mode t)

; ------------------------- Use the selection habits under Win ---------------
; Select with shift + direction key
(Pc-selection-mode)
(Setq x-select-enable-clipboard t); supports emacs and external program pasting.
(Setq default-fill-column 80); by default, line feed is displayed for 80 columns.

; ------------------------- Set the default Tab width ---------------
; Set default tab-width as 4, not 2
(Setq-default indent-tabs-mode nil)
(Setq default-tab-width 8)

; Display time
(Setq display-time-24hr-format t)
(Setq display-time-day-and-date t)
(Display-time)

; Set a large kill ring
(Setq kill-ring-max 150)

;;;Import various CEDET plug-ins
;;---------------------------------------
; Load CEDET
(Load-file "~ /. Emacs. d/cedet-1.0pre6/common/cedet. el ")

; Enabling various SEMANTIC minor modes. See semantic/INSTALL for more ideas.
; Select one of the following
(Semantic-load-enable-code-helpers)
; (Semantic-load-enable-guady-code-helpers)
; (Semantic-load-enable-excessive-code-helpers)

; Enable this if you develop in semantic, or develop grammars
; (Semantic-load-enable-semantic-debugging-helpers)
;;---------------------------------------

; Configure Emacs Code Browser
(Add-to-list 'Load-path
"~ /. Emacs. d/ecb-2.40 ")
(Require 'ecb)

; Configure the search range of Sementic

(Setq semanticdb-project-roots
(List
(Expand-file-name "/")))

; CC-mode configuration http://cc-mode.sourceforge.net/
(Require 'CC-mode)
(C-set-offset 'inline-open 0)
(C-set-offset 'friend '-)
(C-set-offset 'substatement-open 0)

;;;; Determine the mode used based on the suffix
; Note: Here I associate. h with c ++-mode.
(Setq auto-mode-alist
(Append '("\. h $". c ++-mode) auto-mode-alist ))


; My C/C ++ language editing Policy

(Defun my-c-mode-common-hook ()
(Setq tab-width 4 indent-tabs-mode nil)
; Hungry-delete and auto-newline
(C-toggle-auto-hungry-state 1)
; Key definition
(Define-key c-mode-base-map [(control \ ')] 'hs-toggle-hiding)
(Define-key c-mode-base-map [(return)] 'newline-and-indent)
(Define-key c-mode-base-map [(f7)] 'compile)
(Define-key c-mode-base-map [(f8)] 'ff-get-other-file)
(Define-key c-mode-base-map [(meta \ ')] 'C-indent-command)
; (Define-key c-mode-base-map [(tab)] 'hippie-expand)
(Define-key c-mode-base-map [(tab)] 'my-indent-or-complete)
(Define-key c-mode-base-map [(meta? /)] 'Semantic-ia-complete-symbol-menu)
; Preprocessing settings
(Setq c-macro-shrink-window-flag t)
(Setq c-macro-preprocessor "cpp ")
(Setq c-macro-cppflags "")
(Setq c-macro-prompt-flag t)
(Setq hs-minor-mode t)
(Setq abbrev-mode t)
(Setq tab-width 4 indent-tabs-mode nil)
)
(Add-hook 'C-mode-common-hook 'my-c-mode-common-hook)
(Add-hook 'C-mode-hook
'(Lambda ()
(C-set-style "Stroustrup ")))

; My C ++ language editing Policy
(Defun my-c ++-mode-hook ()
(Setq tab-width 4 indent-tabs-mode nil)
(C-set-style "stroustrup ")
; (Define-key c ++-mode-map [f3] 'replace-regexp)
)

(Add-hook 'C ++-mode-hook 'my-c ++-mode-hook)

; The semantic/usr/include index database is automatically loaded when the C/C ++ language is started.
(Setq semanticdb-search-system-databases t)
(Add-hook 'C-mode-common-hook
(Lambda ()
(Setq semanticdb-project-system-databases
(List (semanticdb-create-database
Semanticdb-new-database-class
"/Usr/include ")))))

; My Java language editing Policy
(Defun my-java-mode-hook ()
(Setq tab-width 4 indent-tabs-mode nil)
)

(Add-hook 'java-mode-hook 'my-java-mode-hook)

; When the cursor is near the mouse pointer, let the mouse pointer flash on its own
(Mouse-avoidance-mode 'animate)

; Modify the title bar and display the buffer name
(Setq frame-title-format "% B ")

; Start Emacs Server
; (Server-start)

; Each time you enter Emacs, the Plan is displayed.
; (Plan) (color-theme-dark-blue)

; Highlight the current row
(Require 'hl-line)
(Global-hl-line-mode t)

; Activation of commands that scroll left and right: C-x <and C-x>
(Put 'scroll-left' disabled nil)

; Configure the shell color
(Autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
(Add-hook 'Shell-mode-hook' ansi-color-for-comint-mode-on)
(Setq ansi-color-for-comint-mode t)

; Save all edited documents when exiting Emacs
; (Load "desktop ")
; (Desktop-save-mode)
; (Desktop-read)

Related Article

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.