更改 Emacs 默认字体大小和新的缓冲区文本
我想配置 Emacs,使其具有:
增加默认字体大小。目前,我每次打开文件时都使用 Shift+Click 来更改它,但我希望将我的配置保存到 emacs 配置文件中。
我希望在打开要更改的新缓冲区时显示默认文本。我认为它就像默认打开的某些模板。这是我希望在启动 emacs 时将其视为默认文本的代码,以便我可以直接对其进行操作。
#include
; #include ; #include #include ; #include ; #include ; #include ; int main(int argc, char *argv[]) { 返回0; }
I want to configure Emacs so that it has:
Increased default font size. Currently I use Shift+Click to change it every time I open a file, but I want my configurations saved to the emacs config file.
I wanted to have the default text that appears while I open a new buffer to be changed. I assume it would be like some template that opens by default. Here is the code which I would like to see as the default text when I start emacs, so that I can directly work on it.
#include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <string.h> #include <sys/types.h> #include <errno.h> #include <pthread.h> int main(int argc, char *argv[]) { return 0; }
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
要更改默认字体(大小),不仅要更改第一个,还要更改每个 Emacs 框架(即更常见的术语中的窗口),请在
.emacs
中使用它:(当然,替换
Terminus 10
使用您想要的字体和大小。)To change the default font (size) not just for the first, but each Emacs frame (i.e. window in more common terms), use this in your
.emacs
:(Of course, replace
Terminus 10
with your desired font and size.)每当您创建新文件时,请使用挂钩指定所需的文本:
Use a hook to specify the desired text whenever you create a new file:
有更好的方法来插入模板,但这应该可以满足您的需要。显然将字体定制为您想要的。
将以下代码放入您的
.emacs
中,该代码可以在您的主目录中找到,或者通过执行 Cx Cf ~/.emacs RET (还有许多其他位置)如果可能,请参阅这些SO问题)。There are better ways to insert a template, but this should do the trick for you. Obviously customize the font to what you want.
Put the following code in your
.emacs
, which can be found in your home directory, or by doing C-x C-f ~/.emacs RET (and a bunch of other locations are possible, see these SO questions).