当前仓库属于关闭状态,部分功能使用受限,详情请查阅 仓库状态说明
1 Star 1 Fork 0

Gemo / emacs 配置文件
关闭

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
editor.org 5.91 KB
一键复制 编辑 原始数据 按行查看 历史
Gemo 提交于 2020-10-10 17:21 . divided done

Editor 编辑器相关

优化编辑体验,与编辑器本身。

Edit 编辑相关

ace window 窗口管理

(use-package ace-window
  :ensure t
  :custom-face (aw-leading-char-face ((t (:inherit ace-jump-face-foreground :height 3.0))))
  :bind (("C-x o" . other-window)
	   ([remap other-window] . ace-window))
  :config
  (setq aw-scope 'frame) ;; was global
  )

auto save 自动保存

(use-package auto-save
  :quelpa (auto-save
	     :fetcher gmirror
	     :repo "manateelazycat/auto-save")
  :config
  (auto-save-enable)
  (setq auto-save-silent t)   ; quietly save
  (setq auto-save-delete-trailing-whitespace t)  ; automatically delete spaces at the end of the line when saving
  )

recentf

(use-package recentf
  :ensure t
  :hook (after-init . recentf-mode)
  :custom
  (recentf-max-menu-item 10)
  (recentf-max-saved-items 1024)
  (recentf-exclude '("/tmp/" "/ssh:")))

快速删除

(use-package hungry-delete
  :homepage https://github.com/nflath/hungry-delete
  :about  Enables hungry deletion in all modes.
  :ensure t
  :init
  (global-hungry-delete-mode))

expand-region

(use-package expand-region
  :homepage https://github.com/magnars/expand-region.el
  :about Emacs extension to increase selected region by semantic units.
  :quelpa (expand-region
	     :fetcher gmirror
	     :repo "magnars/expand-region.el")
  :bind
  ("C-c =" . er/expand-region)
  )

smartparens 空格自动补全

(use-package smartparens-config
  :ensure smartparens
  :config (smartparens-global-mode)
  )

symbol-overlay

(use-package symbol-overlay
  :homepage https://github.com/wolray/symbol-overlay
  :ensure t
  :bind (
	   ("M-i" . symbol-overlay-put)
	   ("M-I" . symbol-overlay-remove-all)
	   ("M-n" . symbol-overlay-jump-next)
	   ("M-p" . symbol-overlay-jump-prev)
	   ("M-g r" . symbol-overlay-rename)
	   ("M-g q" . symbol-overlay-query-replace))
  :hook
  (after-init . symbol-overlay-mode)
  )

Org mode

Org Mode 属于编辑相关

(use-package org-superstar
  :ensure t
  :diminish
  :hook (org-mode . org-superstar-mode))

Markdown mode

需要安装 grip

sudo emerge -a app-text/grip
 (use-package markdown-mode
   :ensure t
   :mode (("README\\.md\\'" . gfm-mode))
   :init
   (setq markdown-enable-wiki-links t
	  markdown-italic-underscore t
	  markdown-asymmetric-header t
	  markdown-make-gfm-checkboxes-buttons t
	  markdown-gfm-uppercase-checkbox t
	  markdown-fontify-code-blocks-natively t

	  markdown-content-type "application/xhtml+xml"
	  markdown-css-paths '("https://cdn.jsdelivr.net/npm/github-markdown-css/github-markdown.min.css"
			       "https://cdn.jsdelivr.net/gh/highlightjs/cdn-release/build/styles/github.min.css")
	  markdown-xhtml-header-content "
 <meta name='viewport' content='width=device-width, initial-scale=1, shrink-to-fit=no'>
 <style>
 body {
   box-sizing: border-box;
   max-width: 740px;
   width: 100%;
   margin: 40px auto;
   padding: 0 10px;
 }
 </style>
 <link rel='stylesheet' href='https://cdn.jsdelivr.net/gh/highlightjs/cdn-release/build/styles/default.min.css'>
 <script src='https://cdn.jsdelivr.net/gh/highlightjs/cdn-release/build/highlight.min.js'></script>
 <script>
 document.addEventListener('DOMContentLoaded', () => {
   document.body.classList.add('markdown-body');
   document.querySelectorAll('pre code').forEach((code) => {
     if (code.className != 'mermaid') {
	hljs.highlightBlock(code);
     }
   });
 });
 </script>
 <script src='https://unpkg.com/mermaid@8.4.8/dist/mermaid.min.js'></script>
 <script>
 mermaid.initialize({
   theme: 'default',  // default, forest, dark, neutral
   startOnLoad: true
 });
 </script>
 "
	  markdown-gfm-additional-languages "Mermaid")

   ;; `multimarkdown' is necessary for `highlight.js' and `mermaid.js'
   (when (executable-find "multimarkdown")
     (setq markdown-command "multimarkdown"))

   ;; Use `which-key' instead
   (with-no-warnings
     (advice-add #'markdown--command-map-prompt :override #'ignore)
     (advice-add #'markdown--style-map-prompt   :override #'ignore))
   :config
   (add-to-list 'markdown-code-lang-modes '("mermaid" . mermaid-mode))

   ;; Preview with built-in webkit
   (with-no-warnings
     (defun my-markdown-export-and-preview (fn)
	"Preview with `xwidget' if applicable, otherwise with the default browser."
	(if (featurep 'xwidget-internal)
	    (progn
	      (xwidget-webkit-browse-url (concat "file://" (markdown-export)))
	      (let ((buf (xwidget-buffer (xwidget-webkit-current-session))))
		(when (buffer-live-p buf)
		  (and (eq buf (current-buffer)) (quit-window))
		  (pop-to-buffer buf))))
	  (funcall fn)))
     (advice-add #'markdown-export-and-preview :around #'my-markdown-export-and-preview))

   )
 ;; Preview via `grip'
 ;; Install: pip install grip
 (use-package grip-mode
   :ensure t
   :bind (:map markdown-mode-command-map
		("g" . grip-mode))
   :init
   (setq grip-update-after-change nil)
   (when-let ((credential (auth-source-user-and-password "api.github.com")))
     (setq grip-github-user (car credential)
	    grip-github-password (cadr credential))))

 ;; Table of contents
 (use-package markdown-toc
   :ensure t
   :bind (:map markdown-mode-command-map
		("r" . markdown-toc-generate-or-refresh-toc)))
Emacs Lisp
1
https://gitee.com/gemone/emacs.d.git
git@gitee.com:gemone/emacs.d.git
gemone
emacs.d
emacs 配置文件
master

搜索帮助