case "$TERM" in
screen*) # screen, screen.rxvt
- if [ "$TERM" = screen.rxvt ]; then
- MC_SAVE_TERM="$TERM"
- TERM=rxvt
- fi
MC_XTERM="-x"
;;
esac
fi
[ -n "$MC_SAVE_OPS1" ] && OPS1="$MC_SAVE_OPS1"
- [ -n "$MC_SAVE_TERM" ] && TERM="$MC_SAVE_TERM"
- unset MC_FOUND MC_PWD_FILE MC_SAVE_OPS1 MC_SAVE_TERM \
- MC_SLOW MC_TMP_DIR MC_XTERM
+ unset MC_FOUND MC_PWD_FILE MC_SAVE_OPS1 MC_SLOW MC_TMP_DIR MC_XTERM
return $rc
}
cmap <f29> <nop>
"https://coderwall.com/p/if9mda/automatically-set-paste-mode-in-vim-when-pasting-in-insert-mode
- function! WrapForTmux(s)
- if !exists('$TMUX')
- return a:s
- endif
+ " https://ttssh2.osdn.jp/manual/en/usage/tips/vim.html
+ function! WrapForScreenTmux(s)
+ if (&term =~ "screen")
+ let scr_start = "\<Esc>P"
+ let scr_end = "\<Esc>\\"
- let tmux_start = "\<Esc>Ptmux;"
- let tmux_end = "\<Esc>\\"
+ return scr_start . a:s . scr_end
+ endif
+
+ if exists('$TMUX')
+ let tmux_start = "\<Esc>Ptmux;"
+ let tmux_end = "\<Esc>\\"
+
+ return tmux_start . substitute(a:s, "\<Esc>", "\<Esc>\<Esc>", 'g') . tmux_end
+ endif
- return tmux_start . substitute(a:s, "\<Esc>", "\<Esc>\<Esc>", 'g') . tmux_end
+ return a:s
endfunction
" https://vim.fandom.com/wiki/Change_cursor_shape_in_different_modes
- let &t_EI.=WrapForTmux("\e[2 q") "EI = NORMAL mode (ELSE)
- let &t_SI.=WrapForTmux("\e[6 q") "SI = INSERT mode
- let &t_SR.=WrapForTmux("\e[4 q") "SR = REPLACE mode
+ let &t_EI.=WrapForScreenTmux("\e[2 q") "EI = NORMAL mode (ELSE)
+ let &t_SI.=WrapForScreenTmux("\e[6 q") "SI = INSERT mode
+ let &t_SR.=WrapForScreenTmux("\e[4 q") "SR = REPLACE mode
"Cursor settings:
" 1 -> blinking block