ubuntu14.04 下emacs 24 配置
目的: 配置emacs 24 適合編程開發
主要參考JerryZhang的配置(Emacs 簡易教程)
http://www.perfect-is-shit.com/emacs-simple-tutorial.html#tocAnchor-1-16-5
https://gitcafe.com/JerryZhang/Emacs-Config
優點: 插件少 基本功能都比較全,emacs 配置后啟動比較快速
安裝過程如下:
- git clone https://gitcafe.com/JerryZhang/emacs-config.git ~/.emacs.d (后面的地址可更換,下載后復制到~/.emacs.d目錄下)
- cd ~/.emacs.d/lisp/helm && make
安裝完成后
init.el更改內容?
- 顯示行號.去掉(global-linum-mode 1)前的分號(;)
- 增加切換buffer的快捷鍵
- 增加 speedbar
下載?sr-speedbar.el?至.emacs.d/lisp目錄下
init.el 添加代碼
;;------------------------------------------------------------------------------ ;; 使用speedbar <F6>切換speedbar的開啟狀態 ;; s鍵在speedbar中搜索 u鍵回到上一個目錄 ;;------------------------------------------------------------------------------ (require 'sr-speedbar) (global-set-key (kbd "<f6>") (lambda()(interactive)(sr-speedbar-refresh)(sr-speedbar-toggle)(unless (sr-speedbar-exist-p)(kill-buffer "*SPEEDBAR*")))) (require 'speedbar) (define-key speedbar-mode-map (kbd "s")#'(lambda ()(interactive)(beginning-of-buffer)(isearch-forward))) (define-key speedbar-mode-map (kbd "u")#'(lambda ()(interactive)(speedbar-up-directory)))開啟ido支持
;;------------------------------------------------------------------------------ ;; 開啟ido 支持 ;;------------------------------------------------------------------------------ (require 'ido) (ido-mode t) ;;ido模式中不保存目錄列表,解決退出Emacs時ido要詢問編碼的問題。 (setq ido-save-directory-list-file nil)tabbar設置 參考?http://blog.csdn.net/CherylNatsu/article/details/6204737
代碼折疊 參考?Distopico Vegan / Distopico .emacs.d · Files
下載?hideshow.el?至.emacs.d/lisp目錄下
;;------------------------------------------------------------------------------ ;;代碼折疊 ;;------------------------------------------------------------------------------;(autoload 'hideshowvis-enable "hideshowvis" "Highlight foldable regions") ;(autoload 'hideshowvis-symbols "hideshowvis" "Highlight foldable regions")(require 'hideshowvis) (hideshowvis-symbols)(autoload 'hideshowvis-minor-mode"hideshowvis""Will indicate regions foldable with hideshow in the fringe."'interactive)(add-to-list 'hs-special-modes-alist'(ruby-mode"\\(def\\|do\\|{\\)" "\\(end\\|end\\|}\\)" "#"(lambda (arg) (ruby-end-of-block)) nil))(dolist (hook (list 'emacs-lisp-mode-hook'lisp-mode-hook'ruby-mode-hook'perl-mode-hook'php-mode-hook'html-mode-hook;'web-mode-hook'sh-mode-hook'multi-web-mode-hook'python-mode-hook'lua-mode-hook'c-mode-hook'java-mode-hook'js-mode-hook'css-mode-hook'c++-mode-hook))(add-hook hook 'hideshowvis-enable));change -/+ to ▼/? ;(define-fringe-bitmap 'hideshowvis-hideable-marker [0 0 254 124 56 16 0 0]) ;(define-fringe-bitmap 'hs-marker [0 32 48 56 60 56 48 32])(custom-set-faces'(hs-fringe-face ((t (:foreground "#afeeee" :box (:line-width 2 :color "grey75" :style released-button)))))'(hs-face ((t (:background "#444" :box t))))'(hideshowvis-hidable-face ((t (:foreground "#2f4f4f")))) )(provide 'conf-hideshowvis)?
提供的F*快捷鍵
F2 grep
F3 eshell
F4 插入當前時間
F5 compile
F6 speedbar
安裝cscope
sudo apt-get install cscope?
xcscope.el?使用:
- cscope-indexer -r?: 在根目錄下遞歸生成數據庫
- C-c s a?: Set initial directory;
- C-c s A?: Unset initial directory;
- C-c s I?: create list of files to index;
- C-c s s?: Find symbol;
- C-c s d?: Find global definition;
- C-c s c?: Find functions calling a function;
- C-c s C?: Find called functions (list functions called from a function);
- C-c s t?: Find text string;
- C-c s e?: Find egrep pattern;
- C-c s f?: Find a file;
- C-c s i?: Find files #including a file;
- C-c s b?: Display cscope buffer;
- C-c s u?: back
?
其他可供參考的配置:
C/C++ Development Environment for Emacs?
http://tuhdo.github.io/c-ide.html
一年成為Emacs高手(像神一樣使用編輯器)
http://blog.csdn.net/redguardtoo/article/details/7222501
??
在使用gdb調試程序時
先M-x gdb 打開gdb調試
然后M-x?gdb-many-windows 使用多窗口查看調試過程
?
轉載于:https://www.cnblogs.com/aaron2015/p/4882652.html
總結
以上是生活随笔為你收集整理的ubuntu14.04 下emacs 24 配置的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 项目添加服务器上数据库正常,添加本地的数
- 下一篇: ubuntu - 14.04,如何操作G