-
-
Notifications
You must be signed in to change notification settings - Fork 686
MBP Touchbar Support (take 2) #715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1287,4 +1287,27 @@ if has("gui_macvim") | |
macm Help.MacVim\ Website action=openWebsite: | ||
endif | ||
|
||
if has("touchbar") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the previous review there was a comment about potentially having too many default Touch Bar buttons. I addressed this in the pull request descriptions, but I basically removed all the original ones and just added a full screen button that can toggle icon depending on what state it's in. I think most users will prefer a close to empty Touch Bar for customization so it's not worth having too many defaults (I just think having a couple that works well is a good thing to entice users to learn how to customize it). |
||
" Set up default Touch Bar buttons. | ||
" 1. Smart fullscreen icon that toggles between going full screen or not. | ||
an icon=NSTouchBarEnterFullScreenTemplate 1.10 TouchBar.EnterFullScreen :set fullscreen<CR> | ||
|
||
let s:touchbar_fullscreen=0 | ||
func! s:SetupFullScreenTouchBar() | ||
if &fullscreen && s:touchbar_fullscreen == 0 | ||
aun TouchBar.EnterFullScreen | ||
an icon=NSTouchBarExitFullScreenTemplate 1.10 TouchBar.ExitFullScreen :set nofullscreen<CR> | ||
let s:touchbar_fullscreen = 1 | ||
elseif !&fullscreen && s:touchbar_fullscreen == 1 | ||
aun TouchBar.ExitFullScreen | ||
an icon=NSTouchBarEnterFullScreenTemplate 1.10 TouchBar.EnterFullScreen :set fullscreen<CR> | ||
let s:touchbar_fullscreen = 0 | ||
endif | ||
endfunc | ||
aug FullScreenTouchBar | ||
au! | ||
au VimResized * call <SID>SetupFullScreenTouchBar() | ||
aug END | ||
endif | ||
|
||
" vim: set sw=2 : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm actually not 100% if we should expose a feature test for this, but I guess if toolbar is already one, why not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you that you've exposed it as Tool bar and Touch Bar are different. One can be enabled without other