Created
June 11, 2012 07:44
-
-
Save yoshikaw/2908941 to your computer and use it in GitHub Desktop.
端末エスケープシーケンス関連の設定
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Terminal {{{1 | |
"------------------------------------------------------------------------------- | |
set t_RV= " don't request terminal version string | |
" Define terminal multiplexer's escape sequence | |
let t_multiplexer_s = '' | |
let t_multiplexer_e = '' | |
if exists('$STY') " GNU Screen | |
let t_multiplexer_s = "\eP" | |
let t_multiplexer_e = "\e\\" | |
elseif exists('$TMUX') " tmux | |
let t_multiplexer_s = "\ePtmux;\e" | |
let t_multiplexer_e = "\e\\" | |
endif | |
" Change cursor shape to vertical bar when starting insert mode. {{{2 | |
if exists('$ITERM_PROFILE') " iTerm | |
let &t_SI = t_multiplexer_s . "\<ESC>]50;CursorShape=1\x7" . t_multiplexer_e | |
let &t_EI = t_multiplexer_s . "\<ESC>]50;CursorShape=0\x7" . t_multiplexer_e | |
elseif &term =~ "xterm" | |
" DECSCUSR | |
let &t_SI = t_multiplexer_s . "\e[5 q" . t_multiplexer_e | |
let &t_EI = t_multiplexer_s . "\e[1 q" . t_multiplexer_e | |
endif "}}} | |
" Disable auto indent when paste from clipboard. {{{2 | |
" @see http://ttssh2.sourceforge.jp/manual/ja/usage/tips/vim.html | |
if &term =~ "xterm" | |
if &t_ti !~ "[?2004h" | |
let &t_ti .= t_multiplexer_s . "\e[?2004h" . t_multiplexer_e | |
let &t_te .= t_multiplexer_s . "\e[?2004l" . t_multiplexer_e | |
endif | |
let &pastetoggle = "\e[201~" | |
function! XTermPasteBegin(ret) | |
set paste | |
return a:ret | |
endfunction | |
noremap <special> <expr> <Esc>[200~ XTermPasteBegin("0i") | |
inoremap <special> <expr> <Esc>[200~ XTermPasteBegin("") | |
cnoremap <special> <Esc>[200~ <nop> | |
cnoremap <special> <Esc>[201~ <nop> | |
endif "}}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment