mirror of
https://github.com/gryf/zoom.vim.git
synced 2026-02-09 05:05:44 +01:00
Version 0.5: Initial upload
This commit is contained in:
19
README
Normal file
19
README
Normal file
@@ -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.
|
||||||
|
|
||||||
|
|
||||||
82
plugin/zoom.vim
Normal file
82
plugin/zoom.vim
Normal file
@@ -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<CR>
|
||||||
|
nmap - :ZoomOut<CR>
|
||||||
|
|
||||||
|
" 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 :
|
||||||
Reference in New Issue
Block a user