It would be great if a MacVim specific option can be added to control the titlebar's color. I know that many Mac app already have fancy customized titlebar colors, like Word or Excel. Adding this function could help improve the look-and-feel greatly with matching color themes, especially when using OS X's dark mode.
This repo already provides very mature code for doing this.
I'm not _particularly_ enthusiastic about the idea, personally (I feel like it falls into the category of "just because we can doesn't mean we should"), but I wouldn't necessarily refuse a well-implemented PR for it. How do you expect this to look, interface-wise (as in, how does one manipulate this color and what special behavior does it have)? Are there separate settings for light and dark mode?
Is MacVim's window not respecting dark mode toggles as-is? That, at least, seems like it would be a bug we should address.
I think maybe just a simple option like set titlebarcolor=#1C1C1C. Of course, the tab bar underneath the title bar also needs the same background color (maybe with a different transparency).
I do not think we need to consider too much about dark mode toggle right now. Usually the title bar color would be chosen to match the color theme, rather than dark mode or not.
A new set option is something that would generally need to be added by _core_ vim, not MacVim itself. That's why most of the MacVim-specific options we have (which fullscreen mode to use, ligature support, et cetera) are implemented as actual preference items in the MacVim GUI (generally via NSUserDefaults).
Modifying core vim's code, where all the set options are handled, seems to me like it would significantly increase the cost of merging in core vim's changes. I don't think that cost is worth paying for a feature like this. Perhaps @splhack can weigh in on what kind of impact that would have on our merge process, but my understanding is that it would be an annoyance.
I'd also love this, it is minor but really does make the window look modern.
Atom just shipped this in 1.11 beta and they had a great discussion about it over on https://github.com/atom/atom/pull/11790.
An idea if this will be implemented sooner or later ?
I'd love this too. I use a dark theme and also use iterm2 with a dark title bar and a dark background, and the light title bar on MacVim is a bit distracting.
So do I. I mostly use Vim for writing, but for reading I rather macvim; would be cool I could also have colored title bar here
I'm also interested in this feature as the titlebar is quite distracting when coding in the night with a dark theme.
I'm willing to help develop this functionality but would appreciate if someone can give me a few pointers to get started on the right track?
@robinmitra I've never gone about customizing the color of an NSWindow title bar, so I can't offer much guidance there other than to suggest plugging "custom NSWindow title bar" into a search engine. There's a few potentially promising hits on StackOverflow, such as this one.
In MacVim itself, MMWindow is a NSWindow subclass used by MacVim and would probably be a good place to start looking at how to handle the custom setup and drawing.
If you want to plug this into MacVim's preferences and GUI, this commit had some changes that added a new preference key and hooked it up, so you could wire the setting up that way.
I'm not sure of the best way to integrate the setting if you wanted to implement as a regular vim set option. This pending PR does something similar (in that it involves touching core vim source to add some options) but I'm not sure how helpful it would be as a guideline.
However you implement it, it should be possible to disable it (so users who want the window to look like a regular OS window don't have to guess at a "good color" to get that effect) and should not be enabled by default.
This should definitely not be a regular vim option, but should instead be something to set with defaults write (or the Preferences window).
Thanks, that gives me a good starting point. I'll come back with any questions.
Here are some more resources:
A strong +1 to this, too. It might also satisfy the people having issues in https://github.com/macvim-dev/macvim/pull/111 as well.
I think this is probably the best move forward as it works out of the box and looks similar to other native Mac apps (the main goal of MacVim is to provide the Vim experience in an app that feels like a native macOS Cocoa app). Adding customization like this proposal always comes with a maintenance cost moving forward so I'm a little hesitant to add this feature.
Leaving the issue open for now to see if there are any further discussions on this.
How exactly do I set this @ychin ?
@nabsiddiqui As per documentation, you write defaults variable in terminal. (:help macvim-user-defaults)
defaults write org.vim.MacVim MMTitlebarAppearsTransparent true
Ah. Thank you. BTW, it looks awesome now.
I filed #912 to consider adding this option (and maybe a few other non-niche settings) in the Preferences UI so you don't need terminal to set it.
Most helpful comment
I'd love this too. I use a dark theme and also use iterm2 with a dark title bar and a dark background, and the light title bar on MacVim is a bit distracting.