Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the color of right sidebar (miniMap) in sublime?

Tags:

There is a rectangle area in the right sidebar, showing the current code block you are in in the context of the whole file, however it is kind of difficult to see, anyone know how to make the color more obvious?

as shown in the picture below

like image 926
Blake Avatar asked Aug 11 '14 09:08

Blake


People also ask

How do I change the sidebar color in Sublime Text 3?

The most recent version of Sublime has fixed this issue, click on Preferences, click on Theme select Adaptive. sublime-theme. This will change the sidebar to a dark colored background.

How do I get dark mode in Sublime Text?

To activate the theme, open up user preferences file by clicking Sublime Text menu -> Preferences -> Settings - User . There are two different dark themes, dark and hybrid . To activate dark theme, put the following in the Preferences file. "theme": "Midnight-dark.


1 Answers

Yes, it is possible to change the color of the minimap. In addition there are also a couple of settings that you can enable to make the minimap easier to see:

  • draw_minimap_border: enable it to see the minimap border.
  • always_show_minimap_viewport: makes the minimap always visible (even if the mouse is not near the minimap).

Example user settings (use menu Preferences>Settings, see this answer for more info about sublime user-settings file format):

{
    "always_show_minimap_viewport": true,
    "draw_minimap_border": true
}

How to change the color of the minimap?

To change the color of the minimap you should do it in your theme file. The default theme file is called Default.sublime-theme but this file name could be different if you are using a different downloaded theme. You need to change the value of the property viewport_color inside the class minimap_control. In order to do it you have two main options:

  • Option 1: override the values in a new file. Create a file called Default.sublime-theme in your user folder (you can find your user folder using menu Preferences>Browse-packages and then open the folder called user). Set this content to the file, use another color values if you want, save it with fileName Default.sublime-theme (supposing you are using default theme), and then restart:

    [
        {
            "class": "minimap_control",
            "settings": ["always_show_minimap_viewport"],
            "viewport_color": [68, 200, 240, 96],
            "viewport_opacity": 1.0,
        },
    
        {
            "class": "minimap_control",
            "settings": ["!always_show_minimap_viewport"],
            "viewport_color": [68, 200, 240, 96],
            "viewport_opacity": { "target": 0.0, "speed": 4.0, "interpolation": "smoothstep" },
        },
    
        {
            "class": "minimap_control",
            "attributes": ["hover"],
            "settings": ["!always_show_minimap_viewport"],
            "viewport_opacity": { "target": 1.0, "speed": 20.0, "interpolation": "smoothstep" },
        },
    ]
    
  • Option 2: edit your theme file directly. If you are using Linux and the default theme you usually can found Default.sublime-theme inside /opt/sublime_text/Packages/Theme - Default.sublime-package. If you are using windows and the default theme you usually can find Default.sublime-theme inside C:/Program Files/Sublime Text 3/Packages/Theme - Default.sublime-package.


Example results:

  1. Default Minimap:

    Default minimap

  2. Default minimap with option draw_minimap_border set to true.

    Default minimap with border

  3. Minimap with custom color ([68, 200, 240, 96]) and border

    Minimap with custom color


Edit: extra explanation about the meaning of "settings": ["!always_show_minimap_viewport"] in the previous file. It means that the config group is only used if the sublime setting always_show_minimap_viewport value is set to false. On the other hand "settings": ["always_show_minimap_viewport"] means that the config group is only used if the sublime setting always_show_minimap_viewport is set to true.

More in detail, the first config group just sets the minimap color and makes opacity=1, so, it makes the minimap always visible, and this is only used when always_show_minimap_viewport is set to `true.

The last two config groups are only used when always_show_minimap_viewport is set to false. The second config-group sets the color and sets opacity value to 0.0, so it makes the minimap non visible. BUT, the third group causes the opacity value to be 1 when you hover the minimap (see the attribute in the config group), so it makes the minimap visible when you hover the mouse over it. And this happens if always_show_minimap_viewport is set to false.

like image 114
sergioFC Avatar answered Sep 19 '22 15:09

sergioFC