Skip to content

Instantly share code, notes, and snippets.

@bigloser
Last active December 21, 2015 14:48
Show Gist options
  • Select an option

  • Save bigloser/6321782 to your computer and use it in GitHub Desktop.

Select an option

Save bigloser/6321782 to your computer and use it in GitHub Desktop.
if exists('$ITERM_PROFILE') || exists('$TMUX')
let &t_ti = "\<Esc>[?2004h" . &t_ti
let &t_te = "\<Esc>[?2004l" . &t_te
function! XTermPasteBegin(ret)
set pastetoggle=<Esc>[201~
set paste
return a:ret
endfunction
execute "set <f28>=\<Esc>[200~"
execute "set <f29>=\<Esc>[201~"
map <expr> <f28> XTermPasteBegin("i")
imap <expr> <f28> XTermPasteBegin("")
vmap <expr> <f28> XTermPasteBegin("c")
cmap <f28> <nop>
cmap <f29> <nop>
end
if exists('$TMUX')
let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
else
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment