From: Oleg Broytman Date: Thu, 18 Jul 2019 23:00:10 +0000 (+0300) Subject: .vimrc: Restore `WrapForTmux` X-Git-Url: https://git.phdru.name/?p=dotfiles.git;a=commitdiff_plain;h=01750040116e8b50ca033c9b44348027a8edba5b .vimrc: Restore `WrapForTmux` --- diff --git a/.vimrc b/.vimrc index 836b646..41d0e22 100644 --- a/.vimrc +++ b/.vimrc @@ -298,10 +298,22 @@ else cmap cmap + "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 + + let tmux_start = "\Ptmux;" + let tmux_end = "\\\" + + return tmux_start . substitute(a:s, "\", "\\", 'g') . tmux_end + endfunction + " https://vim.fandom.com/wiki/Change_cursor_shape_in_different_modes - let &t_EI.="\e[2 q" "EI = NORMAL mode (ELSE) - let &t_SI.="\e[6 q" "SI = INSERT mode - let &t_SR.="\e[4 q" "SR = REPLACE mode + 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 "Cursor settings: " 1 -> blinking block