Emacs安装配置

快捷键

切换缓冲区: C-X B
关闭窗口/缓冲区: C-X K
打开shell/eshell: M-X shell/eshell
新建表格:M-X table-insert
查看当前字体: M-X describe-font
放大字体:C-X C-+
使配置文件立即生效(打开.emacs的情况下): M-X eval-buffer
重新从硬盘上载入文件:M-X revert-buffer
GDB: M-X gdb
命令
安装软件包:M-X el-get-install

el-get的安装

切换至scratch缓冲区,输入以下代码,按C-J,

(url-retrieve
https://raw.githubusercontent.com/dimitri/el-get/master/el-get-install.el
(lambda (s)
(end-of-buffer)
(eval-print-last-sexp)))

详细参见:https://github.com/dimitri/el-get

常用包的安装

sudo apt-get install:
- bzr
M-X el-get-install:
- color-theme
- color-theme-almost-monokai
- tabbar
- cedet
- ecb (http://www.cnblogs.com/wangkangluo1/archive/2011/07/25/2116306.html)
- bazaar
- emacs-for-python:https://github.com/gabrielelanaro/emacs-for-python

常见问题

配置过程

安装el-get
配置el-get, 具体见https://github.com/dimitri/el-get
通过el-get下载需要用到的软件包

配置文件


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;el-get
;;(add-to-list 'load-path "~/.emacs.d/el-get/el-get")


;;(unless (require 'el-get nil 'noerror)
 ;; (with-current-buffer
   ;;   (url-retrieve-synchronously
     ;;  "https://raw.githubusercontent.com/dimitri/el-get/master/el-get-install.el")
    ;;(goto-char (point-max))
    ;;(eval-print-last-sexp)))

;;(add-to-list 'el-get-recipe-path "~/.emacs.d/el-get-user/recipes")
;;(el-get 'sync)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(add-to-list 'load-path "~/.emacs.d/el-get/bazaar")


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;color theme

(add-to-list 'load-path "~/.emacs.d/el-get/color-theme")
(require 'color-theme)

(add-to-list 'load-path "~/.emacs.d/el-get/color-theme-solarized")
(require 'color-theme-solarized)
(color-theme-solarized)

(add-to-list 'load-path "~/.emacs.d/el-get/color-theme-almost-monokai")
(require 'color-theme-almost-monokai)
;;(color-theme-calm-forest)
;;(color-theme-almost-monokai)


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;set font and make table a good look
(custom-set-faces
 ;; custom-set-faces 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.
 '(default ((t (:inherit nil :stipple nil :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :pixelsize 13 :width normal :foundry "unknown" :family "DejaVu Sans Mono")))))

(if (and (fboundp 'daemonp) (daemonp))
    (add-hook 'after-make-frame-functions
              (lambda (frame)
                (with-selected-frame frame
                  (set-fontset-font "fontset-default" 'chinese-gbk "WenQuanYi Micro Hei Mono 12"))))
  (set-fontset-font "fontset-default" 'chinese-gbk "WenQuanYi Micro Hei Mono 12"))

(defun wl-org-column-view-uses-fixed-width-face ()
  ;; copy from org-faces.el
  (when (fboundp 'set-face-attribute)
    ;; Make sure that a fixed-width face is used when we have a column table.
    (set-face-attribute 'org-column nil
                        :height (face-attribute 'default :height)
                        :family (face-attribute 'default :family))))

(when (and (fboundp 'daemonp) (daemonp))
  (add-hook 'org-mode-hook 'wl-org-column-view-uses-fixed-width-face))


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;cedet
;;cedet if you use 1.1 the version check will turn out to be error
(load-file "~/.emacs.d/cedet-1.1/common/cedet.el")   
(global-ede-mode 1)

;;(semantic-load-enable-gaudy-code-helpers)
;;这一行打开会使得tabbar在某些buffer不可见,原因未知

(global-srecode-minor-mode 1)

;;ecb
;;;;ecb
(add-to-list 'load-path "~/.emacs.d/ecb-2.40")    ;你的ecb解压目录
(require 'ecb)
(require 'ecb-autoloads)



(global-set-key (kbd "<f7>") 'ecb-minor-mode)   ; 打开ejb

;;;;ejb 快捷键
(global-set-key (kbd "C-M-<left>") 'windmove-left)   ;左边窗口
(global-set-key (kbd "C-M-<right>") 'windmove-right)  ;右边窗口
(global-set-key (kbd "C-M-<up>") 'windmove-up)     ; 上边窗口
(global-set-key (kbd "C-M-<down>") 'windmove-down)   ; 下边窗口

;;ecb error
(setq stack-trace-on-error t)

;; 自动启动ecb,关闭每日提示
;;(setq ecb-auto-activate t ecb-tip-of-the-day nil)

;; 设置窗口的宽度,15%
(setq ecb-windows-width 0.2)

;; 在目录窗口显示文件
(setq ecb-show-sources-in-directories-buffer 'always)

   ;;(setq ecb-compile-window-height 12)
   ;;(setq ecb-show-sources-in-directories-buffer 'always)

(setq ecb-layout-name 'left15)



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;tabbar
(add-to-list 'load-path "~/.emacs.d/el-get/tabbar")
(require 'tabbar)
(tabbar-mode)

;;set tabbar <- -> keys    
(global-set-key [(meta j)] 'tabbar-backward)  
(global-set-key [(meta k)] 'tabbar-forward)  

;;set main&misc group

;;tabbar -- release that if you do not show *buffername*
;;(setq tabbar-buffer-list-function
;;    (lambda ()
;;       (remove-if
;;          (lambda(buffer)
;;             (find (aref (buffer-name buffer) 0) " *"))
;;          (buffer-list))))
(setq tabbar-buffer-groups-function
      (lambda()(list "All")))
(set-face-attribute 'tabbar-button nil)

;;color-theme-solarized的tabbar配色和其他的不太一样,似乎是反过来的,需要注意
;;set tabbar's backgroud color
(set-face-attribute 'tabbar-default nil
            :family "DejaVu Sans Mono"
                    :background "gray"
                    :foreground "gray")
(set-face-attribute 'tabbar-selected nil
            :family "DejaVu Sans Mono"
                    :inherit 'tabbar-default
            :foreground "#00CD66"
                    :background "black"
                    :box '(:line-width 2 :color "#00CD66") 
            )
(set-face-attribute 'tabbar-unselected nil
            :family "DejaVu Sans Mono"
                    :inherit 'tabbar-default
            :foreground "gray"
            :background "black"
                    :box '(:line-width 3 :color "gray")
            )

;; USEFUL: set tabbar's separator gap && no tool bar no tool tip
(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-layout-name "left15")
 '(ecb-options-version "2.40")
 '(scroll-bar-mode nil)
 '(tabbar-separator (quote (1.5)))
 '(tool-bar-mode nil)
 '(tooltip-mode nil))



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;python-all
(load-file "~/.emacs.d/emacs-for-python-master/epy-init.el")
(require 'epy-setup)      ;; It will setup other loads, it is required!
(require 'epy-python)     ;; If you want the python facilities [optional]
(require 'epy-completion) ;; If you want the autocompletion settings [optional]
(require 'epy-editing)    ;; For configurations related to editing [optional]
(require 'epy-bindings)   ;; For my suggested keybindings [optional]
(require 'epy-nose)       ;; For nose integration

(epy-setup-checker "pyflakes %f")

;;(epy-django-snippets)

(epy-setup-ipython)

(require 'highlight-indentation)
(add-hook 'python-mode-hook 'highlight-indentation)



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; tmp & backup file manage

;; all backups goto ~/.backups instead in the current directory
(setq backup-directory-alist (quote (("." . "~/.backups"))))


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;set full screen
;;(custom-set-variables
;; '(initial-frame-alist (quote ((fullscreen . maximized)))))
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值