1 Star 0 Fork 2

zhengchen/emacs

forked from latpaw/emacs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
init-org.el 5.40 KB
一键复制 编辑 原始数据 按行查看 历史
redguardtoo 提交于 2013-06-13 15:33 . donot auto-indent under org-mode
(define-key global-map "\C-cl" 'org-store-link)
(define-key global-map "\C-ca" 'org-agenda)
;; {{ export org-mode in Chinese into PDF
;; @see http://freizl.github.io/posts/tech/2012-04-06-export-orgmode-file-in-Chinese.html
;; and you need install texlive-xetex on different platforms
;; To install texlive-xetex:
;; `sudo USE="cjk" emerge texlive-xetex` on Gentoo Linux
(setq org-latex-to-pdf-process
'("xelatex -interaction nonstopmode -output-directory %o %f"
"xelatex -interaction nonstopmode -output-directory %o %f"
"xelatex -interaction nonstopmode -output-directory %o %f"))
;; }}
(if *is-a-mac*
; make soffice visible when converting odt to doc
(setenv "PATH" (concat (getenv "PATH") "/Applications/LibreOffice.app/Contents/MacOS"))
)
;; Various preferences
(setq org-log-done t
org-completion-use-ido t
org-edit-src-content-indentation 0
org-edit-timestamp-down-means-later t
org-agenda-start-on-weekday nil
org-agenda-span 14
org-agenda-include-diary t
org-agenda-window-setup 'current-window
org-fast-tag-selection-single-key 'expert
org-export-kill-product-buffer-when-displayed t
org-export-odt-preferred-output-format "doc"
org-tags-column 80
;org-startup-indented t
)
; Refile targets include this file and any file contributing to the agenda - up to 5 levels deep
(setq org-refile-targets (quote ((nil :maxlevel . 5) (org-agenda-files :maxlevel . 5))))
; Targets start with the file name - allows creating level 1 tasks
(setq org-refile-use-outline-path (quote file))
; Targets complete in steps so we start with filename, TAB shows the next level of targets etc
(setq org-outline-path-complete-in-steps t)
(setq org-todo-keywords
(quote ((sequence "TODO(t)" "STARTED(s)" "|" "DONE(d!/!)")
(sequence "WAITING(w@/!)" "SOMEDAY(S)" "PROJECT(P@)" "|" "CANCELLED(c@/!)"))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Org clock
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Save the running clock and all clock history when exiting Emacs, load it on startup
;; @see http://orgmode.org/manual/Clocking-work-time.html
(org-clock-persistence-insinuate)
(setq org-clock-persist 'history)
(setq org-clock-in-resume t)
;; Change task state to STARTED when clocking in
(setq org-clock-in-switch-to-state "STARTED")
;; Save clock data and notes in the LOGBOOK drawer
(setq org-clock-into-drawer t)
;; Removes clocked tasks with 0:00 duration
(setq org-clock-out-remove-zero-time-clocks t)
;; Show the clocked-in task - if any - in the header line
(defun sanityinc/show-org-clock-in-header-line ()
(setq-default header-line-format '((" " org-mode-line-string " "))))
(defun sanityinc/hide-org-clock-from-header-line ()
(setq-default header-line-format nil))
(add-hook 'org-clock-in-hook 'sanityinc/show-org-clock-in-header-line)
(add-hook 'org-clock-out-hook 'sanityinc/hide-org-clock-from-header-line)
(add-hook 'org-clock-cancel-hook 'sanityinc/hide-org-clock-from-header-line)
(eval-after-load 'org-clock
'(progn
(define-key org-clock-mode-line-map [header-line mouse-2] 'org-clock-goto)
(define-key org-clock-mode-line-map [header-line mouse-1] 'org-clock-menu)))
;; ;; Show iCal calendars in the org agenda
;; (when *is-a-mac*
;; (eval-after-load "org"
;; '(if *is-a-mac* (require 'org-mac-iCal)))
;; (setq org-agenda-include-diary t)
;;
;; (setq org-agenda-custom-commands
;; '(("I" "Import diary from iCal" agenda ""
;; ((org-agenda-mode-hook
;; (lambda ()
;; (org-mac-iCal)))))))
;;
;; (add-hook 'org-agenda-cleanup-fancy-diary-hook
;; (lambda ()
;; (goto-char (point-min))
;; (save-excursion
;; (while (re-search-forward "^[a-z]" nil t)
;; (goto-char (match-beginning 0))
;; (insert "0:00-24:00 ")))
;; (while (re-search-forward "^ [a-z]" nil t)
;; (goto-char (match-beginning 0))
;; (save-excursion
;; (re-search-backward "^[0-9]+:[0-9]+-[0-9]+:[0-9]+ " nil t))
;; (insert (match-string 0)))))
;; )
(eval-after-load 'org
'(progn
(require 'org-exp)
(require 'org-clock)
; @see http://irreal.org/blog/?p=671
(setq org-src-fontify-natively t)
;;(require 'org-checklist)
(require 'org-fstree)
(setq org-ditaa-jar-path (format "%s%s" (if *cygwin* "c:/cygwin" "")
(expand-file-name "~/.emacs.d/elpa/contrib/scripts/ditaa.jar")) )
(defun soft-wrap-lines ()
"Make lines wrap at window edge and on word boundary,
in current buffer."
(interactive)
(setq truncate-lines nil)
(setq word-wrap t)
)
(add-hook 'org-mode-hook '(lambda ()
(setq evil-auto-indent nil)
(soft-wrap-lines)
))))
(defadvice org-open-at-point (around org-open-at-point-choose-browser activate)
(let ((browse-url-browser-function
(cond ((equal (ad-get-arg 0) '(4))
'browse-url-generic)
((equal (ad-get-arg 0) '(16))
'choose-browser)
(t
(lambda (url &optional new)
(w3m-browse-url url t))))))
ad-do-it))
(provide 'init-org)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/cowboy13/emacs.git
git@gitee.com:cowboy13/emacs.git
cowboy13
emacs
emacs
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385