Radian 项目安装与配置指南
1. 项目基础介绍
Radian 是一套旨在结合优雅与实用的 dotfiles(即配置文件),它主要针对 Emacs 编辑器进行配置优化。这套配置文件的目标是采用最佳实践,提供详尽的代码注释,保持代码简洁性的同时最大化可用性,并支持本地配置而无需对仓库进行分叉。
主要编程语言: Emacs Lisp (Elisp)
2. 项目使用的关键技术和框架
- straight.el:下一代 Emacs 包管理器,用于管理和安装 Emacs 包。
- use-package:用于简洁和干燥(DRY)的包自定义。
- Vertico:提供简洁且少 bug 的文件和命令选择界面。
- CTRLF:提供比 Isearch 和 Swiper 更强大的单缓冲文本搜索功能。
- prescient.el:对所有命令使用 frecency 和使用情况进行排序。
- lsp-mode:集成语言服务器协议(LSP),支持多种编程语言的 IDE 功能。
- Apheleia:自动异步代码格式化,无需移动光标。
- Magit:Emacs 中的 Git 客户端。
- Projectile:项目管理工具。
- Smartparens:智能括号管理。
3. 项目安装和配置准备工作
在开始安装之前,请确保您的系统中已经安装了以下软件:
- Emacs(版本至少为 27.1)
- Python(用于某些包的安装和配置)
- Zsh(推荐 shell 环境)
- Tmux(终端复用器)
- Git(版本控制系统)
对于不同的操作系统,安装上述软件的方式如下:
macOS
使用 Homebrew 安装:
brew install emacs
brew install python
brew install zsh
brew install tmux
brew install git
Ubuntu/Debian
使用 apt-get 安装:
sudo apt-get install emacs
sudo apt-get install python3
sudo apt-get install zsh
sudo apt-get install tmux
sudo apt-get install git
Arch/Manjaro Linux
使用 pacman 安装:
sudo pacman -S emacs
sudo pacman -S python
sudo pacman -S zsh
sudo pacman -S tmux
sudo pacman -S git
详细的安装步骤
-
克隆仓库
首先,使用 Git 克隆 Radian 仓库到本地:
git clone https://github.com/radian-software/radian.git
-
配置符号链接
将配置文件链接到相应的用户目录:
ln -s ~/radian/emacs/init.el ~/.emacs.d/init.el ln -s ~/radian/emacs/early-init.el ~/.emacs.d/early-init.el ln -s ~/radian/emacs/versions.el ~/.emacs.d/straight/versions/radian.el ln -s ~/radian/git/.gitconfig ~/.gitconfig ln -s ~/radian/git/.gitexclude ~/.gitexclude ln -s ~/radian/shell/shared/.profile ~/.profile ln -s ~/radian/shell/zsh/.zshrc ~/.zshrc ln -s ~/radian/shell/zsh/.zprofile ~/.zprofile ln -s ~/radian/tmux/.tmux.conf ~/.tmux.conf
-
创建本地配置文件
在用户目录下创建本地配置文件:
- 对于 Emacs:
~/.emacs.d/init.local.el
- 对于所有 shell:
~/.profile.local
- 对于 Zsh:
~/.zshrc.local
- 对于 Tmux:
~/.tmux.local.conf
- 对于 Git:
~/.gitconfig.local
根据个人需求编辑这些文件,以覆盖默认设置或添加自定义配置。
- 对于 Emacs:
-
重启 Emacs 和 Shell
为了让配置生效,重启 Emacs 编辑器和你的 shell 环境。
emacs --kill exec zsh
完成以上步骤后,Radian 的配置就基本完成了。现在你可以享受 Radian 带来的优化过的编辑体验了。
创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考