目的: 配置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 使用多窗口查看调试过程

ubuntu14.04 下emacs 24 配置的更多相关文章

  1. VMware虚拟机里Ubuntu14.04下安装及配置MySQL

    更新源列表 快捷键"Ctrl+Alt+t"打开"Terminal终端窗口",输入"sudo apt-get update"-->回车- ...

  2. Ubuntu14.04下redis安装 配置, redis主从配置

    1.到官网下载redis源码包 wget http://download.redis.io/releases/redis-3.2.8.tar.gz 2.解压 并 编译 .tar.gz cd redis ...

  3. LDAP 在ubuntu14.04下的安装配置install and configure

    https://help.ubuntu.com/lts/serverguide/openldap-server.html if error occurs in reinstall, try this: ...

  4. ubuntu14.04下安装cudnn5.1.3,opencv3.0,编译caffe及配置matlab和python接口过程记录

    已有条件: ubuntu14.04+cuda7.5+anaconda2(即python2.7)+matlabR2014a 上述已经装好了,开始搭建caffe环境. 1. 装cudnn5.1.3,参照: ...

  5. ubuntu14.04下编译安装ambari-2.4.2.0

    ubuntu14.04下编译安装ambari-2.4.2.0 编译前的准备工作 准备工作有: 系统参数 系统依赖(编译环境) 离线安装包 java环境 maven环境 Nodejs环境 git环境 a ...

  6. Ubuntu14.04下安装Hadoop2.5.1 (单机模式)

    本文地址:http://www.cnblogs.com/archimedes/p/hadoop-standalone-mode.html,转载请注明源地址. 欢迎关注我的个人博客:www.wuyudo ...

  7. 二、Ubuntu14.04下安装Hadoop2.4.0 (伪分布模式)

    在Ubuntu14.04下安装Hadoop2.4.0 (单机模式)基础上配置 一.配置core-site.xml /usr/local/hadoop/etc/hadoop/core-site.xml ...

  8. Ubuntu14.04下中山大学锐捷上网设置

    Ubuntu14.04下中山大学锐捷上网设置 打开终端后的初始目录是 -,Ubuntu安装完毕默认路径,不是的请自行先运行cd ~ 非斜体字命令行方法,斜体字是图形管理方法,二选一即可 记得善用Tab ...

  9. ubuntu14.04下手动安装JDK + eclipse + Pydev

    说明:本文在root用户下进行,如不是root用户命令前加sodu 一.手动安装JDK 1.下载JDK 从官网http://www.oracle.com/technetwork/java/javase ...

随机推荐

  1. 基于内存,redis,mysql的高速游戏数据服务器设计架构

    转载请注明出处,欢迎大家批评指正 1.数据服务器详细设计 数据服务器在设计上采用三个层次的数据同步,实现玩家数据的高速获取和修改. 数据层次上分为:内存数据,redis数据,mysql数据 设计目的: ...

  2. 机器学习相关的Awesome系列

    Index Awesome 备注 1 Awesome Machine Learning 机器学习资源大全中文版 2 Awesome Artificial Intelligence 人工智能 3 Awe ...

  3. Spring init-method和destroy-method 的使用

    Spring init-method和destroy-method 的使用 Spring 为了满足开发者在执行某方法之前或者在结束某个任务之前需要操作的一些业务,则提供了init-method和des ...

  4. Linux下Gcc生成和使用静态库和动态库详解(转)

    一.基本概念 1.1什么是库 在windows平台和linux平台下都大量存在着库. 本质上来说库是一种可执行代码的二进制形式,可以被操作系统载入内存执行. 由于windows和linux的平台不同( ...

  5. 作业3(PSP表格)

                            PSP2.1 Personal Software Process Stages Time(min) Planning 计划 11 Estimate 估计 ...

  6. Eclipse_luna_J2EE_For_JS+tomcat8.0环境搭建、配置、开发入门

    一.所有需要的软件.插件等下载地址 J2SE的官方下载路径:http://www.oracle.com/technetwork/java/javase/downloads/index.html Ecl ...

  7. require.js源码分析

    写的寥寥草草,博客园的布局怎么弄还没有研究,再保存一份草稿,日后在完善,深度研究 require.js 加载顺序 1:加载html主页,require.js文件 2:脚本执行到html中的script ...

  8. Spring学习笔记(一)

    1.1.1Spring是什么? Spring是一个开源的轻量级Java SE(Java 标准版本)/Java EE(Java 企业版本)开发应用框架,其目的是用于简化企业级应用程序开发. 1.1.2S ...

  9. 《C++primer》v5 第4章 表达式 读书笔记 习题答案

    4.1 105 4.2 *vec.begin()=*(vec.begin())//先调用点运算符,再解引用 *vec.begin()+1=(*vec.begin())+1//先解引用,再加一 4.3略 ...

  10. python基础之内置函数

    该博客内容参考http://www.cnblogs.com/wupeiqi/articles/4943406.html 内置函数 一 详细见python文档,猛击这里 文件操作 操作文件时,一般需要经 ...