22

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

Gabriel
  • 40,504
  • 73
  • 230
  • 404
Blake
  • 7,367
  • 19
  • 54
  • 80

1 Answers1

40

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.

Community
  • 1
  • 1
sergioFC
  • 5,926
  • 3
  • 40
  • 54
  • 2
    This for great for Sublime Text 2; but, does anyone know how to make this work for Sublime Text 3? Since ST3 doesn't have a Default.sublime-theme file, I copied the one from my ST2 but it's ignored. – Modular Jan 11 '16 at 19:47
  • @AtomTech I made this with ST3. If you are using Linux you usually can found _Default.sublime-theme_ inside _/opt/sublime_text/Packages/Theme - Default.sublime-package_. If you are using windows you usually can find _Default.sublime-theme_ inside _C:/Program Files/Sublime Text 3/Packages/Theme - Default.sublime-package_. Please make me now if you have any problem doing this. – sergioFC Jan 11 '16 at 20:03
  • Thanks for the quick response. The path you gave for Windows is correct, but if I open that file in ST3, it's encoded, so all I see are thousands of lines of 4-bit hex numbers. I'm on Windows 8.1, ST3 64-bit portable version, build 3095 if that helps? It's not JSON like I'd expect. – Modular Jan 11 '16 at 20:09
  • That happens because it is a zip file. I've edited my answer to add a option of making this creating a new file instead of editing the default theme file inside the zip. Take a look at option 1 to see if it helps you. – sergioFC Jan 11 '16 at 20:35
  • I tried option 1, and I also unzipped and edited the Theme - Default.sublime-package and restored it back with the edits, but neither worked. Maybe this is just an issue with the latest dev build I'm using? – Modular Jan 11 '16 at 21:24
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/100416/change-sublime-text-minimap-color-http-stackoverflow-com-questions-25239473) – sergioFC Jan 11 '16 at 21:27
  • Nice, I was trying to remember this the other day for a [__similar post__](https://forum.sublimetext.com/t/highlighted-indents-in-sublime-text-3-like-notepad/18661/6) I made regarding visibility. Just linked to your answer. Didn't know about the hover option since it wasn't in the theme I modified. – Enteleform Mar 26 '16 at 23:06
  • Your answers are awesome BTW, very clear & detailed. Are you on the ST forum? – Enteleform Mar 26 '16 at 23:06
  • You should be, seems like you know your stuff. : ) Got any plugins on PackageControl or in the works? – Enteleform Mar 26 '16 at 23:17
  • 1
    Nope, I have just made some plugins for stackoverflow questions. – sergioFC Mar 26 '16 at 23:23
  • Nice answer @sergioFC, I have two questions. 1- what are the two classes with the `!always_show_minimap_viewport` setting for? I noticed that I can comment them out, and the minimap still shows with the desired color. 2- where is the `draw_minimap_border` setting? I can't find it in your answer. – Gabriel Jan 03 '17 at 17:58
  • 1
    @Gabriel Thank you. I've updated the answer to add more info about where to place sublime settings and about the meaning of `!always_show_minimap_viewport`. Feel free to ask me again if something is not clear – sergioFC Jan 03 '17 at 20:07
  • I came here to upvote your great answer. Thank you and have a great day! – Worker Sep 12 '19 at 09:34