download

Sign in or create your account | Project List | Help

download Git Source Tree

Root/winresize.vim

1scriptencoding utf-8
2if &cp || exists("g:loaded_winresize")
3    finish
4endif
5let g:loaded_winresize = 1
6
7let s:save_cpo = &cpo
8set cpo&vim
9
10" command
11command! -narg=0 WinResizeToRight1 :call s:WinResize( 1, 0)
12command! -narg=0 WinResizeToRight5 :call s:WinResize( 5, 0)
13command! -narg=0 WinResizeToLeft1 :call s:WinResize(-1, 0)
14command! -narg=0 WinResizeToLeft5 :call s:WinResize(-5, 0)
15command! -narg=0 WinResizeToUp1 :call s:WinResize( 0, -1)
16command! -narg=0 WinResizeToUp5 :call s:WinResize( 0, -5)
17command! -narg=0 WinResizeToDown1 :call s:WinResize( 0, 1)
18command! -narg=0 WinResizeToDown5 :call s:WinResize( 0, 5)
19
20" map
21nmap <M-Right> :WinResizeToRight1<CR>
22nmap <S-M-Right> :WinResizeToRight5<CR>
23nmap <M-Left> :WinResizeToLeft1<CR>
24nmap <S-M-Left> :WinResizeToLeft5<CR>
25nmap <M-Up> :WinResizeToUp1<CR>
26nmap <S-M-Up> :WinResizeToUp5<CR>
27nmap <M-Down> :WinResizeToDown1<CR>
28nmap <S-M-Down> :WinResizeToDown5<CR>
29
30" &columns += &columns + a:columns
31" &lines += &lines + a:lines
32function! s:WinResize(columns, lines)
33    let &columns += a:columns
34    let &lines += a:lines
35endfunction
36
37let &cpo = s:save_cpo
38finish
39
40==============================================================================
41winresize.vim : ウィンドウサイズコントロールスクリプト
42------------------------------------------------------------------------------
43$VIMRUNTIMEPATH/plugin/winresize.vim
44==============================================================================
45author : 小見 拓
46url : http://nanasi.jp/
47email : mail@nanasi.jp
48version : 2009/12/19 16:00:00
49==============================================================================
50ウィンドウのサイズを拡大、縮小するスクリプト。
51プレゼンなど、急にウィンドウサイズの変更が必要になった際に使用する。
52
53------------------------------------------------------------------------------
54横幅(columns)拡大
55<M-Right> サイズ+1
56<S-M-Right> サイズ+5
57
58横幅(columns)縮小
59<M-Left> サイズ-1
60<S-M-Left> サイズ-5
61
62縦幅(lines)拡大
63<M-Up> サイズ-1
64<S-M-Up> サイズ-5
65
66縦幅(lines)縮小
67<M-Down> サイズ+1
68<S-M-Down> サイズ+5
69
70==============================================================================
71" vim: set et ft=vim nowrap :
72

Archive Download this file

Branches:
master