|
It give a warning:
- Warning: no fonts matching `-*-fixed-medium-r-normal-*-16-*-*-*-*-*-iso8859-1' available [2 times]
复制代码
- ;; --------------------------------------------------------------------------
- ;; eim chinese input mehod
- ;; --------------------------------------------------------------------------
- (add-to-list 'load-path "~/.emacs.d/site-lisp/eim")
- (autoload 'eim-use-package "eim" "Another emacs input method")
- ;; testing *FEATURE* tooltip
- (setq eim-use-tooltip nil)
- (register-input-method
- "eim-wb" "euc-cn" 'eim-use-package
- "五笔" "汉字五笔输入法" "wb.txt")
- (register-input-method
- "eim-py" "euc-cn" 'eim-use-package
- "拼音" "汉字拼音输入法" "py.txt")
- ;; input English with ';' temporary
- (require 'eim-extra)
- (global-set-key ";" 'eim-insert-ascii)
- ;; eim-wb page
- (add-hook 'eim-wb-load-hook
- (lambda ()
- (let ((map (eim-mode-map)))
- (define-key map "-" 'eim-previous-page)
- (define-key map "=" 'eim-next-page))))
- (add-hook 'eim-wb-load-hook
- (lambda ()
- (let ((map (eim-mode-map)))
- (define-key map "," 'eim-previous-page)
- (define-key map "." 'eim-next-page))))
- ;; eim-py page
- (add-hook 'eim-py-load-hook
- (lambda ()
- (let ((map (eim-mode-map)))
- (define-key map "-" 'eim-previous-page)
- (define-key map "=" 'eim-next-page))))
- (add-hook 'eim-py-load-hook
- (lambda ()
- (let ((map (eim-mode-map)))
- (define-key map "," 'eim-previous-page)
- (define-key map "." 'eim-next-page))))
- ;; --------------------------------------------------------------------------
- ;; shortcuts
- ;; --------------------------------------------------------------------------
- ;; F7 compile
- (global-set-key [(f7)] 'compile)
- ;; F12-c calendar
- (global-set-key (kbd "<f12> c") 'calendar)
- ;; F2 wiki-mode
- (global-set-key [(f2)] 'emacs-wiki-find-file)
- ;; F4 shell-Mode
- (global-set-key [(f4)] 'ansi-term)
- ;; F9 list bookmarks
- (global-set-key (kbd "<f9>") 'list-bookmarks)
- ;; --------------------------------------------------------------------------
- ;; theme
- ;; --------------------------------------------------------------------------
- ;; cursor color
- ;; seems not working, add it at the bottom
- (set-cursor-color "white")
- ;; mouse color
- (set-mouse-color "white")
- ;; cursor type
- ;; (set-default 'cursor-type 'bar)
- (setq-default cursor-type 'box)
- ;; fg & bg color
- ;; (set-foreground-color "#FDFF00")
- ;; (set-foreground-color "#00FF00")
- (set-foreground-color "#CCCCCC")
- (set-background-color "#343434")
- ;; highlight theme
- (set-face-foreground 'highlight "white")
- (set-face-background 'highlight "blue")
- ;; region theme
- (set-face-foreground 'region "cyan")
- (set-face-background 'region "blue")
- ;; secondary selection theme
- (set-face-foreground 'secondary-selection "skyblue")
- (set-face-background 'secondary-selection "darkblue")
- ;; calendar color
- (setq calendar-load-hook
- '(lambda ()
- (set-face-foreground 'diary-face "skyblue")
- (set-face-background 'holiday-face "slate blue")
- (set-face-foreground 'holiday-face "white")))
- ;; --------------------------------------------------------------------------
- ;; custom user interface
- ;; --------------------------------------------------------------------------
- ;; remove startup
- (setq inhibit-startup-message t)
- ;; remove scrollbar
- (set-scroll-bar-mode nil)
- ;; remove toolbar
- (tool-bar-mode nil)
- ;; show path
- (setq frame-title-format "lee@%b")
- ;; image enable
- (auto-image-file-mode t)
- ;; show column number
- (column-number-mode t)
- ;; highlight matched brackets
- (show-paren-mode t)
- ;; display time
- (display-time-mode 1)
- (setq display-time-24hr-format t)
- (setq display-time-day-and-date t)
- ;; --------------------------------------------------------------------------
- ;; misc
- ;; --------------------------------------------------------------------------
- ;; sudo
- ;; tramp means: Transparent Remote (file) Access, Multiple Protocol,
- (require 'tramp)
- ;; default mode is text-mode
- (setq default-major-mode 'text-mode);
- ;; syntax highlight
- (global-font-lock-mode t)
- ;; support X paste
- (setq x-select-enable-clipboard t)
- ;; auto line break
- ;; (setq default-fill-column 80)
- ;; no backup file
- (setq-default make-backup-files nil)
- ;; move mouse while cursor close to mouse
- (mouse-avoidance-mode 'animate)
- (transient-mark-mode t);
- ;; remove bell
- (setq visible-bell t)
- ;; use `y/n` instead of `yes/no`
- (fset 'yes-or-no-p 'y-or-n-p)
- ;; default work DIR
- ;; (setq default-directory "/home/yuki/shuge/s/")
- ;; --------------------------------------------------------------------------
- ;; tab
- ;; --------------------------------------------------------------------------
- (setq indent-tabs-mode nil)
- ;; (setq tab-stop-list ())
- (setq default-tab-width 4)
- (setq tab-width 4)
- ;; (setq-default indent-tabs-mode t)
- (setq-default indent-tabs-mode nil)
- ;; --------------------------------------------------------------------------
- ;; tab
- ;; for C Programming
- ;; --------------------------------------------------------------------------
- (setq indent-tabs-mode nil)
- (setq default-tab-width 4)
- (setq tab-width 4)
- (setq tab-stop-list ())
- (loop for x downfrom 40 to 1 do
- (setq tab-stop-list (cons (* x 4) tab-stop-list)))
- (defconst my-c-style
- '((c-tab-always-indent . t)
- (c-comment-only-line-offset . 4)
- (c-hanging-braces-alist . ((substatement-open after)
- (brace-list-open)))
- (c-hanging-colons-alist . ((member-init-intro before)
- (inher-intro)
- (case-label after)
- (label after)
- (access-label after)))
- (c-cleanup-list . (scope-operator
- empty-defun-braces
- defun-close-semi))
- (c-offsets-alist . ((arglist-close . c-lineup-arglist)
- (substatement-open . 0)
- (case-label . 4)
- (block-open . 0)
- (knr-argdecl-intro . -)))
- (c-echo-syntactic-information-p . t)
- )
- "My C Programming Style")
- ;; offset customizations not in my-c-style
- (setq c-offsets-alist '((member-init-intro . ++)))
- ;; Customizations for all modes in CC Mode.
- (defun my-c-mode-common-hook ()
- ;; add my personal style and set it for the current buffer
- (c-add-style "PERSONAL" my-c-style t)
- ;; other customizations
- (setq tab-width 4
- ;; this will make sure spaces are used instead of tabs
- indent-tabs-mode nil)
- ;; we like auto-newline and hungry-delete
- (c-toggle-auto-hungry-state 1)
- ;; key bindings for all supported languages. We can put these in
- ;; c-mode-base-map because c-mode-map, c++-mode-map, objc-mode-map,
- ;; java-mode-map, idl-mode-map, and pike-mode-map inherit from it.
- (define-key c-mode-base-map "\C-m" 'c-context-line-break)
- )
- (add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
- ;; --------------------------------------------------------------------------
- ;; auto-complete
- ;; --------------------------------------------------------------------------
- ;; part I
- (global-set-key "\M- " 'hippie-expand)
- (setq hippie-expand-try-functions-list
- '(try-complete-file-name-partially
- try-complete-file-name
- try-expand-all-abbrevs
- try-expand-list
- try-expand-line
- try-expand-dabbrev
- try-expand-dabbrev-all-buffers
- try-expand-dabbrev-from-kill
- try-complete-lisp-symbol-partially
- try-complete-lisp-symbol))
- ;; part II
- (defun my-indent-or-complete ()
- (interactive)
- (if (looking-at "\\>")
- (hippie-expand nil)
- (indent-for-tab-command))
- )
- (global-set-key [(control tab)] 'my-indent-or-complete)
- (autoload 'senator-try-expand-semantic "senator")
- (setq hippie-expand-try-functions-list
- '(
- senator-try-expand-semantic
- try-expand-dabbrev
- try-expand-dabbrev-visible
- try-expand-dabbrev-all-buffers
- try-expand-dabbrev-from-kill
- try-expand-list
- try-expand-list-all-buffers
- try-expand-line
- try-expand-line-all-buffers
- try-complete-file-name-partially
- try-complete-file-name
- try-expand-whole-kill
- )
- )
- ;; --------------------------------------------------------------------------
- ;; po-mode
- ;; --------------------------------------------------------------------------
- (setq auto-mode-alist
- (cons '("\\.po\\'\\|\\.po\\." . po-mode) auto-mode-alist))
- (autoload 'po-mode "po-mode" "Major mode for translators to edit PO files" t)
- ;; --------------------------------------------------------------------------
- ;; reStructuredText
- ;; rest-mode
- ;; --------------------------------------------------------------------------
- (add-to-list 'load-path "~/.emacs.d/site-lisp/rst")
- (autoload 'rst-use-package "rst" "lastest rst support")
- (setq auto-mode-alist
- (append '(
- ;; ("\\.txt$" . rst-mode)
- ("\\.rst$" . rst-mode)
- ("\\.rest$" . rst-mode)) auto-mode-alist))
复制代码 |
|