X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=.vimrc;h=7613cfd26032654e2e1b172b26cf6d4378b8c3ec;hb=1b4145b1d1debe2e0c92e4db7af5f1437fa9d0c5;hp=849d8acd34511f7a10604cfca00b14f8f13e12d6;hpb=334d38cccd615842e2ec3a93da6cd56a2b561e8e;p=dotfiles.git diff --git a/.vimrc b/.vimrc index 849d8ac..7613cfd 100644 --- a/.vimrc +++ b/.vimrc @@ -297,6 +297,39 @@ else vmap XTermPasteBegin("c") cmap cmap + + "https://coderwall.com/p/if9mda/automatically-set-paste-mode-in-vim-when-pasting-in-insert-mode + " https://ttssh2.osdn.jp/manual/en/usage/tips/vim.html + function! WrapForScreenTmux(s) + if (&term =~ "screen") + let scr_start = "\P" + let scr_end = "\\\" + + return scr_start . a:s . scr_end + endif + + if exists('$TMUX') + let tmux_start = "\Ptmux;" + let tmux_end = "\\\" + + return tmux_start . substitute(a:s, "\", "\\", 'g') . tmux_end + endif + + return a:s + endfunction + + " https://vim.fandom.com/wiki/Change_cursor_shape_in_different_modes + 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 + " 2 -> solid block + " 3 -> blinking underscore + " 4 -> solid underscore + " 5 -> blinking vertical bar + " 6 -> solid vertical bar endif " Multiline comments often confuse vim syntax highlighting - these maps