Skip to content

Instantly share code, notes, and snippets.

@saitoha
Last active January 26, 2016 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saitoha/c567281e23750076be32 to your computer and use it in GitHub Desktop.
Save saitoha/c567281e23750076be32 to your computer and use it in GitHub Desktop.
20行でできる、端末版vimの縦分割スクロール高速化設定 ref: http://qiita.com/kefir_/items/c725731d33de4d8fb096
" Use vsplit mode
if has("vim_starting") && !has('gui_running') && has('vertsplit')
function! EnableVsplitMode()
" enable origin mode and left/right margins
let &t_CS = "y"
let &t_ti = &t_ti . "\e[?6;69h"
let &t_te = "\e[?6;69l\e[999H" . &t_te
let &t_CV = "\e[%i%p1%d;%p2%ds"
call writefile([ "\e[?6;69h" ], "/dev/tty", "a")
endfunction
" old vim does not ignore CPR
map <special> <Esc>[3;9R <Nop>
" new vim can't handle CPR with direct mapping
" map <expr> ^[[3;3R EnableVsplitMode()
set t_F9=^[[3;3R
map <expr> <t_F9> EnableVsplitMode()
let &t_RV .= "\e[?6;69h\e[1;3s\e[3;9H\e[6n\e[0;0s\e[?6;69l"
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment