" escalt.vim 控制台下让用 也可用 " Author: lilydjwg " --------------------------------------------------------------------- " Load Once: if &cp || exists("g:loaded_escalt") || has("gui_running") || has("win32") || has("win64") finish endif let s:keepcpo = &cpo let g:loaded_escalt = 1 set cpo&vim " --------------------------------------------------------------------- " Functions: function Escalt_console() " are left out because it causes issues " https://github.com/vim/vim/issues/7135 " reason: https://github.com/vim/vim/issues/2581#issuecomment-639746235 for i in range(48, 57) + range(65, 79) + range(81, 90) + range(97, 122) exe "set =\".nr2char(i) endfor " 10, 22, 34, 62, 124 can't be set set =, set =. set ttimeoutlen=50 " xterm keys, may also work in tmux with xterm-keys on set =OP set =OQ set =OR set =OS set =OH set =OF set =[3;2~ if exists("$TMUX") set = set = set = set = set =[15;2~ set =[17;2~ set =[18;2~ set =[19;2~ set =[20;2~ set =[21;2~ set =[23;2~ set =[24;2~ set =[1~ set =[4~ " In xterm and tmux " 2 & 3 are Ins and Del, 5 & 6 are PgUp and PgDn elseif &term == 'linux' " Linux console keys, only S-F3 & S-F5 actually works " set =[25~ " set =[26~ set =[28~ " set =[29~ set =[31~ " set =[32~ " set =[33~ " set =[34~ else set =O1;2P set =O1;2Q set =O1;2R set =O1;2S endif endfunction " --------------------------------------------------------------------- " Call Functions: if !has('nvim') call Escalt_console() endif " --------------------------------------------------------------------- " Restoration And Modelines: let &cpo= s:keepcpo unlet s:keepcpo