You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How about adding an option for changing the titlebar's color? #266
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 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.
Reacted by Christopher Francisco, Ian Langworth ☠ and Kyle Rentschler
@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.
#791 added "Mojave-style" tabs, where the colors and theming look similar to how native macOS tabs do (dirty detail: it's not the same as native tabs, because macOS doesn't expose a native tabs UI control for developers). This should make the tabs more pleasant to deal with as they would look similar to other native Apple apps and if you toggle dark mode, the tabs would turn to a dark gray color as well so it won't be blinding to you. It's only going to be active if you are running MacVim on Mojave or above.
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.
#888 is adding option to make titlebar transparent so the colorscheme background will be visible instead. Not a full substitution for what's being asked here, but should work for some people I hope.
Activity
jpetrie commentedon Apr 21, 2016
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.
chuanconggao commentedon Apr 23, 2016
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.
jpetrie commentedon Apr 23, 2016
A new
setoption 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 viaNSUserDefaults).Modifying core vim's code, where all the
setoptions 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.wayneashleyberry commentedon Sep 23, 2016
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 atom/atom#11790.
lauevrar77 commentedon Dec 21, 2017
An idea if this will be implemented sooner or later ?
mvanier commentedon Jan 1, 2018
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.
christopher-francisco commentedon Jan 4, 2018
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
robinmitra commentedon Apr 18, 2018
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?
jpetrie commentedon Apr 18, 2018
@robinmitra I've never gone about customizing the color of an
NSWindowtitle 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,
MMWindowis aNSWindowsubclass 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
setoption. 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.
chdiza commentedon Apr 18, 2018
This should definitely not be a regular vim option, but should instead be something to set with
defaults write(or the Preferences window).robinmitra commentedon Apr 19, 2018
Thanks, that gives me a good starting point. I'll come back with any questions.
statico commentedon Aug 10, 2018
Here are some more resources:
A strong +1 to this, too. It might also satisfy the people having issues in #111 as well.
ychin commentedon Nov 27, 2018
#791 added "Mojave-style" tabs, where the colors and theming look similar to how native macOS tabs do (dirty detail: it's not the same as native tabs, because macOS doesn't expose a native tabs UI control for developers). This should make the tabs more pleasant to deal with as they would look similar to other native Apple apps and if you toggle dark mode, the tabs would turn to a dark gray color as well so it won't be blinding to you. It's only going to be active if you are running MacVim on Mojave or above.
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.
ychin commentedon Apr 28, 2019
#888 is adding option to make titlebar transparent so the colorscheme background will be visible instead. Not a full substitution for what's being asked here, but should work for some people I hope.
nabsiddiqui commentedon Jun 14, 2019
How exactly do I set this @ychin ?
eirnym commentedon Jun 14, 2019
@nabsiddiqui As per documentation, you write defaults variable in terminal. (
:help macvim-user-defaults)defaults write org.vim.MacVim MMTitlebarAppearsTransparent truenabsiddiqui commentedon Jun 14, 2019
Ah. Thank you. BTW, it looks awesome now.
ychin commentedon Jun 17, 2019
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.
Add dark mode customization / appearance preferences panel