Emacs:帮助我理解文件/缓冲区管理 [英] Emacs: help me understand file/buffer management

查看:156
本文介绍了Emacs:帮助我理解文件/缓冲区管理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

过去三年来,我一直在使用emacs进行所有的文字编辑工作。当我在一个单一的文件,工作代码或什么,我是相当有效率。有两个文件,我可以C-x b RET在他们之间,我做的很好。但是,每当我需要同时处理两个以上的文件时,我往往会迷失方向。

I've been using emacs for all of my text editing needs for the past three years now. When I'm in a single file, working on code or whatnot, I'm fairly efficient. With two files, I can "C-x b RET" between them and I do fine. However, whenever I need to be working on more than two files at a time, I tend to get lost.

以下是我想要处理的一些问题:

Here are some of the problems that I'd like to work on:


  1. 我忘了我的一些缓冲区被调用,但是我不明白为什么Cx Cb将窗口分成两个缓冲区并退出迷你缓冲区。当然,我可以切换缓冲区并选择一个缓冲区来访问,但是这种感觉不直观,并且让我打开两个缓冲区。

  1. I forget what some of my buffers are called, but I don't understand why C-x C-b splits my window into two buffers and exits the mini buffer. Sure I can switch buffers and choose a buffer to visit, but this feels unintuitive, and leaves me with two buffers open.

当我访问一个目录而不是一个文件,我有一个方便的所有文件和目录的列表。我通常想做以下两件事情之一:1)打开一个文件,再也看不到这个缓冲区2)打开一堆文件,再也看不到这个缓冲区。我真的不知道如何做到这一点,因为移动点到一个文件并且返回不会做任何这些事情。

When I visit a directory rather than a file, I have a convenient list of all of the files and directories. I usually want to do one of two things with this: 1) Open a single file and never see this buffer again OR 2) Open a bunch of files and never see this buffer again. I don't really know how to do this, as moving the point to a file and hitting return doesn't do either of these things.

我知道我的缓冲区不像标签,但我有倾向想滚动他们找到我想要的。我不知道这是什么键绑定,但我希望它是M-n / M-p等。再次,这可能是一种非常低效的切换缓冲区的方法。

I know that my buffers aren't like tabs, but I have an inclination to want to scroll through them to find what I want. I don't know of any key-bindings for this, but I'd like it to be M-n / M-p or the like. Then again, this may be a horribly inefficient way to switch buffers.

当我打开任何类型的交互式帮助(例如在ESS中)时,我有一个切换回我正在使用的缓冲区并使用Cx 1返回到单个缓冲区的习惯。然而,当我这样做时,帮助缓冲区会悬挂在我的缓冲区列表中,进一步让我感到困惑。我知道我可以切换到那个缓冲区,杀死它,切换回来,然后回到一个缓冲区,但这似乎是错误的。

When I open interactive help of any kind (for example in ESS), I have a habit of switching back to the buffer I was working in and using C-x 1 to get back to a single buffer. When I do this, however, the help buffer hangs around in my buffer list, further confusing me. I know I can switch to that buffer, kill it, switch back, and then go back to a single buffer, but this seems wrong.

到目前为止我已经处理过的方法涉及在不同的工作空间中使用平铺窗口管理器和几个emacs窗口,而不是实际学习管理emacs中多个文件的最佳方式。我不一定要改变emacs,以更好地适应我的需要(虽然我对此有所了解,如果它符合我要说的话),而是想要思考处理文件/缓冲emacs的方式,以及我如何可以更高效地使用它。

The way I've dealt with this so far involves using a tiling window manager and a few emacs windows in different work-spaces, rather than actually learn the best way to manage a number of files in emacs. I don't necessarily want to change emacs to better fit my needs (although I am open to that if it fits in with what I'm about to say), instead, I'd like to grok the thought process behind handling files/buffers the way that emacs does, and how I can be more efficient with it.

任何有助于我理解正确方法或更有效的方式来管理的答案我的缓冲区或文件将不胜感激。

Any answer that would help me understand the correct way, or a more efficient way to manage my buffers or files would be greatly appreciated.

推荐答案

我想你真的很喜欢 Ido 处理多个缓冲区,名字不能完全记住。当您键入 C-x b 时,会以最常用的顺序显示打开的缓冲区列表。当您在缓冲区名称中键入一些字符时,列表将被过滤。您键入的字符不必在乞求的名称或连续。使用 Cf Cb 或左/右箭头键循环浏览缓冲区选项。

I think you will really enjoy Ido for dealing with multiple buffers who's names you can't exactly remember. When you type C-x b it shows a list of open buffers in most used order. As you type some of the characters in a buffer name the list is filtered. The characters you type don't have to be at the begging of the name or contiguous. Using C-f, C-b or left/right arrow keys cycles through the buffer choices.

另请参见 Smex for Ido like Mx

Also see Smex for Ido like functionality for M-x

关闭窗口使用 Cx 0 完成。有意分割窗口的是水平的 C-x 2 ,用于垂直的 C-x 3 。我喜欢这个功能,因为它允许我在同一时间可以看到测试和生产代码。 C-x o 带我到另一个窗口。

Closing windows is done with C-x 0. Intentionally splitting the window is done with C-x 2 for horizontal, C-x 3 for vertical. I love this feature, since it allows me to have test and production code visible at the same time. C-x o takes me to the other window.

这篇关于Emacs:帮助我理解文件/缓冲区管理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆