eclipse - 更改 Eclipse 侧边栏垂直范围突出显示

标签 eclipse ubuntu scope highlight sidebar

在 Windows 8 上使用 Eclipse 一段时间后,我刚刚安装了 Ubuntu。当您在文件中的当前类或方法下工作时,我唯一不知道如何修改的是竖线的颜色。

示例:在 Windows 中,默认是这个可爱的蓝色,如下所示:

enter image description here

但在 Ubuntu 中,这是橙色的(如下所示),这让我分心:

enter image description here

关于如何解决这个问题的任何想法?
不知道为什么颜色不一样?我在 Windows 8 和 Ubuntu 14.04 上的 Eclipse 都是 Kepler 4.3

最佳答案

这称为范围指示器。您可以关闭范围指示器。

如何:

点击Windows > Preferences .导航到 General > Editors > Text Editors .取消选择Show Range indicator选项。

如何更改颜色:

范围指示器的颜色由操作系统而不是 eclipse 控制。

  • 安装 gtk-theme-config来自 Ubuntu 软件中心的工具。更改Highlight background color .注销并重新登录。

  • enter image description here
  • 您也可以通过将 dconf-editor 安装为 said here 来做到这一点。

  • 更改后:

    enter image description here

    请注意,这将更改其他应用程序中的选择颜色,例如 nautilus、Firefox 等。

    如何仅将其应用于 Eclipse:

    在你的主目录的某个地方,创建一个具有以下内容的 gtkrc 文件(如:~/.gtkrc-eclipse):

    gtk-color-scheme = "selected_bg_color:#0AFC02\nselected_fg_color:#FFFFFF\norginal_selected_bg_color:#f07746\ntooltip_bg_color:#f5f5c5\ntooltip_fg_color:#000000"
    
    style "range-indicator"
    {
        base[SELECTED]    = @selected_bg_color
    }
    class "GtkWindow" style "range-indicator"
    

    从命令行启动 Eclipse,例如,

    env GTK2_RC_FILES=/usr/share/themes/<Your current theme>/gtk-2.0/gtkrc:/home/<user name>/.gtkrc-eclipse '

    env GTK2_RC_FILES=/usr/share/themes/Ambiance/gtk-2.0/gtkrc:/home/chandrayya/.gtkrc-eclipse '/opt/eclipse-3.3/eclipse'



    您可以通过执行找出您当前的主题,

    gsettings get org.gnome.desktop.interface gtk-theme



    请注意,这也是在编辑器中更改文本选择背景和前景色,我们无法避免。

    关于eclipse - 更改 Eclipse 侧边栏垂直范围突出显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25151476/

    相关文章:

    java - Eclipse:如何更改当前选择的方法/表达式的突出显示颜色?

    eclipse - 如何在 Eclipse 中比较项目中的文件与文件系统中的文件?

    eclipse - 无法使用 https 和 SSH 链接在 Eclipse 中克隆 git 存储库

    ubuntu - lxc-克隆 : unrecognized option '--dir'

    javascript - 加载外部文件变量,同时避免浏览器外部文件缓存

    php - 使用 Require_once() 正确包含数据库连接变量

    java - 如何清理 Eclipse 中的组合 vars 声明?

    linux - Ubuntu -If 命令似乎不提供其他结果

    ubuntu - 无法编译 HTTP-Live-Video-Stream-Segmenter-and-Distributor

    flutter - Flutter/Dart Scope问题-是否需要返回信息以防止重复文件上传?