日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Ubuntu >内容正文

Ubuntu

ubuntu14.04 下emacs 24 配置

發布時間:2024/4/17 Ubuntu 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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的快捷鍵
;;------------------------------------------------------------------------------ ;; 快速切換至上個buffer ;; Shift+TAB切換至上個buffer ;;------------------------------------------------------------------------------ (global-set-key (kbd "<backtab>") #'(lambda ()(interactive)(switch-to-buffer (other-buffer (current-buffer) 1))))

  

  • 增加 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 配置的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。