commit 8d91ea755719a764bad129b915e048d4e847e7a3 Author: omi taku Date: Thu Jul 31 00:00:00 2008 +0000 Version 0.5: Initial upload diff --git a/README b/README new file mode 100644 index 0000000..2fd9591 --- /dev/null +++ b/README @@ -0,0 +1,19 @@ +This is a mirror of http://www.vim.org/scripts/script.php?script_id=2321 + +Control Vim editor font size with key "+", or key "-". +Press "+" key, Vim editor gui font size will change bigger. +And, press "-" key, Vim editor gui font size will change smaller. + +This plugin is for GUI only. + + +Normal Mode: + + ... change font size bigger + - ... change font size smaller + +Command-line Mode: + :ZoomIn ... change font size bigger + :ZoomOut ... change font size smaller + :ZoomReset ... reset font size changes. + + diff --git a/plugin/zoom.vim b/plugin/zoom.vim new file mode 100644 index 0000000..fcd8fa6 --- /dev/null +++ b/plugin/zoom.vim @@ -0,0 +1,82 @@ +if &cp || exists("g:loaded_zoom") + finish +endif +let g:loaded_zoom = 1 + +let s:save_cpo = &cpo +set cpo&vim + +" keep default value +let s:current_font = &guifont + +" command +command! -narg=0 ZoomIn :call s:ZoomIn() +command! -narg=0 ZoomOut :call s:ZoomOut() +command! -narg=0 ZoomReset :call s:ZoomReset() + +" map +nmap + :ZoomIn +nmap - :ZoomOut + +" guifont size + 1 +function! s:ZoomIn() + let l:fsize = substitute(&guifont, '^.*:h\([^:]*\).*$', '\1', '') + let l:fsize += 1 + let l:guifont = substitute(&guifont, ':h\([^:]*\)', ':h' . l:fsize, '') + let &guifont = l:guifont +endfunction + +" guifont size - 1 +function! s:ZoomOut() + let l:fsize = substitute(&guifont, '^.*:h\([^:]*\).*$', '\1', '') + let l:fsize -= 1 + let l:guifont = substitute(&guifont, ':h\([^:]*\)', ':h' . l:fsize, '') + let &guifont = l:guifont +endfunction + +" reset guifont size +function! s:ZoomReset() + let &guifont = s:current_font +endfunction + +let &cpo = s:save_cpo +finish + +============================================================================== +zoom.vim : control gui font size with "+" or "-" keys. +------------------------------------------------------------------------------ +$VIMRUNTIMEPATH/plugin/zoom.vim +============================================================================== +author : OMI TAKU +url : http://nanasi.jp/ +email : mail@nanasi.jp +version : 2008/07/18 10:00:00 +============================================================================== + +Control Vim editor font size with key "+", or key "-". +Press "+" key, Vim editor gui font size will change bigger. +And, press "-" key, Vim editor gui font size will change smaller. + +This plugin is for GUI only. + + +Normal Mode: + + ... change font size bigger + - ... change font size smaller + +Command-line Mode: + :ZoomIn ... change font size bigger + :ZoomOut ... change font size smaller + :ZoomReset ... reset font size changes. + +============================================================================== + +1. Copy the zoom.vim script to + $HOME/vimfiles/plugin or $HOME/.vim/plugin directory. + Refer to ':help add-plugin', ':help add-global-plugin' and + ':help runtimepath' for more details about Vim plugins. + +2. Restart Vim. + +============================================================================== +" vim: set ff=unix et ft=vim nowrap :