- 浏览: 66961 次
- 性别:
- 来自: 郑州
文章分类
最新评论
我的.emacs
- 博客分类:
- 技术笔记
;;窗口初始大小 (setq initial-frame-alist '((top . 0) (left . 100) (width . 120) (height . 42))) ;;去掉启动欢迎界面 (setq inhibit-startup-message t) ;;Ctrl+鼠标滚轮缩放字体 (global-set-key (kbd "<C-wheel-up>") 'text-scale-increase) (global-set-key (kbd "<C-wheel-down>") 'text-scale-decrease) ;;不要总是没完没了的问yes or no, 为什么不能用 y/n (fset 'yes-or-no-p 'y-or-n-p) ;;打开高亮 #M-x global-font-lock-mode (global-font-lock-mode t) ;;示括号匹配 (show-paren-mode t) (setq show-paren-style 'parentheses) ;;显示列号 ;;(setq column-number-mode 0) ;;(setq line-number-mode t) ;;在左侧显示行号 (global-linum-mode 'linum-mode) ;;set mark (global-set-key (kbd "M-SPC") 'set-mark-command) ;;光标靠近鼠标的时候,让鼠标自动让开,别挡住视线 ;;(mouse-avoidance-mode 'animate) ;;平滑滚动, 在光标在最后一行的时候,继续下一行跳动的时候,有明显的跳动感觉 (setq scroll-margin 2 scroll-conservatively 10000) ;;禁止自动保存 ;(auto-save-mode nil) ;;buffer 窗口快捷 (global-set-key [C-return] 'kill-this-buffer);C-return关闭当前buffer (global-set-key [f10] 'split-window-vertically);F10分割窗口 (global-set-key [f11] 'delete-other-windows);F11 关闭其它窗口 ;;默认显示 80列就换行 (setq default-fill-column 80) ;;设置行间距 (setq-default line-spacing 2) ;;不要生成临时文件 (setq-default make-backup-files nil); ;;Emacs顶部标题栏显示文件名 (setq frame-title-format " %b") ;;高亮显示当前行 ;(global-hl-line-mode) ;;在下面栏中显示时间 (display-time-mode 1) ;;使用24小时制 (setq display-time-24hr-format t) ;;光标为竖线 (setq-default cursor-type 'bar) ;;设置打开文件的缺省目录 ;(setq default-directory "f:/workspace") ;;隐藏菜单栏、右侧的滚动条 ;;(menu-bar-mode nil) (menu-bar-mode 0) (tool-bar-mode 0) (scroll-bar-mode 0) (add-to-list 'load-path "~/.emacs.d") ;;自动完成 (add-to-list 'load-path "~/.emacs.d/auto-complete") (require 'auto-complete-config) (add-to-list 'ac-dictionary-directories "~/.emacs.d/auto-complete/ac-dict") (ac-config-default) ;;------------语言环境字符集设置(utf-8)------------- (set-language-environment 'Chinese-GB) (set-keyboard-coding-system 'utf-8) (set-clipboard-coding-system 'utf-8) (set-terminal-coding-system 'utf-8) (set-buffer-file-coding-system 'utf-8) (set-default-coding-systems 'utf-8) (set-selection-coding-system 'utf-8) (modify-coding-system-alist 'process "*" 'utf-8) (setq default-process-coding-system '(utf-8 . utf-8)) (setq-default pathname-coding-system 'utf-8) (set-file-name-coding-system 'utf-8) (setq ansi-color-for-comint-mode t) (setq file-name-coding-system 'utf-8) (setq path-name-coding-system 'utf-8) (if (eq system-type 'windows-nt) (setq file-name-coding-system 'gbk)) ;默认字体 (set-default-font "Courier New-12") ;;package (require 'package) (add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/")) (package-initialize) ;; color-theme (require 'color-theme) ;(color-theme-initialize) ;(color-theme-gnome2) (color-theme-classic) ;;光标颜色 (set-cursor-color "green") ;; 设置Tab为4个字符 (setq indent-tabs-mode nil) (setq default-tab-width 4) (setq tab-width 4) (setq tab-stop-list ()) (loop for x downfrom 40 to 1 do (setq tab-stop-list (cons (* x 4) tab-stop-list))) ;; 在当前所有打开的buffer中替换字符串 (defun query-replace-in-open-buffers (arg1 arg2) "query-replace in all open files" (interactive "sRegexp:\nsReplace with:") (mapcar (lambda (x) (find-file x) (save-excursion (goto-char (point-min)) (query-replace-regexp arg1 arg2))) (delq nil (mapcar (lambda (x) (buffer-file-name x)) (buffer-list))))) ;;Alt+上下键,移动一行内容 ;;move line up down (defun move-text-internal (arg) (cond ((and mark-active transient-mark-mode) (if (> (point) (mark)) (exchange-point-and-mark)) (let ((column (current-column)) (text (delete-and-extract-region (point) (mark)))) (forward-line arg) (move-to-column column t) (set-mark (point)) (insert text) (exchange-point-and-mark) (setq deactivate-mark nil))) (t (let ((column (current-column))) (beginning-of-line) (when (or (> arg 0) (not (bobp))) (forward-line) (when (or (< arg 0) (not (eobp))) (transpose-lines arg)) (forward-line -1)) (move-to-column column t))))) (defun move-text-down (arg) "Move region (transient-mark-mode active) or current line arg lines down." (interactive "*p") (move-text-internal arg)) (defun move-text-up (arg) "Move region (transient-mark-mode active) or current line arg lines up." (interactive "*p") (move-text-internal (- arg))) (global-set-key [M-up] 'move-text-up) (global-set-key [M-down] 'move-text-down) ;;透明不透明 (global-set-key [(f8)] 'loop-alpha) (setq alpha-list '((75 55) (100 100))) (defun loop-alpha () (interactive) (let ((h (car alpha-list))) ((lambda (a ab) (set-frame-parameter (selected-frame) 'alpha (list a ab)) (add-to-list 'default-frame-alist (cons 'alpha (list a ab))) ) (car h) (car (cdr h))) (setq alpha-list (cdr (append alpha-list (list h)))))) ;;Alt+w 复制光标所在一整行,Alt+k,复制当前行光标后面的内容 ;; Smart copy, if no region active, it simply copy the current whole line (defadvice kill-line (before check-position activate) (if (member major-mode '(emacs-lisp-mode scheme-mode lisp-mode c-mode c++-mode objc-mode js-mode latex-mode plain-tex-mode)) (if (and (eolp) (not (bolp))) (progn (forward-char 1) (just-one-space 0) (backward-char 1))))) (defadvice kill-ring-save (before slick-copy activate compile) "When called interactively with no active region, copy a single line instead." (interactive (if mark-active (list (region-beginning) (region-end)) (message "Copied line") (list (line-beginning-position) (line-beginning-position 2))))) (defadvice kill-region (before slick-cut activate compile) "When called interactively with no active region, kill a single line instead." (interactive (if mark-active (list (region-beginning) (region-end)) (list (line-beginning-position) (line-beginning-position 2))))) ;; Copy line from point to the end, exclude the line break (defun qiang-copy-line (arg) "Copy lines (as many as prefix argument) in the kill ring" (interactive "p") (kill-ring-save (point) (line-end-position)) (line-beginning-position (+ 1 arg))) (global-set-key (kbd "M-k") 'qiang-copy-line) ;;代码模板- yasnippet (yas-global-mode 1) ;;js2-mode (require 'js2-mode); (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode)) ;;----- clojure-mode ------ (add-to-list 'load-path "~/.emacs.d/clojure") (require 'clojure-mode); ;;slime (eval-after-load "slime" '(progn (slime-setup '(slime-repl)))) (add-to-list 'load-path "~/.emacs.d/slime") (require 'slime) (slime-setup) (load-file "~/.emacs.d/wdy.el");
wdy.el
;;修改过的 js/jsp/html/htm/jsp/css 文件在保存时自动部署到tomcat下 (add-hook 'after-save-hook (lambda() (auto-deploy-to-tomcat))) ;;复制当前buffer到tomcat的webapp下对应的目录中 (setq tomcat-path "D:/Program Files/Apache Software Foundation/Apache Tomcat 6.0.20/webapps/") (defun auto-deploy-to-tomcat() "Copy me to the Tomcat WebApps" (interactive) (if (string-match ".*/\\(.*\\)/WebRoot\\(.*\\)/.*\\(.js\\|.jsp\\|.css\\|.html\\|.htm\\|.jsp\\)" buffer-file-name) (let ((target-path (concat tomcat-path (match-string 1 buffer-file-name) (match-string 2 buffer-file-name)))) (message (concat "Copy current buffer To: " target-path )) (copy-file buffer-file-name target-path t)))) ;;SVN update ;(global-set-key [(F5)] 'svn-update) (defun svn-update() "Svn update" (interactive) (let ((cmd (concat "TortoiseProc.exe /command:update /path:\"" buffer-file-name "\" /closeonend:0"))) (message cmd) (shell-command cmd))) ;(global-set-key [(F12)] 'svn-commit) (defun svn-commit() "Svn commit" (interactive) (let ((cmd (concat "TortoiseProc.exe /command:commit /path:\"" buffer-file-name "\" /closeonend:0"))) (message cmd) (shell-command cmd))) ;;SVN diff ;(global-set-key [(F5)] 'svn-diff) (defun svn-diff() "Svn diff" (interactive) (let ((cmd (concat "TortoiseProc.exe /command:diff /path:\"" buffer-file-name "\" /closeonend:0"))) (message cmd) (shell-command cmd)))
发表评论
-
OpenGL开发环境笔记
2014-12-30 16:25 388OpenGL开发环境搭建,做下笔记。 Virtual ... -
emacs调用SVN进行更新、提交、比较
2013-03-21 14:59 2595需要安装SVN的TortoiseSVN客户端。 然后把下面的代 ... -
模拟退火算法
2010-07-20 08:38 981原理 根据Metropolis准则,粒子在温度T时趋 ... -
JS日期操作
2010-01-22 19:08 166//对象定义 var DateUtil = new fu ... -
神经网络解决Xor问题的例子 Java实现代码
2009-08-07 15:50 2762public class Network implemen ... -
Eclipse + DEV-cpp配置
2009-07-13 13:22 1051path二进制D:\Program Files\DEV-CPP ... -
用摄像头控制鼠标-java实现方法
2009-06-28 17:12 1473(暂没考虑运行效率) 1. 从摄像头中截取一张图片 2. 在 ... -
图片相似度的一种简单计算方法
2009-06-28 16:52 5190/** * 欧几里德距离 * @param ... -
一段打印自身的代码
2009-01-22 14:47 454网上见过别人用c写的,今儿自己也用java写了一个 pu ... -
MyEclipse小技巧:不用插件将汉字转换成Unicode编码
2008-05-17 10:17 1591偶然发现的: 1. web项目中随便新建一个 *.js文件,将 ...
相关推荐
spacemacs配置 包含.emacs.d 目录 和 .spacemacs 配置文件
cedet ecb .emacs cedet ecb .emacs cedet ecb .emacs cedet ecb .emacs cedet ecb .emacs cedet ecb .emacs cedet ecb .emacs cedet ecb .emacs cedet ecb .emacs cedet ecb .emacs cedet ecb .emacs cedet ecb ....
带有命令行显示等多功能的emacs配置文件,只需要将config.emacs改名为.emacs放用户目录下即可使用,如果/home/gqb,用户名为gqb。或者cd ~进行用户目录。
emacs.d, 下面是我的. emacs. public 阅读 emacs.d这是我的.emacs.d 。它只提供给 public 用于教育目的。 如果你打算将它用作你自己的.emacs.d,则不提供任何支持。许可证版权所有( C ) Bodil Stokke这里程序是自由...
emacs config file, emacs编辑器的一个配置文件
NULL 博文链接:https://chuqq.iteye.com/blog/1333212
我的和.emacs配套的.emacs.d,拥有auto-complete,ace-jume,color-theme等实用的插件。
.emacs.d
Emacs.d 我的.emacs.d /主目录。前言该存储库包含我的emacs24配置。 它很大程度上受到了我使用过几年的和我以前的启发!安装将此存储库克隆到您的主目录中: git clone https://github.com/Sliim/emacs.d ~ /.emacs....
GNU.Emacs.Lisp.Reference.Manual.2015.5.pdf,是Emacs的lisp语言的书籍,主要讲解了此lisp对Emacs的定制。
.emacs.d, 在 @emacsrocks 中,我的个人emacs设置,以及使用 我的emacs设置一组不断变化的emacs设置。 微型优化是超级有趣的。这些是在 Emacs rock 屏幕截图中使用的。 你也可以在我的设置后面看到一些想法:. emacs...
只带theme的.emacs.
这是原地址http://linux.cuit.edu.cn/?p=1020 我是用不到了 我的另一个emacs配置是我自己的 这个是从上面那个地址下的
emacs的配置文件,在emacs启动后会首先运行该lisp脚本
GNU.Emacs完全手册 编辑器之神的使用手册!
The third edition of Learning GNU Emacs describes Emacs 21.3 from the ground up, including new user interface features such as an icon-based toolbar and an interactive interface to Emacs customization...
then mv .emacs.d .emacs.d.SAVE ;fi git clone http://github.com/frgomes/.emacs.d emacs & 就是这样! 如果一切按计划进行,Emacs将从互联网上下载大量内容,进行编译并进行自我配置,而不会出现任何错误。 然后...
.Emacs 我的 .emacs 文件 正在安装。 git clone https://github.com/GeneticGenesis/Emacs.git ~/.emacs.philc mv ~/.emacs ~/.emacs.old ln -s ~/.emacs.philc/.emacs ~/.emacs
1.安装 ... 这个 .emacs.d 配置的主要用途是让 HackSpace 社区的用户快速介绍 emacs 编辑器,并为如何自定义将成为他们自己的 .emacs.d 的内容提供灵活而坚实的基础 主要特点: Clojure 开发支持 组
非常好用的emacs配置文件!日历功能,自动不全功能,行号显示功能,屏蔽光标功能等!