`
lippeng
  • 浏览: 450839 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

.emacs 配置

    博客分类:
  • Life
阅读更多

 

    这两天整emacs,做了些配置,尚未完善,先贴出来,到其他地方先用着。。。嗯,部分可用吧。。。

 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Barton's .emacs start

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; load plugin

 

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

 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 

;;允许使用C-z作为命令前缀

(define-prefix-command 'ctl-z-map)

(global-set-key (kbd "C-z") 'ctl-z-map)

 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Edit this file quickly

 

;; 快速打开这个文件

;用C-c C-e 快速打开~/.emacs文件。

(defun open-init-file ( )

  (interactive)

  (find-file "~/.emacs"))

 

(global-set-key "\C-z\C-e" 'open-init-file)

 

;; 马上生效

;; 光标处前一句: C-x C-e

;; 整个Buffer:M-x eval-buffer<Enter>

 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; GUI Config

 

;; 去掉 菜单栏

;(menu-bar-mode nil)

 

;; 去掉 工具栏

(tool-bar-mode nil)

 

;; 启动tab页(ctab插件)

(require 'ctab)

(ctab-mode t)

;;; 如果需要让.h文件和.c/.cpp文件排在一起,则增加下面一行:

(setq ctab-smart t)

;; 绑定到C-<Tab>

(global-set-key (kbd "<C-tab>") 'ctab-next)

(global-set-key (kbd "<C-M-tab>") 'ctab-previous)

 

;; 去掉 滚动条

(scroll-bar-mode nil)

 

;; 显示 行列号

(column-number-mode t)

 

;; 显示 行号(line-num.el)

(global-linum-mode 1)

 

;; 显示 列号

(setq mouse-yank-at-point t)

 

;; 显示 括号匹配

(show-paren-mode t)

 

;;以 y/n 替代 yes/no

(fset 'yes-or-no-p 'y-or-n-p)

 

;; 字体

(set-frame-font "微软雅黑-13")

 

;; emacs-color-theme plugin

(require 'color-theme)

(color-theme-initialize)

(color-theme-robin-hood)

 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Base Config

 

;; 不 生成 临时文件

(setq-default make-backup-files nil)

 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; 时间 设置

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 

;;启用时间显示设置,在minibuffer上面的那个杠上(忘了叫什么来着)

(display-time-mode 1)

;;时间使用24小时制

(setq display-time-24hr-format t)

;;时间显示包括日期和具体时间

(setq display-time-day-and-date t)

;;显示时间,格式如下

(display-time-mode 1)

 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; 编辑

 

;;系统剪贴板快捷键(C-c C-c复制,C-c C-v粘贴)

(global-set-key "\C-c\C-c" 'clipboard-kill-ring-save)

(global-set-key "\C-c\C-v" 'clipboard-yank)

 

;; Redo

(global-set-key ( kbd "C-.") 'redo)

 

;;C-Space被输入法占用,改用C-c m来标记文本块

(global-set-key "\C-cm" 'set-mark-command)

 

;;启用ibuffer支持,增强*buffer*

(global-set-key (kbd "C-x C-b") 'ibuffer)

 

;; 设置背景颜色和字体颜色

;;(set-foreground-color "white")

;;(set-background-color "black")

 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Base Config

 

;; 不 生成 临时文件

(setq-default make-backup-files nil)

 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; 时间 设置

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 

;;启用时间显示设置,在minibuffer上面的那个杠上(忘了叫什么来着)

(display-time-mode 1)

;;时间使用24小时制

;;(setq display-time-24hr-format t)

;;时间显示包括日期和具体时间

(setq display-time-day-and-date t)

;;显示时间,格式如下

(display-time-mode 1)

;;(setq display-time-24hr-format t)

(setq display-time-day-and-date t)

 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; 编辑

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 

;;系统剪贴板快捷键(C-c C-c复制,C-c C-v粘贴)

(global-set-key "\C-c\C-c" 'clipboard-kill-ring-save)

(global-set-key "\C-c\C-v" 'clipboard-yank)

 

;; Redo

(global-set-key ( kbd "C-.") 'redo)

 

;;C-Space被输入法占用,改用C-c m来标记文本块

(global-set-key "\C-cm" 'set-mark-command)

 

;;启用ibuffer支持,增强*buffer*

(global-set-key (kbd "C-x C-b") 'ibuffer)

 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;; Buffer

 

;;关闭当前缓冲区 Alt+4  ;; C-x 0

(global-set-key (kbd "M-4") 'delete-window)

;;关闭其它缓冲区 Alt+1  ;; C-x 1

(global-set-key (kbd "M-1") 'delete-other-windows)

;;水平分割缓冲区 Alt+2  ;; C-x 2

(global-set-key (kbd "M-2") 'split-window-vertically)

;;垂直分割缓冲区 Alt+3  ;; C-x 3

(global-set-key (kbd "M-3") 'split-window-horizontally)

;;切换到其它缓冲区 Alt+0 ;; C-x o 

(global-set-key (kbd "M-0") 'other-window)

 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; 代码 折叠

(add-hook 'c-mode-common-hook 'hs-minor-mode)

(add-hook 'emacs-lisp-mode-hook 'hs-minor-mode)

(add-hook 'java-mode-hook 'hs-minor-mode)

(add-hook 'ess-mode-hook 'hs-minor-mode)

(add-hook 'python-mode-hook 'hs-minor-mode)

(add-hook 'sh-mode-hook 'hs-minor-mode)

 

;; 折叠块

(global-set-key (kbd "C-z C-x") 'hs-hide-all)

(global-set-key (kbd "C-z C-a") 'hs-show-all)

(global-set-key (kbd "C-z C-z") 'hs-toggle-hiding)

 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; 自动补全(auto-complete插件)

(require 'auto-complete-config)

(add-to-list 'ac-dictionary-directories "~/.emacs.d//ac-dict")

(ac-config-default)

 

;; yasnippet

(add-to-list 'load-path "/usr/share/emacs/site-lisp/yas")

(require 'yasnippet) ;; not yasnippet-bundle

(yas/initialize)

(yas/load-directory "/usr/share/emacs/site-lisp/yas/snippets")

 

;;==============================================================

;; Python START

;;==============================================================

 

;; pymacs

(autoload 'pymacs-apply "pymacs")

(autoload 'pymacs-call "pymacs")

(autoload 'pymacs-eval "pymacs" nil t)

(autoload 'pymacs-exec "pymacs" nil t)

(autoload 'pymacs-load "pymacs" nil t)

(eval-after-load "pymacs"  '(add-to-list 'pymacs-load-path "/usr/lib/python3.2/site-packages/Pymacs/"))

 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; pycomplete start

 

;; python-mode settings

(setq auto-mode-alist (cons '("\\.py$" . python-mode) auto-mode-alist))

(setq interpreter-mode-alist(cons '("python" . python-mode)

                             interpreter-mode-alist))

 

;; path to the python interpreter, e.g.: ~rw/python31/bin/python3

(setq py-python-command "python3")

(autoload 'python-mode "python-mode" "Python editing mode." t)

 

;; pymacs settings

(setq pymacs-python-command py-python-command)

(autoload 'pymacs-load "pymacs" nil t)

(autoload 'pymacs-eval "pymacs" nil t)

(autoload 'pymacs-apply "pymacs")

(autoload 'pymacs-call "pymacs")

 

(require 'pycomplete)

;; pycomplete end

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 

;; ropemacs  now, the plugin not support python3.2

;(require 'pymacs)

;(pymacs-load "ropemacs" "rope-")

;(pymacs-load '"ropemacs")

;(pymacs-load "rope")

 

;;==============================================================

;; Python END

;;==============================================================

 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;; Barton's .emacs end

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


分享到:
评论

相关推荐

    emacs配置文件 (.emacs)

    emacs config file, emacs编辑器的一个配置文件

    linux emacs 配置文件

    本配置文件基于网上提供的其他配置文件进行修改。 支持: emacs 24 +cedet 1.1 +ecb 2.40 源配置文件下载地址: http://download.csdn.net/detail/karotte/3812760

    spacemacs配置 包含.emacs.d 目录 和 .spacemacs 配置文件

    spacemacs配置 包含.emacs.d 目录 和 .spacemacs 配置文件

    比较简单的.emacs.d配置插件

    我的和.emacs配套的.emacs.d,拥有auto-complete,ace-jume,color-theme等实用的插件。

    emacs集成多插件配置文件.emacs

    带有命令行显示等多功能的emacs配置文件,只需要将config.emacs改名为.emacs放用户目录下即可使用,如果/home/gqb,用户名为gqb。或者cd ~进行用户目录。

    emacs-config:我正在使用的.emacs配置

    emacs配置 我正在使用的.emacs配置

    emacs 配置文件+ .emacs.d资源

    这是原地址http://linux.cuit.edu.cn/?p=1020 我是用不到了 我的另一个emacs配置是我自己的 这个是从上面那个地址下的

    emacs常用配置.zip

    包含常用emcas需要的插件,以及.emacs 配置目录: └─site-lisp │ color-theme.el │ ibuffer.el │ ido.el │ linum.el │ redo.el │ session.el │ tabbar.el │ xcscope.el ├─cedet-1.0pre6 ├─...

    matlab录入语音信号代码-dotemacs:这是我的Emacs配置,不再以.emacs文件开头...朝init.el致敬!

    matlab录入语音信号代码Massimo的Emacs配置 这是Massimo Lauria(C)2009-2021的Emacs配置。 这种配置规模庞大,并且会不断变化,并且每天都会发生变化。 我只是将其放在网上,所以您可以剪切并粘贴任何您认为有用的...

    .emacs.d:Feng Li的emacs配置

    冯莉的Emacs配置版权查看每个单独的文件。安装备份旧文件 cd ~ mv .emacs.d .emacs.d-bak mv .emacs .emacs-bak克隆存储库 cd ~ git clone git://github.com/feng-li/.emacs.d.git cd ~/.emacs.d/ git submodule ...

    emacs.d:我的〜.emacs.d目录

    前言该存储库包含我的emacs24配置。 它很大程度上受到了我使用过几年的和我以前的启发!安装将此存储库克隆到您的主目录中: git clone https://github.com/Sliim/emacs.d ~ /.emacs.d 使用Cask安装软件包依赖项...

    .emacs.d:我的 Emacs 配置支持 LaTeX、Django、Matlab 和 Iraf

    1.安装 ... 这个 .emacs.d 配置的主要用途是让 HackSpace 社区的用户快速介绍 emacs 编辑器,并为如何自定义将成为他们自己的 .emacs.d 的内容提供灵活而坚实的基础 主要特点: Clojure 开发支持 组

    .emacs.d:普通LispClojure用户的Emacs配置

    普通Lisp / Clojure用户的Emacs配置 安装 cd ~ / git clone --recursive https://github.com/muyinliu/.emacs.d.git 或者 cd ~ / git clone https://github.com/muyinliu/.emacs.d.git cd ~ /.emacs.d/ git ...

    emacs常用配置需要的文件

    emacs常用配置... emacs常用配置...

    .emacs linux windows

    emacs的配置文件,在emacs启动后会首先运行该lisp脚本

    .emacs.d:个人 Emacs 配置

    我的 Emacs 配置 设置 $ git clone https://github.com/lunaryorn/.emacs.d.git ~ /.emacs.d OS X 支持 $ brew install trash coreutils 拼写检查 $ brew install aspell --with-lang-de --with-lang-en 支持 ...

    .emacs.d:个人Emacs配置

    Emacs Special 42配置(带注释) 警告这些配置和/或命令中的某些可能特定于特定设置(42学派),某些命令可能对其他设置无用,或者可能导致故障排除 快乐的 标头42创建文件时自动显示(特定的shell命令) 创建文件...

    dot-emacs-collection:各种 .emacs 材料的集合

    .emacs 集合各种 .emacs 配置的集合。 笔记: 包含的配置特别针对和设置。 其他语言,如和也可能出现。 模式将被推广!子模块的 git 帮助要克隆此存储库及其所有子存储库,请发出以下git命令: &gt; git clone --...

    .emacs.d:Emacs配置

    个人Emacs配置这是我的个人emacs配置。 我用于use-package的语法取决于 (如果愿意,可以随意使用,但是我主要将其编写为个人使用)。 git clone --depth=1 https://github.com/SidharthArya/.emacs.d ~ /.local/...

    dotemacs:我的个人.emacs配置

    dotemacs-我的个人.emacs文件。 屏幕截图 这是我的黑暗主题的屏幕截图。 它基于厄运Kong雀主题。 这是我的轻主题的屏幕截图。 它基于厄运-北光主题。

Global site tag (gtag.js) - Google Analytics