emacs org pic 模式

;; .emacs 

(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 "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 120 :width normal :foundry "unknown" :family "华文仿宋")))))
;;--------------------------------------------------------------------------------------------
;解决emacs shell 乱码 
(setq ansi-color-for-comint-mode t)
(customize-group 'ansi-colors) 
;--------------------------------------------------------------------------------------------
;;加载cedet
(add-to-list 'load-path "~/lisp/cedet/speedbar")
(add-to-list 'load-path "~/lisp/cedet/eieio")
(add-to-list 'load-path "~/lisp/cedet/semantic")
(add-to-list 'load-path "~/lisp/cedet/common")
(add-to-list 'load-path "~/.emacs.d/")
(require 'cedet)
;------------------------------------------------------------------------------------------
;;加载ecb
(add-to-list 'load-path "~/lisp/ecb")
;;(require 'ecb)
(require 'ecb-autoloads)
;;(ecb-activate)
(when (require 'ecb nil 'noerror)
(setq ecb-tip-of-the-day nil)
(setq ecb-auto-compatibility-check nil)
(setq ecb-primary-secondary-mouse-buttons 'mouse-1--C-mouse-1))
;----------------------------------------------------------------------------------------


;; 用M-x执行某个命令的时候,在输入的同时给出可选的命令名提示
(icomplete-mode 1)
(define-key minibuffer-local-completion-map (kbd "SPC") 'minibuffer-complete-word)
;;(setq column-number-mode t)
;;(setq line-number-mode t)
;;(global-linum-mode 'linum-mode);;在左边显示行号


(show-paren-mode t);显示括号匹配
(setq show-paren-mode t) ;;打开括号匹配显示模式
(setq show-paren-style 'parenthesis)
(display-time-mode 1);显示时间,格式如下
(setq display-time-24hr-format t)
(setq display-time-day-and-date t)
(setq display-time-use-mail-icon t);;时间栏旁边启用邮件设置
(setq display-time-interval 10);;时间的变化频率,单位多少来着? 


(mouse-avoidance-mode 'animate);光标靠近鼠标指针时,让鼠标指针自动让开
(setq mouse-yank-at-point t);支持中键粘贴
(transient-mark-mode t);允许临时设置标记
;; 高亮显示C/C++中的可能的错误(CWarn mode)
(global-cwarn-mode 1)
(global-set-key (kbd "<C-down-mouse-1>") nil) ;; 去掉原来的帮定关系
(global-set-key (kbd "<C-mouse-1>") 'mouse-buffer-menu);;ctrl+鼠标左键调出选择切换buffer功能
(global-set-key (kbd "<C-down-mouse-2>") 'mouse-popup-menuar-stuff);;ctrl+鼠标右键调出和编


;; 设置时间戳,标识出最后一次保存文件的时间。
(setq time-stamp-active t)
(setq time-stamp-warn-inactive t)
(setq time-stamp-format "%:y-%02m-%02d %3a %02H:%02M:%02S chunyu")
(global-set-key (kbd "M-g") 'goto-line);;设置M-g为goto-line
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  设置日历 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;设置日历的一些颜色
(setq calendar-load-hook
'(lambda ()
(set-face-foreground 'diary-face "skyblue")
(set-face-background 'holiday-face "slate blue")
(set-face-foreground 'holiday-face "white")))
;;设置我所在地方的经纬度,calendar里有个功能是日月食的预测,和你的经纬度相联系的。
;; 让emacs能计算日出日落的时间,在 calendar 上用 S 即可看到
(setq calendar-latitude +39.54)
(setq calendar-longitude +116.28)
(setq calendar-location-name "北京")
;; 设置阴历显示,在 calendar 上用 pC 显示阴历
(setq chinese-calendar-celestial-stem
["甲" "乙" "丙" "丁" "戊" "己" "庚" "辛" "壬" "癸"])
(setq chinese-calendar-terrestrial-branch
["子" "丑" "寅" "卯" "辰" "巳" "戊" "未" "申" "酉" "戌" "亥"])
;; 设置 calendar 的显示
(setq calendar-remove-frame-by-deleting t)
(setq calendar-week-start-day 1);; 设置星期一为每周的第一天
(setq mark-diary-entries-in-calendar t);; 标记calendar上有diary的日期
(setq mark-holidays-in-calendar nil); ; 为了突出有diary的日期,calendar上不标记节日
(setq view-calendar-holidays-initially nil) ; 打开calendar的时候不显示一堆节日
;; 去掉不关心的节日,设定自己在意的节日,在 calendar 上用 h 显示节日
(setq christian-holidays nil)
(setq hebrew-holidays nil)
(setq islamic-holidays nil)
(setq solar-holidays nil)
(setq general-holidays '((holiday-fixed 1 1 "元旦")
(holiday-fixed 2 14 "情人节")
(holiday-fixed 3 14 "白色情人节")
(holiday-fixed 4 1 "愚人节")
(holiday-fixed 5 1 "劳动节")
(holiday-float 5 0 2 "母亲节")
(holiday-fixed 6 1 "儿童节")
(holiday-float 6 0 3 "父亲节")
(holiday-fixed 7 1 "建党节")
(holiday-fixed 8 1 "建军节")
(holiday-fixed 9 10 "教师节")
(holiday-fixed 10 1 "国庆节")
(holiday-fixed 12 25 "圣诞节"))) 




;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;C/C++设定;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;缩进策略
(defun my-indent-or-complete ()
(interactive)
(if (looking-at "\\>")
(hippie-expand nil)
(indent-for-tab-command)))
;;按键定义
(define-key c-mode-base-map [(return)] 'newline-and-indent) 
(define-key c-mode-base-map [(meta \`)] 'c-indent-command)


;;能把一个代码块缩起来,需要的时候再展开
;;  M-x     hs-minor-mode
;;  C-c @ ESC C-s    show all
;;  C-c @ ESC C-h    hide all
;;  C-c @ C-s        show block
;;  C-c @ C-h        hide block
;;  C-c @ C-c toggle hide/show


(load-library "hideshow")
(add-hook 'c-mode-hook 'hs-minor-mode)
(add-hook 'c++-mode-hook 'hs-minor-mode)
(add-hook 'java-mode-hook 'hs-minor-mode)
(add-hook 'emacs-lisp-mode-hook 'hs-minor-mode)
(add-hook 'lisp-mode-hook 'hs-minor-mode)
(add-hook 'scheme-mode-hook 'hs-minor-mode)
(add-hook 'css-mode-hook 'hs-minor-mode)
(add-hook 'html-mode-hook 'hs-minor-mode)
(global-set-key (kbd "C-c C-:") 'hs-show-all);;显示
(global-set-key (kbd "C-c C-\"") 'hs-hide-all);;隐藏


;;输入左边的括号,就会自动补全右边的部分.包括(), "", [] , {} , 等等。
(defun my-common-mode-auto-pair ()
(interactive)
(make-local-variable 'skeleton-pair-alist)
(setq skeleton-pair-alist  '(
(? ? _ "''")
(? ? _ """")
(? ?  _ "()")
(? ?  _ "[]")
(?{ \n > _ \n ?} >)))
(setq skeleton-pair t)
(local-set-key (kbd "(") 'skeleton-pair-insert-maybe)
(local-set-key (kbd "\"") 'skeleton-pair-insert-maybe)
(local-set-key (kbd "{") 'skeleton-pair-insert-maybe)
(local-set-key (kbd "\'") 'skeleton-pair-insert-maybe)
(local-set-key (kbd "[") 'skeleton-pair-insert-maybe))
(add-hook 'c-mode-hook 'my-common-mode-auto-pair)
(add-hook 'c++-mode-hook 'my-common-mode-auto-pair)
(add-hook 'java-mode-hook 'my-common-mode-auto-pair)
(add-hook 'lisp-mode-hook 'my-common-mode-auto-pair)
(add-hook 'php-mode-hook 'my-common-mode-auto-pair)
(add-hook 'python-mode-hook 'my-common-mode-auto-pair)
(add-hook 'html-mode-hook 'my-common-mode-auto-pair)
(add-hook 'scheme-mode-hook 'my-common-mode-auto-pair)
(add-hook 'css-mode-hook 'my-common-mode-auto-pair)
(add-hook 'sql-mode-hook 'my-common-mode-auto-pair)
(add-hook 'emacs-lisp-mode-hook 'my-common-mode-auto-pair)
(add-hook 'text-mode-hook 'my-common-mode-auto-pair)


(setq x-select-enable-clipboard t);支持emacs和外部程序的粘贴
(setq frame-title-format '("Emacs@ " buffer-file-name " " ));在标题栏显示buffer名称


;;ido的配置,这个可以使你在用C-x C-f打开文件的时候在后面有提示;
;;这里是直接打开了ido的支持,在emacs23中这个是自带的.
(ido-mode t)
(setq visible-bell t)
;;设置 sentence-end 可以识别中文标点。不用在 fill 时在句号后插入两个空格。
(setq sentence-end "\\([。!?]\\|……\\|[.?!][]\"')}]*\\($\\|[ \t]\\)\\)[ \t\n]*")
(setq sentence-end-double-space nil)
;;可以递归的使用 minibuffer
(setq enable-recursive-minibuffers t)
;;设置个人信息
(setq user-full-name "B.Qnyd")
(setq user-mail-address "BB.Qnyd@gmail.com")
(setq track-eol t);; 当光标在行尾上下移动的时候,始终保持在行尾。
(setq Man-notify-method 'pushy);; 当浏览 man page 时,直接跳转到 man buffer。


;;设置home键指向buffer开头,end键指向buffer结尾
;;(global-set-key [home] 'beginning-of-buffer)
;;(global-set-key [end] 'end-of-buffer)
(setq default-fill-column 80);;把 fill-column 设为 80. 这样的文字更好读


;; 实现程序变量得自动对齐
(require 'align)
(global-set-key "\C-x\C-j" 'align)


;鼠标滚轮,默认的滚动太快,这里改为3行
(defun up-slightly () (interactive) (scroll-up 1))
(defun down-slightly () (interactive) (scroll-down 1))
(global-set-key [mouse-4] 'down-slightly)
(global-set-key [mouse-5] 'up-slightly)
(add-to-list 'load-path "/usr/share/emacs/site-lisp/xcscope.el")
;;(add-to-list 'load-path "~/lisp/cscope/contrib/xcscope/xcscope.el")
(require 'xcscope)


;; iimage mode
(autoload 'iimage-mode "iimage" "Support Inline image minor mode." t)
(autoload 'turn-on-iimage-mode "iimage" "Turn on Inline image minor mode." t)
(defun org-toggle-iimage-in-org ()
  "display images in your org file"
  (interactive)
  (if (face-underline-p 'org-link)
      (set-face-underline-p 'org-link nil)
      (set-face-underline-p 'org-link t))

  (iimage-mode))


; 将下列文件拷贝到 /usr/bin 目录里,命名为 iimage.el

;;; iimage.el --- Inline image minor mode.


;; Copyright (C) 2004 Free Software Foundation


;; Author: KOSEKI Yoshinori <kose@meadowy.org>
;; Maintainer: KOSEKI Yoshinori <kose@meadowy.org>
;; Keywords: multimedia


;; This file is part of GNU Emacs.


;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.


;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.


;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING.  If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.


;;; Commentary:


;; Iimage is a minor mode that displays images, when image-filename
;; exists in the buffer.
;; http://www.netlaputa.ne.jp/~kose/Emacs/iimage.html
;;
;; Add to your `~/.emacs':
;; (autoload 'iimage-mode "iimage" "Support Inline image minor mode." t)
;; (autoload 'turn-on-iimage-mode "iimage" "Turn on Inline image minor mode." t)
;;
;; ** Display images in *Info* buffer.
;;
;; (add-hook 'info-mode-hook 'turn-on-iimage-mode)
;;
;; .texinfo:   @file{file://foo.png}
;; .info:      `file://foo.png'
;;
;; ** Display images in Wiki buffer.
;;
;; (add-hook 'wiki-mode-hook 'turn-on-iimage-mode)
;;
;; wiki-file:   [[foo.png]]


;;; Code:


(eval-when-compile
  (require 'image-file))


(defconst iimage-version "1.1")
(defvar iimage-mode nil)
(defvar iimage-mode-map nil)


;; Set up key map.
(unless iimage-mode-map
  (setq iimage-mode-map (make-sparse-keymap))
  (define-key iimage-mode-map "\C-l" 'iimage-recenter))


(defun iimage-recenter (&optional arg)
"Re-draw images and recenter."
  (interactive "P")
  (iimage-mode-buffer 0)
  (iimage-mode-buffer 1)
  (recenter arg))


(defvar iimage-mode-image-filename-regex
  (concat "[-+./_0-9a-zA-Z]+\\."
 (regexp-opt (nconc (mapcar #'upcase
    image-file-name-extensions)
    image-file-name-extensions)
     t)))


(defvar iimage-mode-image-regex-alist
  `((,(concat "\\(`?file://\\|\\[\\[\\|<\\|`\\)?"
     "\\(" iimage-mode-image-filename-regex "\\)"
     "\\(\\]\\]\\|>\\|'\\)?") . 2))
"*Alist of filename REGEXP vs NUM.
Each element looks like (REGEXP . NUM).
NUM specifies which parenthesized expression in the regexp.


image filename regex exsamples:
    file://foo.png
    `file://foo.png'
    \\[\\[foo.gif]]
    <foo.png>
     foo.JPG
")


(defvar iimage-mode-image-search-path nil
"*List of directories to search for image files for iimage-mode.")


;;;###autoload
(defun turn-on-iimage-mode ()
"Unconditionally turn on iimage mode."
  (interactive)
  (iimage-mode 1))


(defun turn-off-iimage-mode ()
"Unconditionally turn off iimage mode."
  (interactive)
  (iimage-mode 0))


;; Emacs21.3 or earlier does not heve locate-file.
(if (fboundp 'locate-file)
    (defalias 'iimage-locate-file 'locate-file)
  (defun iimage-locate-file (filename path)
    (locate-library filename t path)))


(defun iimage-mode-buffer (arg)
"Display/Undisplay Images.
With numeric ARG, display the images if and only if ARG is positive."
  (interactive)
  (let ((ing (if (numberp arg)
(> arg 0)
      iimage-mode))
(modp (buffer-modified-p (current-buffer)))
file buffer-read-only)
    (save-excursion
      (goto-char (point-min))
      (dolist (pair iimage-mode-image-regex-alist)
(while (re-search-forward (car pair) nil t)
 (if (and (setq file (match-string (cdr pair)))
  (setq file (iimage-locate-file file
  (cons default-directory
iimage-mode-image-search-path))))
     (if ing
 (add-text-properties (match-beginning 0) (match-end 0)
      (list 'display (create-image file)))
(remove-text-properties (match-beginning 0) (match-end 0)
'(display)))))))
    (set-buffer-modified-p modp)))


;;;###autoload
(define-minor-mode iimage-mode
  "Toggle inline image minor mode."
  nil " iImg" iimage-mode-map
  (run-hooks 'iimage-mode-hook)
  (iimage-mode-buffer iimage-mode))


(provide 'iimage)


;;; arch-tag: f6f8e29a-08f6-4a12-9496-51e67441ce65
;;; iimage.el ends here



;;-------------------------------------------------------------------------------------------

;; 图形引人 格式如下:

* hello
** 1hello
*** hello2
[[foo.gif]]
[[nueq082.gif]]




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值