Spacemacs Workshop | 高效可定制多功能的文本编辑

学术   2024-05-21 11:34   上海  


~Spacemacs Workshop~


NEW CHAT

+

为什么要用Emacs?


Why Emacs?


Emacs 是一个高度可定制且多功能的文本编辑器,可以极大地提高工作效率。


Emacs is a highly customizable and versatile text editor that can greatly enhance productivity.

但听说Emacs 相当难学啊...


But I've heard that Emacs is quite difficult

to learn...


确实,Emacs 的学习曲线较陡,但使用 Spacemacs 可以大大简化这个过程。Spacemacs 是一个结合了 Emacs 和 Vim 优点的配置,可以让你更容易上手。

Indeed, Emacs has a steep learning curve, but using Spacemacs can greatly simplify the process. Spacemacs is a configuration that combines the best of Emacs and Vim, making it much easier to get started.



Location:

Longbing Building 325 

Time:

24 May 18:00-20:00




Host

Wentao He 



Contents

Basics of Spacemacs 







扔掉你的鼠标,

删除你的VSCode,

投入Spacemacs的怀抱吧!


Throw away your mouse, delete your VSCode,

and dive into Spacemacs!













Part 01

    所以什么是 Spacemacs? 




Spacemacs 是一个基于 Emacs 的配置,并结合了 Emacs 和 Vim 的各自优点。Emacs 常用的快捷键组合通常是功能键 + 字母,这种操作方式会让你的手指受不了……而 Spacemacs 的第一个按键是Leader 键(vim风格的快捷键配置思路),左右手都能轻松操作。


Spacemacs is a configuration framework for Emacs that combines the best of both Emacs and Vim. Emacs typically uses key combinations of modifier keys and letters, which can be strenuous on your fingers. In contrast, Spacemacs uses the Leader key (inspired by Vim-style keybinding concepts) as the initial key, making it easy to operate with both hands.


而且,Spacemacs 是以 layer 的形式配置包,它可以预先帮你安装好 layers,也可以一键安装所需的 layers,让你轻松获得强大的功能扩展。这些 layers 包含了各种编程语言支持、版本控制集成、项目管理工具等,使得 Spacemacs 开箱即用,满足不同开发需求。你只需简单配置,就能享受到高度自定义和扩展的编辑环境。


Additionally, Spacemacs configures packages in the form of layers. It can pre-install layers for you or allow you to install the required layers with a single command, giving you powerful functionality with ease. These layers include support for various programming languages, version control integration, project management tools, and more, making Spacemacs ready to use out of the box and meeting different development needs. With simple configurations, you can enjoy a highly customizable and extensible editing environment.




Part 02

Spacemacs 的好处 




1. Vim 用户的福音:Vim 用户可以享受熟悉的模式编辑,同时借助 Emacs 的可扩展性和强大功能。


2. 即装即用:Spacemacs 安装后即可使用,包含了市面上常见编辑器的所有基本功能,并预装了许多有用的插件和工具,相比于原生 Emacs 需要大量配置才能达到理想状态,Spacemacs 大大减少了初始配置的时间和精力。


3. 持续更新:Spacemacs 拥有一个活跃的社区,持续更新和维护,使其始终处于现代开发工具的前沿。


4. 丰富资源:由于 Spacemacs 基于 Emacs,社区贡献了大量的插件和配置,用户可以轻松获取和使用。Spacemacs 提供了一些与文本编辑无关的插件,如用于 Git 集成的 Magit、用于编辑目录的 Dired、用于在 Emacs 内运行应用程序的 EAF(Emacs Application Framework),以及用于处理电子邮件的 Mu4e。


5. 跨平台兼容:Spacemacs 可以在 Windows、macOS 和 Linux 上无缝运行,适应不同操作系统的开发者需求。


6.几乎是一个完整的操作系统:除了文本编辑外,Spacemacs 还可以处理许多其他任务,例如发送电子邮件、听音乐、浏览网页,甚至还可以煮咖啡呢。



1. A Blessing for Vim Users: Vim users can enjoy the familiar modal editing while leveraging Emacs' extensibility and powerful features.


2. Ready to Use Out of the Box: Spacemacs is ready to use right after installation, with all the basic features of popular editors and many useful plugins and tools pre-installed. Compared to vanilla Emacs, which require extensive configuration to reach an ideal state, Spacemacs significantly reduces the time and effort needed for initial setup.


3. Continuous Updates: Spacemacs has an active community that continuously updates and maintains it, keeping it at the forefront of modern development tools.


4. Rich Resources: Since Spacemacs is based on Emacs, the community has contributed a large number of plugins and configurations that users can easily access and use. Spacemacs provides some non-text-editing plugins such as Magit for Git integration, Dired for directory editing, EAF (Emacs Application Framework) for running applications within Emacs, and Mu4e for handling emails.


5. Cross-Platform Compatibility: Spacemacs runs seamlessly on Windows, macOS, and Linux, catering to the needs of developers on different operating systems.


6.Almost a Complete Operating System: Besides text editing, Spacemacs can handle many other tasks, such as sending emails, listening to music, browsing the web, and it can even make coffee.



Part 03

    Spacemacs 启动!!



Spacemacs 官网: spacemacs.org



安装非常简单,只需克隆其 Git 库并将其用作 Emacs 的配置目录即可。按照官网的步骤操作如下:


Installation is very simple; just clone its Git repository and use it as the Emacs configuration directory. Follow the steps from the official website as follows:

首先,你需要在你的系统上安装 Emacs。

First, you need to install Emacs on your system.


Windows: 通过 git 安装, 如果你的系统安装了 git,打开 PowerShell,然后执行下面这条命令来安装 Spacemacs:


If you have Git installed on your system, open PowerShell and execute the following command to install Spacemacs:

git clone https://github.com/syl20bnr/spacemacs $home/.emacs.d

因为要从 GitHub 下载,速度会有点慢。速度太慢的话,可以从 CodeChina 的镜像进行安装:


Since it needs to be downloaded from GitHub, the speed might be a bit slow. If it's too slow, you can install it from the CodeChina mirror:

git clone https://codechina.csdn.net/mirrors/syl20bnr/spacemacs/-/tree/develop.git $home/.emacs.d

如果没有安装 git,需要手动安装:在 Spacemacs 的 GitHub 仓库下载 Spacemacs 的源码压缩包,下载完成后解压缩并将文件夹命名为.emacs.d,然后放置到主目录下即可。


If Git is not installed, you need to install it manually: Download the source code zip file from the Spacemacs GitHub repository, extract it, rename the folder to `.emacs.d`, and place it in your home directory.


https://github.com/syl20bnr/spacemacs#install-spacemacs-in-windows


Linux, macOS: Linux 和 macOS 通常都默认安装了 git,打开终端,然后执行下面这条命令来安装:


Linux and macOS usually have Git installed by default. Open a terminal and execute the following command to install Spacemacs:

git clone https://github.com/syl20bnr/spacemacs ~/.emacs.d

速度太慢的话,亦可从 CodeChina 的镜像进行安装:


If the speed is too slow, you can also install it from the CodeChina mirror:

git clone https://codechina.csdn.net/mirrors/syl20bnr/spacemacs/-/tree/develop.git ~/.emacs.d




第一次启动 Spacemacs


安装完 Spacemacs 之后,启动 Emacs 就会自动下载packages 了,启动 Emacs 时,它会问你想要使用那种编辑模式 vim(默认)或是 emacs,根据自己的喜好选择好之后回车即可,接着会询问你是想安装标准版的 Spacemacs(默认) 还是精简版的 Spacemacs-base,同样自己选择之后回车即可。


After installing Spacemacs, launching Emacs will automatically download the packages. When you start Emacs, it will ask you which editing style you want to use: Vim (default) or Emacs. Choose according to your preference and press Enter. Next, it will ask whether you want to install the standard version of Spacemacs (default) or the minimal Spacemacs-base version. Make your choice and press Enter.


可以开始使用香喷喷的 Spacemacs 啦!!


想知道更多的就来workshop吧!! :D




特别鸣谢:

讲解:何文韬

推送:苏启坚



JIers
For JIers\x26#39; brighter future. 上海交通大学密院学生会公众平台。秉持着文化为基,能力驱动,联通谋合的理念,我们立志成为一个长期服务于密院学子需求、致力于促进密院学子全面发展的热爱驱动型学生组织。
 最新文章