Emacs的:缓冲区之间切换的名称相同,但在不同的目录 [英] Emacs: Switching Between Buffers with the Same Name but in Different Directories

查看:126
本文介绍了Emacs的:缓冲区之间切换的名称相同,但在不同的目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个文件具有相同的名称,但在不同的目录:

I have two files with the same name but in different directories:

apples/main.cpp
oranges/main.cpp

我在一个Emacs窗口打开它们通过 emacs的苹果/ main.cpp中橘子/ main.cpp中

当我使用 C-X B 这两个缓冲区之间切换,缓冲名称是main.cpp中和的main.cpp 2>。我很想能够看到这两个文件的完整路径切换缓冲区时,使我的苹果,桔子版本之间存在歧义。有没有办法做到这一点?

When I use C-x b to switch between these two buffers, the buffer names are "main.cpp" and "main.cpp<2>". I would love to be able to see the full path of these two files when switching buffers, so that I may disambiguate between the apples and the oranges version. Is there a way to do this?

一个办法可以修改任何code产生2>当Emacs的检测具有该名称的缓冲区已经打开第二的main.cpp后。但是,我找不到如何做到这一点。

One way could be to modify whatever code generates the <2> after the second main.cpp when Emacs detects that a buffer with that name is already open. However, I couldn't find how to do this.

推荐答案

使用 uniquify 。我用它这样的:

(require 'uniquify)
(setq uniquify-buffer-name-style 'forward)

这篇关于Emacs的:缓冲区之间切换的名称相同,但在不同的目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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