直接给出配置,发邮件的配置没有给出。
;; 显示括号匹配
(show-paren-mode t)
(setq show-paren-style 'parentheses)
;; 指针颜色设置为白色
(set-cursor-color "orange")
;;代码提示
;;-----------------------------auto-complete--------------------------------------------
;;auto-complete
(add-to-list 'load-path "~/.emacs.d/lisp/auto-complete-1.3.1")
(require 'auto-complete)
(require 'auto-complete-config)
(defun prefix-list-elements (list prefix)
(let (value)
(nreverse
(dolist (element list value)
(setq value (cons (format "%s%s" prefix element) value))))))
(defvar ac-source-rope
'((candidates
. (lambda ()
(prefix-list-elements (rope-completions) ac-target))))
"Source for Rope")
(defun ac-python-find ()
"Python `ac-find-function'."
(require 'thingatpt)
(let ((symbol (car-safe (bounds-of-thing-at-point 'symbol))))
(if (null symbol)
(if (string= "." (buffer-substring (- (point) 1) (point)))
(point)
nil)
symbol)))
(defun ac-python-candidate ()
"Python `ac-candidates-function'"
(let (candidates)
(dolist (source ac-sources)
(if (symbolp source)
(setq source (symbol-value source)))
(let* ((ac-limit (or (cdr-safe (assq 'limit source)) ac-limit))
(requires (cdr-safe (assq 'requires source)))
cand)
(if (or (null requires)
(>= (length ac-target) requires))
(setq cand
(delq nil
(mapcar (lambda (candidate)
(propertize candidate 'source source))
(funcall (cdr (assq 'candidates source)))))))
(if (and (> ac-limit 1)
(> (length cand) ac-limit))
(setcdr (nthcdr (1- ac-limit) cand) nil))
(setq candidates (append candidates cand))))
(delete-dups candidates)))
(add-hook 'python-mode-hook
(lambda ()
(set (make-local-variable 'ac-sources)
(append ac-sources '(ac-source-rope) '(ac-source-yasnippet)))
(rope-open-project "~/.emacs.d/database/python/")
))
(add-to-list 'ac-dictionary-directories "~/.emacs.d/lisp/auto-complete-1.3.1/dict")
(ac-config-default)
(global-auto-complete-mode t)
;(setq-default ac-sources '(ac-source-words-in-same-mode-buffers))
(setq-default ac-sources '(ac-source-yasnippet
ac-source-semantic
ac-source-ropemacs
ac-source-imenu
ac-source-words-in-buffer
ac-source-dictionary
ac-source-abbrev
ac-source-words-in-buffer
ac-source-files-in-current-dir
ac-source-filename))
(add-hook 'emacs-lisp-mode-hook (lambda () (add-to-list 'ac-sources 'ac-source-symbols)))
(add-hook 'auto-complete-mode-hook (lambda () (add-to-list 'ac-sources 'ac-source-filename)))
;;下面这句是从auto-complete-config.el中翻出来的
;;加上这句,在python中输入类的 . 就可以提示里面的方法了
(add-hook 'python-mode-hook (lambda () (add-to-list 'ac-omni-completion-sources (cons "\\." '(ac-source-ropemacs))) ))
(set-face-background 'ac-candidate-face "lightgray")
(set-face-underline 'ac-candidate-face "darkgray")
(set-face-background 'ac-selection-face "steelblue")
(setq ac-auto-start 2)
(setq ac-dwim t)
;;重构功能以及函数提示
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Cedet 1.0
;;
(load-file "~/.emacs.d/lisp/cedet-1.1/common/cedet.el")
;;;; 具体说明可参考源码包下的INSTALL文件,或《A Gentle introduction to Cedet》
;; Enabling Semantic (code-parsing, smart completion) features
;; Select one of the following:
;;(semantic-load-enable-minimum-features)
;;(semantic-load-enable-code-helpers)
;;(semantic-load-enable-gaudy-code-helpers)
(semantic-load-enable-excessive-code-helpers)
;;(semantic-load-enable-semantic-debugging-helpers)
;;;; 使函数体能够折叠或展开
;; Enable source code folding
(global-semantic-tag-folding-mode 1)
;; Key bindings
(defun my-cedet-hook ()
(local-set-key [(control return)] 'semantic-ia-complete-symbol)
(local-set-key "/C-c?" 'semantic-ia-complete-symbol-menu)
(local-set-key "/C-cd" 'semantic-ia-fast-jump)
(local-set-key "/C-cr" 'semantic-symref-symbol)
(local-set-key "/C-cR" 'semantic-symref))
(add-hook 'c-mode-common-hook 'my-cedet-hook)
;;;; 当输入"."或">"时,在另一个窗口中列出结构体或类的成员
(defun my-c-mode-cedet-hook ()
(local-set-key "." 'semantic-complete-self-insert)
(local-set-key ">" 'semantic-complete-self-insert))
(add-hook 'c-mode-common-hook 'my-c-mode-cedet-hook)
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;工程目录
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ECB 2.40
;;
(add-to-list 'load-path
"~/.emacs.d/lisp/ecb-2.40")
(require 'ecb)
(require 'ecb-autoloads)
;;;; 自动启动ecb,并且不显示每日提示
(setq ecb-auto-activate t
ecb-tip-of-the-day nil)
(ecb-layout-define "my-cscope-layout" left nil
(ecb-set-methods-buffer)
(ecb-split-ver 0.5 t)
(other-window 1)
(ecb-set-history-buffer)
(ecb-split-ver 0.5 t) ;我改成了0.5
(other-window 1)
(ecb-set-cscope-buffer))
(defecb-window-dedicator ecb-set-cscope-buffer " *ECB cscope-buf*"
(switch-to-buffer "*cscope*"))
(setq ecb-layout-name "my-cscope-layout")
;; Disable buckets so that history buffer can display more entries
(setq ecb-history-make-buckets 'never)
;; ;;;;窗口间切换
(global-set-key [M-left] 'windmove-left)
(global-set-key [M-right] 'windmove-right)
(global-set-key [M-up] 'windmove-up)
(global-set-key [M-down] 'windmove-down)
;;;;show&hide window
(global-set-key [C-f1] 'ecb-hide-ecb-windows)
(global-set-key [C-f2] 'ecb-show-ecb-windows)
;; ;;;; 使某一ecb窗口最大化
(global-set-key (kbd "C-c 1") 'ecb-maximize-window-directories)
(global-set-key (kbd "C-c 2") 'ecb-maximize-window-sources)
(global-set-key (kbd "C-c 3") 'ecb-maximize-window-methods)
(global-set-key (kbd "C-c 4") 'ecb-maximize-window-history)
;; ;;;;恢复原始窗口布局
(global-set-key (kbd "C-c 0") 'ecb-restore-default-window-sizes)
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(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.
)
(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 :background "black" :foreground "green" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 98 :width normal :foundry "unknown" :family "DejaVu Sans Mono")))))
;;------------------------pymacs-----------------------------------
(load "~/.emacs.d/pymacs.el")
;; Python mode hook
(defun my-python-hook-mode ()
(interactive)
;(setq ropemacs-enable-shortcuts nil)
;(setq ropemacs-local-prefix "C-c C-p")
(require '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)
(ac-ropemacs-setup)
;(pymacs-load "ropemacs" "rope-")
;; Automatically save project python buffers before refactorings
(setq ropemacs-confirm-saving 'nil)
(ropemacs-mode t)
(define-key python-mode-map "\C-m" 'newline-and-indent)
;(setq ac-sources (append ac-sources '(ac-source-ropemacs)))
)
(add-hook 'python-mode-hook 'my-python-hook-mode)
;;------------------------查看词典----------------------------------
(defun yodao-dict-search-wordap (&optional word)
"Use python script dict to look up word under point"
(interactive)
(or word (setq word (current-word)))
(shell-command (format "python ~/.emacs.d/dict.py %s" word)))
(global-set-key [f7] 'yodao-dict-search-wordap)
;;---------------------------挂载文档----------------------------
(setq pylookup-dir "~/.emacs.d/plugins/pylookup")
(add-to-list 'load-path pylookup-dir)
(require 'pylookup)
;; load pylookup when compile time
(eval-when-compile (require 'pylookup))
;; set executable file and db file
(setq pylookup-program (concat pylookup-dir "/pylookup.py"))
(setq pylookup-db-file (concat pylookup-dir "/pylookup.db"))
;; set search option if you want
;; (setq pylookup-search-options '("--insensitive" "0" "--desc" "0"))
;; to speedup, just load it on demand
(autoload 'pylookup-lookup "pylookup"
"Lookup SEARCH-TERM in the Python HTML indexes." t)
(autoload 'pylookup-update "pylookup"
"Run pylookup-update and create the database at `pylookup-db-file'." t)
(global-set-key (kbd "C-c h") 'pylookup-lookup)
记录一下,防止以后再其他机子上需要配置,下面把所用的插件也上传上来.只需要下载并且解压到你的目录下,把emacs.d改成.emacs.d,覆盖你原来的.emacs.d,然后拷贝上面的的配置文件到你的.emacs下,就可以生效了。
好了,体验emcas来了,以后有新的功能会及时更新。
分享到:
相关推荐
这个"Emacs配置文件"就是对Emacs进行个性化调整的脚本,通常以`.emacs`或`init.el`为名。 配置文件的主要作用: 1. **快捷键定制**:Emacs提供了丰富的快捷键,用户可以通过配置文件自定义这些快捷键,使其更符合...
标题提到的是个人的Emacs配置文件,用于在Linux系统上优化Emacs的使用体验。 描述中提到,这个压缩包包含两个关键文件:`.emacs`和`.emacs.d`。`.emacs`是Emacs的初始化文件,它定义了Emacs启动时执行的Lisp代码,...
本配置文件基于网上提供的其他配置文件进行修改。 支持: emacs 24 +cedet 1.1 +ecb 2.40 源配置文件下载地址: http://download.csdn.net/detail/karotte/3812760
总结起来,一个高效的Emacs配置应该包含智能的自动补全(auto-complete),强大的代码导航(helm gtags)以及根据个人需求编写的实用小函数。通过避免使用大型框架,我们可以保持Emacs的轻便和高效。记得在`.emacs_dir`...
标题提到的“王垠 王纯叶的emacs配置”很可能包含了他们各自的个性化设置,这些设置可能包括快捷键定制、自动补全、代码高亮、项目管理、版本控制集成以及各种语言的开发环境配置。CHM(Compiled Help Manual)文件...
"emacs配置好了的"指的是已经预先配置好了一套完整的设置,使得用户可以直接使用,而无需从零开始进行复杂的个性化配置。 配置好的Emacs通常包括以下方面的优化: 1. **快捷键绑定**:预设了常用操作的快捷键,如...
这个名为"emacs配置文件"的压缩包应该是一个修正版的`emacs.d`,它可能已经解决了网络上其他配置中常见的缺失文件问题。使用这个配置,用户可以避免因缺少文件而导致的配置错误,更快地建立一个完整的Emacs工作环境...
这个压缩包包含了两个关键的文件,`.emacs`和`.emacs.d`,它们是Emacs配置的核心部分。 首先,`.emacs`是Emacs启动时加载的Lisp脚本,它定义了Emacs的行为和环境。在`.emacs`文件中,你可以设置快捷键、加载插件、...
带有各种功能的emacs配置。
最后,值得一提的是,Emacs的配置和扩展可以通过MELPA(Melpa Stable)和ELPA(Emacs Lisp Package Archive)等包管理器轻松获取和安装,这极大地方便了用户管理和更新他们的Emacs环境。 总结来说,Emacs作为一个...
标题"emacs配置-python开发环境"表明这个压缩包包含了用于在Emacs中优化Python开发的定制配置。 描述中提到,用户需要下载压缩包,解压后,备份原有的`.emacs.d`文件夹,然后用新提供的文件夹替换它。`.emacs.d`是...
总的来说,Emacs配置涉及的不仅仅是安装和启用插件,更重要的是根据个人习惯和需求进行定制,以实现最高效的开发环境。理解并熟练掌握Cedet、ECB和Yasnippet等工具的使用,以及Emacs的键位自定义,能显著提升开发者...
该项目是基于Emacs Lisp的个性化Emacs配置设计源码,共包含8463...该项目旨在为用户提供一个个性化的Emacs配置,通过Emacs Lisp技术实现了系统的功能性和用户界面的友好性。配置文件中如有版权问题,请与项目作者联系。
在这个主题中,我们将深入探讨"Emacs配置文件和脚本",以及与之相关的Gccsense工具。 首先,我们来看`.emacs`文件,这是Emacs的主配置文件,位于用户的家目录下。这个文件包含了Emacs启动时执行的Lisp代码,用于...
Atom-emacs是一个专门为JavaScript开发定制的GNU Emacs配置,它结合了Emacs的强大功能与Atom编辑器的现代化界面和用户体验。Emacs是一款历史悠久的、高度可定制的文本编辑器,深受程序员喜爱,尤其在Linux和开源社区...