My Emacs settings file. emacs

Source: Internet
Author: User
Tags set background

;;; Emacs Configuration File

;; Set row height
(Setq-default line-spacing 5)


(Custom-set-variables
;; Custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up and so is careful.
;; Your init file should contain only one such instance.
;; If there is more than one, the they won ' t work right.
' (package-selected-packages (quote (Php-mode)))
' (Truncate-partial-width-windows t))
(custom-set-faces
;; Custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up and so is careful.
;; Your init file should contain only one such instance.
;; If there is more than one, the they won ' t work right.
)
(Tool-bar-mode 0)
(Set-default-font "16")
(setq inhibit-startup-message T)

;; The path where the Sr-speedbar.el file is loaded
(Add-to-list ' Load-path "~/emacsextensions/")


;; Atom Theme
;;( Require ' Github-theme)

;;( Require ' Andreas-theme)

(Require ' Sr-speedbar)
(setq sr-speedbar-right-side Nil)
;;( SETQ sr-speedbar-max-width 150)
;;( SETQ sr-speedbar-width-console 100)
;;( Global-set-key (kbd "<c-return") ' Sr-speedbar-toggle '
(setq speedbar-show-unknown-files T)


;; All backups goto ~/.backups instead in the current directory
(setq backup-directory-alist (quote ("."). "~/.backups"))))
(setq make-backup-files Nil)
;; Setting does not produce backup files, file-name~

(setq auto-save-mode Nil)
;; Auto Save mode

;; Temp file, #file-name#
(setq auto-save-default Nil)
;; The default value is T, to turn off directly change the default value with nil
;;( Setq-default make-backup-files Nil)
;; Do not generate temporary files

;; Show line number on the right
(setq Global-linum-mode T)
(setq Column-number-mode T)
(setq Line-number-mode T)


;; Startup settings
;; (Setq default-frame-alist
;; ' ((vertical-scroll-bars)
;; (top. 0)
;; (left. 280)))

(setq initial-frame-alist ' (top 0) (left. 280)))

;; Formatting the entire file function
(Defun indent-whole ()
(interactive)
(Indent-region (Point-min) (Point-max))
(Message "format successfully"))
;; Bind to F7 key
(Global-set-key [F7] ' Indent-whole)
;;( Global-set-key (kbd "RET") ' Newline-and-indent '

;;( Defun Indent-buffer ()
;;" Indent the whole buffer.
;;( Interactive
;;( Save-excursion
;;( Indent-region (point-min) (Point-max) nil)))

;; HTML code indents 4 characters
;;( SETQ indent-tabs-mode Nil)
;;( SETQ default-tab-width 4)
;;( Setq-default Indent-tabs-mode Nil)
;;( SETQ tab-width 4)
;;( Custom-set-variables ' (tab-width 4))

;;( Setq-default Indent-tabs-mode Nil)
;;( SETQ default-tab-width 4);; TAB key is 8 character width
;;( SETQ tab-stop-list ())
;;( C-set-style "Ellemtel")
;;( SETQ c-default-style "Ellemtel" C-basic-offset 4)
;;( SETQ tab-width 4 Indent-tabs-mode Nil)
(setq html-mode-markup-indent-offset 4)
(setq html-mode-code-indent-offset 4)


;; Melpa is a growing collection of package.el-compatible Emacs Lisp packages built automatically on our servers from the Upst Ream source code using simple recipes.

(Require ' package)
(Add-to-list ' package-archives
' ("Melpa". "https://melpa.org/packages/") t)
(When (< emacs-major-version 24)
;; For important compatibility libraries like Cl-lib
(Add-to-list ' package-archives ' ("GNU"). "https://elpa.gnu.org/packages/")))
(package-initialize)


;; Do not wrap settings
(Set-default ' Truncate-lines t)
(setq truncate-partial-width-windows Nil)
(Add-hook ' Diff-mode-hook (Lambda () (setq truncate-lines t)))

;; Syntax highlighting
(Global-font-lock-mode t)

;; Turn off annoying sound when you are on the wrong note
(setq Visible-bell T)

;; Replace yes/no with y/n
(Fset ' yes-or-no-p ' y-or-n-p)

;; Show parentheses Match
(Show-paren-mode t)

;; Copy and paste support for Emacs and external programs
(setq X-select-enable-clipboard T)

;; Cue the current position in the title bar
(setq frame-title-format "[Email protected]%p%b")

;; Sets the width of tab to 4 spaces
(setq default-tab-width 4)

;; Code Folding
(load-library "Hideshow")
(Add-hook ' C-mode-hook ' Hs-minor-mode)
(Add-hook ' C++-mode-hook ' Hs-minor-mode)
(Add-hook ' Java-mode-hook ' Hs-minor-mode)
(Add-hook ' Perl-mode-hook ' Hs-minor-mode)
(Add-hook ' Cperl-mode-hook ' Hs-minor-mode)
(Add-hook ' Php-mode-hook ' Hs-minor-mode)
(Add-hook ' Emacs-lisp-mode-hook ' Hs-minor-mode)

;; Shortcut key Settings
(Global-set-key [F10] ' My-fullscreen); F12 fullscreen

;; --------------Window Interface Settings------------------


;;( Set-scroll-bar-mode Nil)
;; Cancel scroll bar

;; Web-mode settings
(Require ' web-mode)
;; (Add-to-list ' auto-mode-alist ' ("\\.phtml\\ '". Web-mode))
;; (Add-to-list ' auto-mode-alist ' ("\\.tpl\\.php\\ '". Web-mode))
;; (Add-to-list ' auto-mode-alist ' ("\\.[ Agj]sp\\ ' ". Web-mode))
;; (Add-to-list ' auto-mode-alist ' ("\\.as[cp]x\\ '". Web-mode))
;; (Add-to-list ' auto-mode-alist ' ("\\.erb\\ '". Web-mode))
;; (Add-to-list ' auto-mode-alist ' ("\\.mustache\\ '". Web-mode))
;; (Add-to-list ' auto-mode-alist ' ("\\.djhtml\\ '". Web-mode))
(add-to-list ' auto-mode-alist ' ("\\.html?\\ '" ". Web-mode)")
(add-to-list ' auto-mode-alist ' ("\\.css\\ '"). Web-mode))
(add-to-list ' auto-mode-alist ' ("\\.js\\ '". Web-mode))
(add-to-list ' auto-mode-alist ' ("\\.php\\ '" . Web-mode))

;; Installing Emmet-mode
(Add-hook ' Sgml-mode-hook ' Emmet-mode);; Auto-start on any markup modes
(Add-hook ' Css-mode-hook ' Emmet-mode);; Enable Emmet ' s CSS abbreviation.
(Add-hook ' Web-mode-hook ' Emmet-mode);; Enable Emmet ' s on Web-mode
(Add-hook ' Php-mode-hook ' Web-mode)

;; Install Projecttile, add Project management
(Add-to-list ' Load-path "~/emacsextensions/projectile-master")
(Require ' projectile)
(Projectile-global-mode);; Default global usage
;;( Add-hook ' Web-mode ' Projectile-mode)
(setq projectile-enable-caching t);; Default Open Cache
(Global-set-key [F5] ' projectile-find-file);; Use the F5 key to open the default file search


;; Set Background color
;;( Set-foreground-color "Grey")
;;( Set-background-color "#f5f5f5")


;; The cursor appears as a vertical line
;;( Setq-default Cursor-type ' bar)

;; Enable time display settings on the bar above the Minibuffer (forget what's called)
(Display-time-mode 1)

;; Time using 24-hour system
(setq Display-time-24hr-format T)
;; Time display includes date and specific time
(setq display-time-day-and-date T)

;; ----------------------
;; Setting up a Chinese language environment
;;( Set-language-environment ' Chinese-gb)

;; How to encode a write file
;;( Set-buffer-file-coding-system ' gb2312)
(Set-buffer-file-coding-system ' Utf-8)

;; How to encode a new file
;;( Setq Default-buffer-file-coding-system ' gb2312)
(setq default-buffer-file-coding-system ' Utf-8)

;; Encoding method of Terminal mode
(Set-terminal-coding-system ' Utf-8)

;; How keyboard input is encoded
;;( Set-keyboard-coding-system ' gb2312)
(Set-keyboard-coding-system ' Utf-8)

;; How to encode the read or write file name
(setq file-name-coding-system ' Utf-8)


;; ;; Auto-Complete parentheses
;; (Defun My-c-mode-auto-pair ()
;; (interactive)
;; (Make-local-variable ' skeleton-pair-alist)
;; (Setq skeleton-pair-alist ' (
;; (?\‘? _ "\‘")
;; (?\"? _ "\"")
;; (?\(? _ "\)")
;; (?\[? _ "\]")
;; (? {\ n > _ \ n?} >)))
;; (setq Skeleton-pair T)
;; (Local-set-key (kbd "\ (") ' Skeleton-pair-insert-maybe)
;; (Local-set-key (kbd "\{") ' Skeleton-pair-insert-maybe)
;; (Local-set-key (kbd "\") ' Skeleton-pair-insert-maybe)
;; (Local-set-key (kbd "\" ") ' Skeleton-pair-insert-maybe)
;; (Local-set-key (kbd "\[") ' Skeleton-pair-insert-maybe)
;; (Add-hook ' C-mode-hook ' My-c-mode-auto-pair)
;; (Add-hook ' C++-mode-hook ' My-c-mode-auto-pair)
;; (Add-hook ' Web-mode-hook ' My-c-mode-auto-pair)
;; ;; Enter the parentheses on the left to automatically fill the right part. Include (), "", [], {}, and so on

;; Automatically inserts a blank line at the end of the document, as if some system configuration files are required
(setq require-final-newline T)
(setq track-eol T)


;; Fringe settings
;; (Set-fringe-mode ' (0.0))
;; (Setq-default left-fringe-width 10)
;; (Setq-default right-fringe-width 0)
;; (Set-face-attribute ' fringe nil:background "white": Foreground "white")

;; Linum Display line number settings on the left
;; (setq Linum-format "%d");; Alternative solution to intermittent line numbers
;; (Custom-set-faces ' (Linum (t (: Foreground "#000000": Background "#ffffff": Box nil)))))
;; (setq Linum-format "%d")
;; (Global-linum-mode 1)

;; Installation of Flycheck
(Require ' Flycheck)
(Global-flycheck-mode);; Default global usage

My Emacs settings file. emacs

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.