org-modern-indent 使用教程

org-modern-indent 使用教程

org-modern-indent modern block styling with org-indent org-modern-indent 项目地址: https://gitcode.com/gh_mirrors/or/org-modern-indent

1. 项目介绍

org-modern-indent 是一个基于 Emacs 的开源项目,旨在为使用 org-mode 和 org-indent 的用户提供现代化的代码块样式。当启用 org-indent 时,默认的 org-mode 代码块样式(例如源代码块、示例块)的装饰会被禁用。这个包通过模拟 org-modern 的代码块样式,使得用户在使用 org-indent 时也能享受到 org-modern 的整洁高效样式。它可以在不使用 org-modern 的情况下单独使用,并且支持在列表中嵌套的“批量缩进”代码块。

2. 项目快速启动

首先,确保你已经安装了 Emacs 和 org-mode。

; 添加 org-modern-indent 到你的 Emacs 配置中
(use-package org-modern-indent
  :load-path "~/code/emacs/org-modern-indent/")
; 或者使用 straight.el
(straight (org-modern-indent :type git :host github :repo "jdtsmith/org-modern-indent"))

; 将 org-modern-indent 模式添加到 org-mode 钩子中
(add-hook 'org-mode-hook #'(lambda () (org-modern-indent-mode 1)))

为了在所有 org 文件中默认启用 org-indent,你还需要设置:

(setq org-startup-indented t)

3. 应用案例和最佳实践

代码块样式

使用 org-modern-indent 后,你的 org 文件中的代码块将拥有现代化的样式。例如:

#+begin_src emacs-lisp
(message "Hello, World!")
#+end_src

在列表中使用代码块

在列表项中嵌套代码块时,确保开始标记 #+begin 与列表文本对齐:

- 这是一个列表项,它包含了一个代码块:
  #+begin_src emacs-lisp
  (message "Hello, List!")
  #+end_src

修改样式

如果你想要自定义代码块的样式,可以通过修改 org-modern-indent-bracket-line 面来实现。

(set-face-attribute 'org-modern-indent-bracket-line nil :family "Hack" :height 1.0)

4. 典型生态项目

org-modern-indent 是 org-mode 生态系统的一部分,以下是一些相关的项目:

  • org-modern: 一个现代化的 org-mode 样式包。
  • org-bullets: 使用 Unicode 符号替换标题和列表项的默认星号。
  • org-superstar: 美化标题和普通列表的外观。

通过结合这些项目,你可以进一步定制和改善你的 org-mode 体验。

org-modern-indent modern block styling with org-indent org-modern-indent 项目地址: https://gitcode.com/gh_mirrors/or/org-modern-indent

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

贾霓立Delightful

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值