| 1 | scriptencoding utf-8 |
| 2 | if &cp || exists("g:loaded_winresize") |
| 3 | finish |
| 4 | endif |
| 5 | let g:loaded_winresize = 1 |
| 6 | |
| 7 | let s:save_cpo = &cpo |
| 8 | set cpo&vim |
| 9 | |
| 10 | " command |
| 11 | command! -narg=0 WinResizeToRight1 :call s:WinResize( 1, 0) |
| 12 | command! -narg=0 WinResizeToRight5 :call s:WinResize( 5, 0) |
| 13 | command! -narg=0 WinResizeToLeft1 :call s:WinResize(-1, 0) |
| 14 | command! -narg=0 WinResizeToLeft5 :call s:WinResize(-5, 0) |
| 15 | command! -narg=0 WinResizeToUp1 :call s:WinResize( 0, -1) |
| 16 | command! -narg=0 WinResizeToUp5 :call s:WinResize( 0, -5) |
| 17 | command! -narg=0 WinResizeToDown1 :call s:WinResize( 0, 1) |
| 18 | command! -narg=0 WinResizeToDown5 :call s:WinResize( 0, 5) |
| 19 | |
| 20 | " map |
| 21 | nmap <M-Right> :WinResizeToRight1<CR> |
| 22 | nmap <S-M-Right> :WinResizeToRight5<CR> |
| 23 | nmap <M-Left> :WinResizeToLeft1<CR> |
| 24 | nmap <S-M-Left> :WinResizeToLeft5<CR> |
| 25 | nmap <M-Up> :WinResizeToUp1<CR> |
| 26 | nmap <S-M-Up> :WinResizeToUp5<CR> |
| 27 | nmap <M-Down> :WinResizeToDown1<CR> |
| 28 | nmap <S-M-Down> :WinResizeToDown5<CR> |
| 29 | |
| 30 | " &columns += &columns + a:columns |
| 31 | " &lines += &lines + a:lines |
| 32 | function! s:WinResize(columns, lines) |
| 33 | let &columns += a:columns |
| 34 | let &lines += a:lines |
| 35 | endfunction |
| 36 | |
| 37 | let &cpo = s:save_cpo |
| 38 | finish |
| 39 | |
| 40 | ============================================================================== |
| 41 | winresize.vim : ウィンドウサイズコントロールスクリプト |
| 42 | ------------------------------------------------------------------------------ |
| 43 | $VIMRUNTIMEPATH/plugin/winresize.vim |
| 44 | ============================================================================== |
| 45 | author : 小見 拓 |
| 46 | url : http://nanasi.jp/ |
| 47 | email : mail@nanasi.jp |
| 48 | version : 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 | |