要求Emacs更清晰地突出显示哪个窗口(窗格)具有焦点(光标) [英] Asking Emacs to highlight more clearly which window (pane) has the focus (cursor)

查看:113
本文介绍了要求Emacs更清晰地突出显示哪个窗口(窗格)具有焦点(光标)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说我有我的Emacs窗口拆分成多个图块,例如:

  ---------- ----------------- 
| | |
| | |
---------------------------
| |
| |
---------------------------

当我在瓦片之间切换(也称为Emacs中的窗口)来编辑我的文件(例如使用 Cx o )时,我可以看到我在哪个瓦屏幕上的光标(点),并检查每个图块状态栏中的阴影差异:



然而,将光标定位在大屏幕上并不容易在光标所在的状态栏上的阴影差异几乎可以忽略不计:



这是当选择相应的窗口时状态栏的样子:



             



这是什么样的



             



以上是与颜色主题 zenburn GNU Emacs 23.3.1。



我的问题是:有没有办法让Emacs更清楚地指出哪个窗口/ tile /缓冲区是有焦点的?

解决方案

绝对!



您可以更改模型以突出显示活动栏,使用以下内容.emacs(更改颜色和样式以适合您的喜好当然)。

 (set-face -attribute'mode-line 
nil
:前景gray80
:backgroundgray25
:box'(:line-width 1:style released-button))
(set-face-attribute'mode-line-inactive
nil
:前景gray30
:背景MY_BG_COLOR
:框'(:line-width 1:style released-button))

由于您似乎使用的是Zenburn色彩主题,您还可以在其中修复它。
只需打开名为zenburn.el的颜色主题库中的文件(或者可能是color-theme-zenburn.el),并搜索以下行:

 `(mode-line 
((,class(:foreground,zenburn-green + 1
:background,zenburn- bg-1
:box(:line-width -1:style released-button)))))
`(mode-line-buffer-id((,class(:foreground,zenburn-yellow :weight bold)))
`(mode-line-inactive
((,class(:foreground,zenburn-green-1
:background,zenburn-bg-05
:box(:line-width -1:style released-button)))))

根据您的需要更改背景颜色和前景色的值。


Say I have my Emacs window split into multiple tiles, e.g.:

---------------------------
|            |            |
|            |            |
---------------------------
|                         |
|                         |
---------------------------

When I switch between tiles (aka windows in Emacs) to edit my files (e.g. using C-x o), I can see on which tile I am by visually locating the cursor (point) on the screen and checking the difference in shading in the status bar of each tile:

However, locating the cursor on a large screen is not easy AND the difference in shading on the status bar where the cursor is is almost negligible:

This is what a status bar looks like when the corresponding window is selected:

             

This is what it looks like when the corresponding window is not selected (notice the green is a bit dimmer)

             

The above is with the color theme zenburn on GNU Emacs 23.3.1.

My question is: Is there a way to have Emacs more clearly indicate which window/tile/buffer is the one that has the focus?

解决方案

Absolutely!

You can change the modeline to highlight the active bar using the following in your .emacs (change colors and style to suit your preferences of course).

(set-face-attribute  'mode-line
                 nil 
                 :foreground "gray80"
                 :background "gray25" 
                 :box '(:line-width 1 :style released-button))
(set-face-attribute  'mode-line-inactive
                 nil 
                 :foreground "gray30"
                 :background MY_BG_COLOR 
                 :box '(:line-width 1 :style released-button))

Since it seems you are using the Zenburn color theme, you can also fix it within there. Just open the file within your color-theme library named zenburn.el (or it might be color-theme-zenburn.el) and search for the following lines:

`(mode-line
  ((,class (:foreground ,zenburn-green+1
                       :background ,zenburn-bg-1
                       :box (:line-width -1 :style released-button)))))
`(mode-line-buffer-id ((,class (:foreground ,zenburn-yellow :weight bold))))
`(mode-line-inactive
  ((,class (:foreground ,zenburn-green-1
                       :background ,zenburn-bg-05
                       :box (:line-width -1 :style released-button)))))

and change the values of the background and foreground colors as you see fit.

这篇关于要求Emacs更清晰地突出显示哪个窗口(窗格)具有焦点(光标)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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