代码拉取完成,页面将自动刷新
优化编辑体验,与编辑器本身。
(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
)
(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
)
(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))
(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)
)
(use-package smartparens-config
:ensure smartparens
:config (smartparens-global-mode)
)
(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 属于编辑相关
(use-package org-superstar
:ensure t
:diminish
:hook (org-mode . org-superstar-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)))
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。