Skip to content

Instantly share code, notes, and snippets.

@billycromb
Created March 14, 2017 18:35
Show Gist options
  • Save billycromb/b4f67ff8b8eb6f34a722324df14b0869 to your computer and use it in GitHub Desktop.
Save billycromb/b4f67ff8b8eb6f34a722324df14b0869 to your computer and use it in GitHub Desktop.
How to get rid of a different color border around vim in iTerm2
#!/bin/bash
# In iTerm, if you have a different colored terminal theme than what you use for
# vim. You'll see a border of whatever the background color is in fullscreen
# mode One way to get rid of this is to use escape sequences to switch to a
# different profilewhen you open vim, and back when you are done.
# for this to work you need to have a profile set up called 'vimcolors'
# that matches your vim colorscheme (or at least the background color)
if [ $TERM_PROGRAM="iTerm.app" ]
then
OLDPROFILE=$ITERM_PROFILE
echo -ne "\033]1337;SetProfile=vimcolors\a"
/path/to/vim/binary "$@"
echo -ne "\033]1337;SetProfile=$OLDPROFILE\a"
else
/path/to/vim/binary "$@"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment