惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Security Archives - TechRepublic
Security Archives - TechRepublic
Project Zero
Project Zero
K
Kaspersky official blog
G
Google Developers Blog
T
Threat Research - Cisco Blogs
T
The Blog of Author Tim Ferriss
Cyberwarzone
Cyberwarzone
Y
Y Combinator Blog
Recorded Future
Recorded Future
Blog — PlanetScale
Blog — PlanetScale
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Cisco Talos Blog
Cisco Talos Blog
Latest news
Latest news
Microsoft Security Blog
Microsoft Security Blog
H
Help Net Security
S
Schneier on Security
P
Palo Alto Networks Blog
H
Hacker News: Front Page
N
News and Events Feed by Topic
N
Netflix TechBlog - Medium
博客园 - Franky
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
SecWiki News
SecWiki News
Cloudbric
Cloudbric
TaoSecurity Blog
TaoSecurity Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
The Hacker News
The Hacker News
C
Check Point Blog
L
LangChain Blog
腾讯CDC
小众软件
小众软件
T
Tenable Blog
Google DeepMind News
Google DeepMind News
GbyAI
GbyAI
L
LINUX DO - 最新话题
A
About on SuperTechFans
Google Online Security Blog
Google Online Security Blog
C
Cisco Blogs
Recent Announcements
Recent Announcements
Hacker News: Ask HN
Hacker News: Ask HN
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Vercel News
Vercel News
雷峰网
雷峰网
美团技术团队
D
DataBreaches.Net
Martin Fowler
Martin Fowler
Help Net Security
Help Net Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
F
Full Disclosure
博客园_首页

iTimothy

那些让人笑出声的Meme排序算法 再谈费曼学习法 第一性原理读书笔记 我的2025 AWS Certified Developer Associate 认证备考指北 我的 AWS Certified Machine Learning – Specialty 认证之旅 2024年的年终总结:转变与沉淀 迟来的2023年终总结 The Heap Sort Algorithm Explained Modern C++ 学习笔记 -- 左值与右值 告别2022 客制化键盘初体验 RAMA WORKS KARA 聊聊被动收入与躺赚 新加坡驾照转换指北 利用GitHub Actions实现版本自动构建与发布流程 逝去的2021 使用Caddy2托管静态博客 美股期权投资策略学习笔记--期权的基本概念 我的2020 CKAD认证备考经验分享
Emacs启动加速篇
Timothy · 2020-06-18 · via iTimothy

Emacs虽然强大,但是其作为一个伪装成编辑器的”操作系统”,在启动耗时方面是广大Emacs用户的痛点。虽然现在用上Doom Emacs,比起Spacemacs启动要快了不少。在公司开发用的MBP上(内存16GB,i7 6核CPU, 500GB SSD),单次启动加载完所有插件大概需要4秒多的时间。

恰巧最近又买了个德国的高配置VPS,访问速度还不错。于是心血来潮,在上面折腾了开发环境,还装了Doom Emacs,打算实现用任何一台低配置的瘦客户端SSH登录到云端VPS, (或者在Chrome中用SSH扩展连接过去) 达成用Emacs在 “云端” 写代码的一个小目标……

其实,这样的目标已经实现了,美中不足的地方在于: 由于是SSH连接过去,每次退出SSH会话的时候还得退出Emacs,下次启动Emacs又得花掉人生中宝贵的四秒钟时间,实在是不甘心。正好,Emacs从26.1开始,已经支持使用systemd管理Emacs服务端Daemon的功能。这样一来,我们只需要在VPS上后台使用Systemd启动一个Emacs的服务端,每次SSH登录的时候,用Emacs客户端启动,就能实现秒开Emacs的效果了。

在Emacs安装完成后,会在 /usr/lib/systemd/user 中创建一个Systemd的配置文件,名为: emacs.service。跟其他的Systemd服务一样,我们只需启动这个服务即可。

启动并运行Emacs服务端程序:

1
systemctl --user start emacs.service

为了下次随机器启动时,自动启动Emacs服务端程序,我们还可以运行:

1
systemctl --user enable emacs.service

随后,查看Emacs服务运行情况:

https://xiaozhou.net/pics/emacs/5.png

服务端启动妥当,最后,只需要在SSH登录后,运行Emacs客户端程序,即可秒开Emacs了,又为人生中省下了不少个4秒钟:

1
emacsclient -t

https://xiaozhou.net/pics/emacs/4.png