;;设置标题
(setq frame-title-format
'(" administrator - Emacs - [ " (buffer-file-name "%f \]"
(dired-directory dired-directory "%b \]"))))
;; 最大化
(defun my-maximized ()
(interactive)
(x-send-client-message
nil 0 nil "_NET_WM_STATE" 32
'(2 "_NET_WM_STATE_MAXIMIZED_HORZ" 0))
(x-send-client-message
nil 0 nil "_NET_WM_STATE" 32
'(2 "_NET_WM_STATE_MAXIMIZED_VERT" 0))
)
;; 启动emacs时窗口最大化
(my-maximized)
;; 启动窗口大小
(setq default-frame-alist
'((height . 35) (width . 125) (menu-bar-lines . 20) (tool-bar-lines . 0)))
(put 'upcase-region 'disabled nil)
;; 语法高亮
(global-font-lock-mode t)
;;支持emacs和外部程序的粘贴
(setq x-select-enable-clipboard t)
;;关闭备份文件#xxx#
(setq auto-save-default nil)
;;关闭烦人的出错时的提示声
(setq visible-bell t)
;;关闭emacs启动时的画面
;;(setq inhibit-startup-message t)
;;关闭gnus启动时的画面
;;(setq gnus-inhibit-startup-message t)
;; 改变 Emacs 固执的要你回答 yes 的行为。按 y 或空格键表示 yes,n 表示 no
(fset 'yes-or-no-p 'y-or-n-p)
;;显示行列号
(setq column-number-mode t)
(setq line-number-mode t)
;;在左边显示行号
(global-linum-mode 'linum-mode)
;;color-theme
(add-to-list 'load-path "~/.emacs.d/plugins/color-theme-6.6.0")
(require 'color-theme)
(color-theme-initialize)
(color-theme-robin-hood)
;;erlang
(setq load-path (cons "/usr/local/lib/erlang/lib/tools-2.6.7/emacs"
load-path))
(setq erlang-root-dir "/usr/local/lib/erlang")
(setq exec-path (cons "/usr/local/lib/erlang/bin" exec-path))
(setq erlang-man-root-dir "/usr/local/lib/erlang/man")
(require 'erlang-start)
;;erlang-flymake
(require 'erlang-flymake)
;;仅在存盘时进行检查
(erlang-flymake-only-on-save)
;;键盘映射
(defvar flymake-mode-map (make-sparse-keymap))
(define-key flymake-mode-map (kbd "<f3>") 'flymake-goto-next-error)
(define-key flymake-mode-map (kbd "C-c <f3>") 'flymake-goto-prev-error)
(define-key flymake-mode-map (kbd "<f4>") 'flymake-display-err-menu-for-current-line)
(or (assoc 'flymake-mode minor-mode-map-alist)
(setq minor-mode-map-alist
(cons (cons 'flymake-mode flymake-mode-map)
minor-mode-map-alist)))
;;yasnippet-bundle
(add-to-list 'load-path "~/.emacs.d/plugins")
(require 'yasnippet-bundle)
;;auto-complete
(add-to-list 'load-path "~/.emacs.d/")
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d//ac-dict")
(ac-config-default)
;; This is needed for Distel setup
(let ((distel-dir "/usr/local/share/distel/elisp"))
(unless (member distel-dir load-path)
;; Add distel-dir to the end of load-path
(setq load-path (append load-path (list distel-dir)))))
(require 'distel)
(distel-setup)
;; Some Erlang customizations
(add-hook 'erlang-mode-hook
(lambda ()
;; when starting an Erlang shell in Emacs, default in the node name
(setq inferior-erlang-machine-options '("-sname" "emacs"))
;; add Erlang functions to an imenu menu
(imenu-add-to-menubar "Imenu")))
;; A number of the erlang-extended-mode key bindings are useful in the shell too
(defconst distel-shell-keys
'(("\C-\M-i" erl-complete)
("\M-?" erl-complete)
("\M-." erl-find-source-under-point)
("\M-," erl-find-source-unwind)
("\M-*" erl-find-source-unwind)
)
"Additional keys to bind when in Erlang shell.")
(add-hook 'erlang-shell-mode-hook
(lambda ()
;; add some Distel bindings to the Erlang shell
(dolist (spec distel-shell-keys)
(define-key erlang-shell-mode-map (car spec) (cadr spec)))))
;;cedet
(require 'cedet)
(global-ede-mode t)
;;;; Helper tools.
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(ecb-options-version "2.40")
'(semantic-default-submodes (quote (global-semantic-decoration-mode global-semantic-idle-completions-mode global-semantic-idle-scheduler-mode global-semanticdb-minor-mode global-semantic-idle-summary-mode global-semantic-mru-bookmark-mode)))
'(semantic-idle-scheduler-idle-time 3))
(semantic-mode)
;; smart complitions
(require 'semantic/ia)
(setq-mode-local c-mode semanticdb-find-default-throttle
'(project unloaded system recursive))
(setq-mode-local c++-mode semanticdb-find-default-throttle
'(project unloaded system recursive))
;;ecb
(require 'semantic/analyze)
(provide 'semantic-analyze)
(provide 'semantic-ctxt)
(provide 'semanticdb)
(provide 'semanticdb-find)
(provide 'semanticdb-mode)
(provide 'semantic-load)
(add-to-list 'load-path "~/.emacs.d/plugins/ecb-2.40")
(require 'ecb)
;;自动启动ecb,并且不显示每日提示
(setq ecb-auto-activate t ecb-tip-of-the-day nil)
;;esense
(setq load-path (cons "~/.emacs.d/plugins/esense-1.12" load-path))
(require 'esense-start)
(setq esense-indexer-program "~/.emacs.d/plugins/esense-1.12/esense.sh")
;;wrangler
(add-to-list 'load-path "/usr/local/lib/erlang/lib/wrangler-1.0/elisp")
(require 'wrangler)
;;ido
(require 'ido)
(ido-mode t)
;;tabbar-ruler
(load-file "~/.emacs.d/plugins/tabbar-ruler.el")
(setq tabbar-ruler-global-tabbar 't) ; If you want tabbar
(setq tabbar-ruler-global-ruler 't) ; if you want a global ruler
;;(setq tabbar-ruler-popup-menu 't) ; If you want a popup menu.
;;(setq tabbar-ruler-popup-toolbar 't) ; If you want a popup toolbar
(require 'tabbar-ruler)
;;erlang-dired-mode
(load-file "~/.emacs.d/plugins/erlang-dired-mode.el")
(defun my-erlang-mode-hook ()
(define-key erlang-mode-map (kbd "C-c C-p") 'erlang-create-project) ;defined in erlang-dired-mode C-cC-p
(define-key erlang-mode-map (kbd "C-z s") 'erlang-compile-dwim) ;compile
(define-key erlang-mode-map (kbd "C-c C-k") 'erlang-compile-dwim) ;compile
(define-key erlang-mode-map (kbd "C-z C-s") 'erlang-compile-dwim) ;compile
)
(add-hook 'erlang-mode-hook 'my-erlang-mode-hook)
(add-hook 'erlang-shell-mode-hook 'my-erlang-mode-hook)
;;保存上次打开的文件记录
(desktop-save-mode t)
(load "desktop")
(desktop-load-default)
(desktop-read)
原文链接: https://www.cnblogs.com/yourihua/archive/2012/04/22/2465501.html
欢迎关注
微信关注下方公众号,第一时间获取干货硬货;公众号内回复【pdf】免费获取数百本计算机经典书籍
原创文章受到原创版权保护。转载请注明出处:https://www.ccppcoding.com/archives/48271
非原创文章文中已经注明原地址,如有侵权,联系删除
关注公众号【高性能架构探索】,第一时间获取最新文章
转载文章受原作者版权保护。转载请注明原作者出处!