Skip to content

Instantly share code, notes, and snippets.

@0x4a616e
Last active August 23, 2023 02:35
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save 0x4a616e/31f58e02ffd5d49bb0865c3dce0b5a08 to your computer and use it in GitHub Desktop.
Save 0x4a616e/31f58e02ffd5d49bb0865c3dce0b5a08 to your computer and use it in GitHub Desktop.
MacVim Touch Bar buttons
" MacVim Touch Bar support
" ========================
" Since version 8.0 (I think), MacVim natively supports the macOS touch bar. By default it just contains
" one button to toggle fullscreen mode. To add some more useful buttons, just copy this into your .vimrc
"
" More details about the syntax can be found here: https://github.com/macvim-dev/macvim/blob/master/runtime/doc/gui_mac.txt
" For a list of touch bar image names, see https://developer.apple.com/design/human-interface-guidelines/macos/touch-bar/touch-bar-icons-and-images/
" Toggle NerdTree
an icon=NSTouchBarSidebarTemplate TouchBar.NerdTree :NERDTreeToggle<CR>
an TouchBar.-flexspace2- <Nop>
" List buffers
an icon=NSTouchBarListViewTemplate TouchBar.ListBuffers :ls<CR>
" Delete buffer
an icon=NSTouchBarDeleteTemplate TouchBar.Delete :bd<CR>
an TouchBar.-Sep- <Nop>
" Previous buffer
an icon=NSTouchBarGoBackTemplate TouchBar.GoBack :bp<CR>
" Next buffer
an icon=NSTouchBarGoForwardTemplate TouchBar.GoForward :bn<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment