Vim 於 Linux、Mac、Putty 貼上時 自動切換成 Paste 模式

91 views
Skip to first unread message

OOO

unread,
Dec 15, 2014, 10:39:27 PM12/15/14
to vim-taiwan
剛剛看到的
測試後確實可以用
不過有限制 Terminal


if &term =~ "xterm.*"
let &t_ti = &t_ti . "\e[?2004h"
let &t_te = "\e[?2004l" . &t_te
function XTermPasteBegin(ret)
set pastetoggle=<Esc>[201~
set paste
return a:ret
endfunction
map <expr> <Esc>[200~ XTermPasteBegin("i")
imap <expr> <Esc>[200~ XTermPasteBegin("")
cmap <Esc>[200~ <nop>
cmap <Esc>[201~ <nop>
endif



ref: http://blog.longwin.com.tw/2014/12/vim-linux-mac-putty-paste-mode-change-2014/


--
OOO

sung descent

unread,
Dec 16, 2014, 12:22:20 AM12/16/14
to vim-t...@googlegroups.com



--
OOO

--

---
您已訂閱「Google 網上論壇」的「Vim-Taiwan」群組,因此我們特別傳送這封郵件通知您。
如要取消訂閱這個群組並停止接收來自這個群組的郵件,請傳送電子郵件到 vim-taiwan+...@googlegroups.com
如需更多選項,請前往:https://groups.google.com/d/optout
Reply all
Reply to author
Forward
0 new messages