代码拉取完成,页面将自动刷新
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>if_mzsch - Vim Documentation</title>
<meta name="Generator" content="Vim/8.0">
<meta name="plugin-version" content="vim8.0">
<meta name="syntax" content="help">
<meta name="settings" content="no_pre,use_css,expand_tabs">
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="jquery.min.js" type="text/javascript"></script>
<script src="mark-current-page.js" type="text/javascript"></script>
</head>
<body>
<header>
<div class="header">
<a href="http://vim-jp.org/">vim-jp</a>
/ <a href="http://vim-jp.org/vimdoc-en/">vimdoc-en</a>
/ if_mzsch<br />
<a name="top"></a><h1>if_mzsch - Vim Documentation</h1>
<a href="index.html">Return to main</a>
<span class="EnglishJapaneseLink">
<span class="CurrentLanguage">English</span>
</span>
</div>
</header>
<nav>
<dl>
<dt>BASIC</dt>
<dd><ul>
<li><a href="quickref.html">quickref</a></li>
<li><a href="sponsor.html">sponsor</a></li>
</ul></dd>
<dt>USER MANUAL</dt>
<dd><ul>
<li><a href="usr_toc.html">usr_toc</a></li>
</ul></dd>
<dt>Getting Started</dt>
<dd><ul>
<li><a href="usr_01.html">usr_01</a></li>
<li><a href="usr_02.html">usr_02</a></li>
<li><a href="usr_03.html">usr_03</a></li>
<li><a href="usr_04.html">usr_04</a></li>
<li><a href="usr_05.html">usr_05</a></li>
<li><a href="usr_06.html">usr_06</a></li>
<li><a href="usr_07.html">usr_07</a></li>
<li><a href="usr_08.html">usr_08</a></li>
<li><a href="usr_09.html">usr_09</a></li>
<li><a href="usr_10.html">usr_10</a></li>
<li><a href="usr_11.html">usr_11</a></li>
<li><a href="usr_12.html">usr_12</a></li>
</ul></dd>
<dt>Editing Effectively</dt>
<dd><ul>
<li><a href="usr_20.html">usr_20</a></li>
<li><a href="usr_21.html">usr_21</a></li>
<li><a href="usr_22.html">usr_22</a></li>
<li><a href="usr_23.html">usr_23</a></li>
<li><a href="usr_24.html">usr_24</a></li>
<li><a href="usr_25.html">usr_25</a></li>
<li><a href="usr_26.html">usr_26</a></li>
<li><a href="usr_27.html">usr_27</a></li>
<li><a href="usr_28.html">usr_28</a></li>
<li><a href="usr_29.html">usr_29</a></li>
<li><a href="usr_30.html">usr_30</a></li>
<li><a href="usr_31.html">usr_31</a></li>
<li><a href="usr_32.html">usr_32</a></li>
</ul></dd>
<dt>Tuning Vim</dt>
<dd><ul>
<li><a href="usr_40.html">usr_40</a></li>
<li><a href="usr_41.html">usr_41</a></li>
<li><a href="usr_42.html">usr_42</a></li>
<li><a href="usr_43.html">usr_43</a></li>
<li><a href="usr_44.html">usr_44</a></li>
<li><a href="usr_45.html">usr_45</a></li>
</ul></dd>
<dt>Making Vim Run</dt>
<dd><ul>
<li><a href="usr_90.html">usr_90</a></li>
</ul></dd>
<dt>General subjects</dt>
<dd><ul>
<li><a href="intro.html">intro</a></li>
<li><a href="index.html">help</a></li>
<li><a href="helphelp.html">helphelp</a></li>
<li><a href="vimindex.html">index</a></li>
<li><a href="tags.html">tags</a></li>
<li><a href="howto.html">howto</a></li>
<li><a href="tips.html">tips</a></li>
<li><a href="message.html">message</a></li>
<li><a href="quotes.html">quotes</a></li>
<li><a href="todo.html">todo</a></li>
<li><a href="debug.html">debug</a></li>
<li><a href="develop.html">develop</a></li>
<li><a href="uganda.html">uganda</a></li>
</ul></dd>
<dt>Basic editing</dt>
<dd><ul>
<li><a href="starting.html">starting</a></li>
<li><a href="editing.html">editing</a></li>
<li><a href="motion.html">motion</a></li>
<li><a href="scroll.html">scroll</a></li>
<li><a href="insert.html">insert</a></li>
<li><a href="change.html">change</a></li>
<li><a href="indent.html">indent</a></li>
<li><a href="undo.html">undo</a></li>
<li><a href="repeat.html">repeat</a></li>
<li><a href="visual.html">visual</a></li>
<li><a href="various.html">various</a></li>
<li><a href="recover.html">recover</a></li>
</ul></dd>
<dt>Advanced editing</dt>
<dd><ul>
<li><a href="cmdline.html">cmdline</a></li>
<li><a href="options.html">options</a></li>
<li><a href="pattern.html">pattern</a></li>
<li><a href="map.html">map</a></li>
<li><a href="tagsrch.html">tagsrch</a></li>
<li><a href="quickfix.html">quickfix</a></li>
<li><a href="windows.html">windows</a></li>
<li><a href="tabpage.html">tabpage</a></li>
<li><a href="syntax.html">syntax</a></li>
<li><a href="spell.html">spell</a></li>
<li><a href="diff.html">diff</a></li>
<li><a href="autocmd.html">autocmd</a></li>
<li><a href="filetype.html">filetype</a></li>
<li><a href="eval.html">eval</a></li>
<li><a href="channel.html">channel</a></li>
<li><a href="fold.html">fold</a></li>
</ul></dd>
<dt>Special issues</dt>
<dd><ul>
<li><a href="print.html">print</a></li>
<li><a href="remote.html">remote</a></li>
<li><a href="term.html">term</a></li>
<li><a href="digraph.html">digraph</a></li>
<li><a href="mbyte.html">mbyte</a></li>
<li><a href="mlang.html">mlang</a></li>
<li><a href="arabic.html">arabic</a></li>
<li><a href="farsi.html">farsi</a></li>
<li><a href="hebrew.html">hebrew</a></li>
<li><a href="russian.html">russian</a></li>
<li><a href="ft_ada.html">ft_ada</a></li>
<li><a href="ft_sql.html">ft_sql</a></li>
<li><a href="hangulin.html">hangulin</a></li>
<li><a href="rileft.html">rileft</a></li>
</ul></dd>
<dt>GUI</dt>
<dd><ul>
<li><a href="gui.html">gui</a></li>
<li><a href="gui_w32.html">gui_w32</a></li>
<li><a href="gui_x11.html">gui_x11</a></li>
</ul></dd>
<dt>Interfaces</dt>
<dd><ul>
<li><a href="if_cscop.html">if_cscop</a></li>
<li><a href="if_lua.html">if_lua</a></li>
<li><a href="if_mzsch.html">if_mzsch</a></li>
<li><a href="if_perl.html">if_perl</a></li>
<li><a href="if_pyth.html">if_pyth</a></li>
<li><a href="if_tcl.html">if_tcl</a></li>
<li><a href="if_ole.html">if_ole</a></li>
<li><a href="if_ruby.html">if_ruby</a></li>
<li><a href="debugger.html">debugger</a></li>
<li><a href="workshop.html">workshop</a></li>
<li><a href="netbeans.html">netbeans</a></li>
<li><a href="sign.html">sign</a></li>
</ul></dd>
<dt>Versions</dt>
<dd><ul>
<li><a href="vi_diff.html">vi_diff</a></li>
<li><a href="version4.html">version4</a></li>
<li><a href="version5.html">version5</a></li>
<li><a href="version6.html">version6</a></li>
<li><a href="version7.html">version7</a></li>
<li><a href="version8.html">version8</a></li>
</ul></dd>
<dt>Remarks about specific systems</dt>
<dd><ul>
<li><a href="os_390.html">os_390</a></li>
<li><a href="os_amiga.html">os_amiga</a></li>
<li><a href="os_beos.html">os_beos</a></li>
<li><a href="os_dos.html">os_dos</a></li>
<li><a href="os_mac.html">os_mac</a></li>
<li><a href="os_mint.html">os_mint</a></li>
<li><a href="os_msdos.html">os_msdos</a></li>
<li><a href="os_os2.html">os_os2</a></li>
<li><a href="os_qnx.html">os_qnx</a></li>
<li><a href="os_risc.html">os_risc</a></li>
<li><a href="os_unix.html">os_unix</a></li>
<li><a href="os_vms.html">os_vms</a></li>
<li><a href="os_win32.html">os_win32</a></li>
</ul></dd>
<dt>Standard plugins</dt>
<dd><ul>
<li><a href="pi_getscript.html">pi_getscript</a></li>
<li><a href="pi_gzip.html">pi_gzip</a></li>
<li><a href="pi_logipat.html">pi_logipat</a></li>
<li><a href="pi_netrw.html">pi_netrw</a></li>
<li><a href="pi_paren.html">pi_paren</a></li>
<li><a href="pi_tar.html">pi_tar</a></li>
<li><a href="pi_vimball.html">pi_vimball</a></li>
<li><a href="pi_zip.html">pi_zip</a></li>
</ul></dd>
<dt>Filetype plugins</dt>
<dd><ul>
<li><a href="pi_spec.html">pi_spec</a></li>
</ul></dd>
<dt>Others</dt>
<dd><ul>
<li><a href="vim_faq.html">vim_faq</a></li>
</ul></dd>
</dl>
</nav>
<article class="Vimdoc VimdocJa">
<div id='vimCodeElement'>
<a class="Constant" href="if_mzsch.html" name="if_mzsch.txt">if_mzsch.txt</a> For <span class="Identifier">Vim version 8.0.</span> Last change: 2016 Jan 24<br>
<br>
<br>
<span class="Identifier">VIM REFERENCE MANUAL by Sergey Khorev</span><br>
<br>
<br>
The MzScheme Interface to Vim <a class="Constant" href="if_mzsch.html#mzscheme" name="mzscheme">mzscheme</a> <a class="Constant" href="if_mzsch.html#MzScheme" name="MzScheme">MzScheme</a><br>
<br>
1. Commands <a class="Identifier" href="if_mzsch.html#mzscheme-commands">mzscheme-commands</a><br>
2. Examples <a class="Identifier" href="if_mzsch.html#mzscheme-examples">mzscheme-examples</a><br>
3. Threads <a class="Identifier" href="if_mzsch.html#mzscheme-threads">mzscheme-threads</a><br>
4. Vim access from MzScheme <a class="Identifier" href="if_mzsch.html#mzscheme-vim">mzscheme-vim</a><br>
5. mzeval() Vim function <a class="Identifier" href="if_mzsch.html#mzscheme-mzeval">mzscheme-mzeval</a><br>
6. Using Function references <a class="Identifier" href="if_mzsch.html#mzscheme-funcref">mzscheme-funcref</a><br>
7. Dynamic loading <a class="Identifier" href="if_mzsch.html#mzscheme-dynamic">mzscheme-dynamic</a><br>
8. MzScheme setup <a class="Identifier" href="if_mzsch.html#mzscheme-setup">mzscheme-setup</a><br>
<br>
<span class="Special">{Vi does not have any of these commands}</span><br>
<br>
The MzScheme interface is available only if Vim was compiled with the<br>
<a class="Identifier" href="various.html#+mzscheme">+mzscheme</a> feature.<br>
<br>
Based on the work of Brent Fulgham.<br>
Dynamic loading added by Sergey Khorev<br>
<br>
MzScheme and PLT Scheme names have been rebranded as Racket. For more<br>
information please check <span class="Constant"><a href="http://racket-lang.org">http://racket-lang.org</a></span><br>
<br>
Futures and places of Racket version 5.x up to and including 5.3.1 do not<br>
work correctly with processes created by Vim.<br>
The simplest solution is to build Racket on your own with these features<br>
disabled:<br>
<div class="helpExample"> ./configure --disable-futures --disable-places --prefix=your-install-prefix</div>
<br>
To speed up the process, you might also want to use --disable-gracket and<br>
--disable-docs<br>
<br>
<span class="PreProc">==============================================================================</span><br>
1. Commands <a class="Constant" href="if_mzsch.html#mzscheme-commands" name="mzscheme-commands">mzscheme-commands</a><br>
<br>
<a class="Constant" href="if_mzsch.html#:mzscheme" name=":mzscheme">:mzscheme</a> <a class="Constant" href="if_mzsch.html#:mz" name=":mz">:mz</a><br>
:<span class="Special">[range]</span>mz[scheme] <span class="Special">{stmt}</span><br>
Execute MzScheme statement <span class="Special">{stmt}</span>. <span class="Special">{not in Vi}</span><br>
<br>
:<span class="Special">[range]</span>mz[scheme] << <span class="Special">{endmarker}</span><br>
<span class="Special">{script}</span><br>
<span class="Special">{endmarker}</span><br>
Execute inlined MzScheme script <span class="Special">{script}</span>.<br>
<span class="Todo">Note</span>: This command doesn't work if the MzScheme<br>
feature wasn't compiled in. To avoid errors, see<br>
<a class="Identifier" href="if_perl.html#script-here">script-here</a>.<br>
<br>
<a class="Constant" href="if_mzsch.html#:mzfile" name=":mzfile">:mzfile</a> <a class="Constant" href="if_mzsch.html#:mzf" name=":mzf">:mzf</a><br>
:<span class="Special">[range]</span>mzf[ile] <span class="Special">{file}</span> Execute the MzScheme script in <span class="Special">{file}</span>. <span class="Special">{not in Vi}</span><br>
<br>
All of these commands do essentially the same thing - they execute a piece of<br>
MzScheme code, with the "current range" set to the given line<br>
range.<br>
<br>
In the case of :mzscheme, the code to execute is in the command-line.<br>
In the case of :mzfile, the code to execute is the contents of the given file.<br>
<br>
MzScheme interface defines exception exn:vim, derived from exn.<br>
It is raised for various Vim errors.<br>
<br>
During compilation, the MzScheme interface will remember the current MzScheme<br>
collection path. If you want to specify additional paths use the<br>
'current-library-collection-paths' parameter. E.g., to cons the user-local<br>
MzScheme collection path:<br>
<div class="helpExample"> :mz << EOF<br>
(current-library-collection-paths<br>
(cons<br>
(build-path (find-system-path 'addon-dir) (version) "collects")<br>
(current-library-collection-paths)))<br>
EOF</div>
<br>
<br>
All functionality is provided through module vimext.<br>
<br>
The exn:vim is available without explicit import.<br>
<br>
To avoid clashes with MzScheme, consider using prefix when requiring module,<br>
e.g.:<br>
<div class="helpExample"> :mzscheme (require (prefix vim- vimext))</div>
<br>
All the examples below assume this naming scheme. <br>
<br>
<a class="Constant" href="if_mzsch.html#mzscheme-sandbox" name="mzscheme-sandbox">mzscheme-sandbox</a><br>
When executed in the <a class="Identifier" href="eval.html#sandbox">sandbox</a>, access to some filesystem and Vim interface<br>
procedures is restricted.<br>
<br>
<span class="PreProc">==============================================================================</span><br>
2. Examples <a class="Constant" href="if_mzsch.html#mzscheme-examples" name="mzscheme-examples">mzscheme-examples</a><br>
<br>
<div class="helpExample"> :mzscheme (display "Hello")<br>
:mz (display (string-append "Using MzScheme version " (version)))<br>
:mzscheme (require (prefix vim- vimext)) ; for MzScheme < 4.x<br>
:mzscheme (require (prefix-in vim- 'vimext)) ; MzScheme 4.x<br>
:mzscheme (vim-set-buff-line 10 "This is line #10")</div>
<br>
To see what version of MzScheme you have:<br>
<div class="helpExample"> :mzscheme (display (version))</div>
<br>
Inline script usage:<br>
<div class="helpExample"> function! <SID>SetFirstLine()<br>
:mz << EOF<br>
(display "!!!")<br>
(require (prefix vim- vimext))<br>
; for newer versions (require (prefix-in vim- 'vimext))<br>
(vim-set-buff-line 1 "This is line #1")<br>
(vim-beep)<br>
EOF<br>
endfunction</div>
<br>
<div class="helpExample"> nmap <F9> :call <SID>SetFirstLine() <CR></div>
<br>
File execution:<br>
<div class="helpExample"> :mzfile supascript.scm</div>
<br>
Vim exception handling:<br>
<div class="helpExample"> :mz << EOF<br>
(require (prefix vim- vimext))<br>
; for newer versions (require (prefix-in vim- 'vimext))<br>
(with-handlers<br>
([exn:vim? (lambda (e) (display (exn-message e)))])<br>
(vim-eval "nonsense-string"))<br>
EOF</div>
<br>
Auto-instantiation of vimext module (can be placed in your <a class="Identifier" href="starting.html#vimrc">vimrc</a>):<br>
<div class="helpExample"> function! MzRequire()<br>
:redir => l:mzversion<br>
:mz (version)<br>
:redir END<br>
if strpart(l:mzversion, 1, 1) < "4"<br>
" MzScheme versions < 4.x:<br>
:mz (require (prefix vim- vimext))<br>
else<br>
" newer versions:<br>
:mz (require (prefix-in vim- 'vimext))<br>
endif<br>
endfunction</div>
<br>
<div class="helpExample"> if has("mzscheme")<br>
silent call MzRequire()<br>
endif</div>
<br>
<span class="PreProc">==============================================================================</span><br>
3. Threads <a class="Constant" href="if_mzsch.html#mzscheme-threads" name="mzscheme-threads">mzscheme-threads</a><br>
<br>
The MzScheme interface supports threads. They are independent from OS threads,<br>
thus scheduling is required. The option <a class="Type" href="options.html#'mzquantum'">'mzquantum'</a> determines how often<br>
Vim should poll for available MzScheme threads.<br>
<span class="Todo">NOTE</span><br>
Thread scheduling in the console version of Vim is less reliable than in the<br>
GUI version.<br>
<br>
<span class="PreProc">==============================================================================</span><br>
4. Vim access from MzScheme <a class="Constant" href="if_mzsch.html#mzscheme-vim" name="mzscheme-vim">mzscheme-vim</a><br>
<br>
<a class="Constant" href="if_mzsch.html#mzscheme-vimext" name="mzscheme-vimext">mzscheme-vimext</a><br>
The <span class="MissingTag">'vimext'</span> module provides access to procedures defined in the MzScheme<br>
interface.<br>
<br>
Common<br>
<span class="PreProc">------</span><br>
(command <span class="Special">{command-string}</span>) Perform the vim ":Ex" style command.<br>
(eval <span class="Special">{expr-string}</span>) Evaluate the vim expression into<br>
respective MzScheme object: <a class="Identifier" href="eval.html#Lists">Lists</a> are<br>
represented as Scheme lists,<br>
<a class="Identifier" href="eval.html#Dictionaries">Dictionaries</a> as hash tables,<br>
<a class="Identifier" href="eval.html#Funcref">Funcref</a>s as functions (see also<br>
<a class="Identifier" href="if_mzsch.html#mzscheme-funcref">mzscheme-funcref</a>)<br>
<span class="Todo">NOTE</span> the name clashes with MzScheme eval,<br>
use module qualifiers to overcome this.<br>
(range-start) Start/End of the range passed with<br>
(range-end) the Scheme command.<br>
(beep) beep<br>
(get-option <span class="Special">{option-name}</span> <span class="Special">[buffer-or-window]</span>) Get Vim option value (either<br>
local or global, see set-option).<br>
(set-option <span class="Special">{string}</span> <span class="Special">[buffer-or-window]</span>)<br>
Set a Vim option. String must have option<br>
setting form (like optname=optval, or<br>
optname+=optval, etc.) When called with<br>
<span class="Special">{buffer}</span> or <span class="Special">{window}</span> the local option will<br>
be set. The symbol 'global can be passed<br>
as <span class="Special">{buffer-or-window}</span>. Then <a class="Identifier" href="options.html#:setglobal">:setglobal</a><br>
will be used.<br>
<br>
Buffers <a class="Constant" href="if_mzsch.html#mzscheme-buffer" name="mzscheme-buffer">mzscheme-buffer</a><br>
<span class="PreProc">-------</span><br>
(buff? <span class="Special">{object}</span>) Is object a buffer?<br>
(buff-valid? <span class="Special">{object}</span>) Is object a valid buffer? (i.e.<br>
corresponds to the real Vim buffer)<br>
(get-buff-line <span class="Special">{linenr}</span> <span class="Special">[buffer]</span>)<br>
Get line from a buffer.<br>
(set-buff-line <span class="Special">{linenr}</span> <span class="Special">{string}</span> <span class="Special">[buffer]</span>)<br>
Set a line in a buffer. If <span class="Special">{string}</span> is #f,<br>
the line gets deleted. The <span class="Special">[buffer]</span><br>
argument is optional. If omitted, the<br>
current buffer will be used.<br>
(get-buff-line-list <span class="Special">{start}</span> <span class="Special">{end}</span> <span class="Special">[buffer]</span>)<br>
Get a list of lines in a buffer. <span class="Special">{Start}</span><br>
and <span class="Special">{end}</span> are 1-based and inclusive.<br>
(set-buff-line-list <span class="Special">{start}</span> <span class="Special">{end}</span> <span class="Special">{string-list}</span> <span class="Special">[buffer]</span>)<br>
Set a list of lines in a buffer. If<br>
string-list is #f or null, the lines get<br>
deleted. If a list is shorter than<br>
<span class="Special">{end}</span>-<span class="Special">{start}</span> the remaining lines will<br>
be deleted.<br>
(get-buff-name <span class="Special">[buffer]</span>) Get a buffer's text name.<br>
(get-buff-num <span class="Special">[buffer]</span>) Get a buffer's number.<br>
(get-buff-size <span class="Special">[buffer]</span>) Get buffer line count.<br>
(insert-buff-line-list <span class="Special">{linenr}</span> <span class="Special">{string/string-list}</span> <span class="Special">[buffer]</span>)<br>
Insert a list of lines into a buffer after<br>
<span class="Special">{linenr}</span>. If <span class="Special">{linenr}</span> is 0, lines will be<br>
inserted at start.<br>
(curr-buff) Get the current buffer. Use other MzScheme<br>
interface procedures to change it.<br>
(buff-count) Get count of total buffers in the editor.<br>
(get-next-buff <span class="Special">[buffer]</span>) Get next buffer.<br>
(get-prev-buff <span class="Special">[buffer]</span>) Get previous buffer. Return #f when there<br>
are no more buffers.<br>
(open-buff <span class="Special">{filename}</span>) Open a new buffer (for file "name")<br>
(get-buff-by-name <span class="Special">{buffername}</span>) Get a buffer by its filename or #f<br>
if there is no such buffer.<br>
(get-buff-by-num <span class="Special">{buffernum}</span>) Get a buffer by its number (return #f if<br>
there is no buffer with this number).<br>
<br>
Windows <a class="Constant" href="if_mzsch.html#mzscheme-window" name="mzscheme-window">mzscheme-window</a><br>
<span class="PreProc">------</span><br>
(win? <span class="Special">{object}</span>) Is object a window?<br>
(win-valid? <span class="Special">{object}</span>) Is object a valid window (i.e. corresponds<br>
to the real Vim window)?<br>
(curr-win) Get the current window.<br>
(win-count) Get count of windows.<br>
(get-win-num <span class="Special">[window]</span>) Get window number.<br>
(get-win-by-num <span class="Special">{windownum}</span>) Get window by its number.<br>
(get-win-buffer <span class="Special">[window]</span>) Get the buffer for a given window.<br>
(get-win-height <span class="Special">[window]</span>)<br>
(set-win-height <span class="Special">{height}</span> <span class="Special">[window]</span>) Get/Set height of window.<br>
(get-win-width <span class="Special">[window]</span>)<br>
(set-win-width <span class="Special">{width}</span> <span class="Special">[window]</span>)Get/Set width of window.<br>
(get-win-list <span class="Special">[buffer]</span>) Get list of windows for a buffer.<br>
(get-cursor <span class="Special">[window]</span>) Get cursor position in a window as<br>
a pair (linenr . column).<br>
(set-cursor (line . col) <span class="Special">[window]</span>) Set cursor position.<br>
<br>
<span class="PreProc">==============================================================================</span><br>
5. mzeval() Vim function <a class="Constant" href="if_mzsch.html#mzscheme-mzeval" name="mzscheme-mzeval">mzscheme-mzeval</a><br>
<br>
To facilitate bi-directional interface, you can use <a class="Identifier" href="eval.html#mzeval()">mzeval()</a> function to<br>
evaluate MzScheme expressions and pass their values to Vim script.<br>
<br>
<span class="PreProc">==============================================================================</span><br>
6. Using Function references <a class="Constant" href="if_mzsch.html#mzscheme-funcref" name="mzscheme-funcref">mzscheme-funcref</a><br>
<br>
MzScheme interface allows use of <a class="Identifier" href="eval.html#Funcref">Funcref</a>s so you can call Vim functions<br>
directly from Scheme. For instance:<br>
<div class="helpExample"> function! MyAdd2(arg)<br>
return a:arg + 2<br>
endfunction<br>
mz (define f2 (vim-eval "function(\"MyAdd2\")"))<br>
mz (f2 7)</div>
or :<br>
<div class="helpExample"> :mz (define indent (vim-eval "function('indent')"))<br>
" return Vim indent for line 12<br>
:mz (indent 12)</div>
<br>
<br>
<span class="PreProc">==============================================================================</span><br>
7. Dynamic loading <a class="Constant" href="if_mzsch.html#mzscheme-dynamic" name="mzscheme-dynamic">mzscheme-dynamic</a> <a class="Constant" href="if_mzsch.html#E815" name="E815">E815</a><br>
<br>
On MS-Windows the MzScheme libraries can be loaded dynamically. The <a class="Identifier" href="various.html#:version">:version</a><br>
output then includes <a class="Identifier" href="various.html#+mzscheme/dyn">+mzscheme/dyn</a>.<br>
<br>
This means that Vim will search for the MzScheme DLL files only when needed.<br>
When you don't use the MzScheme interface you don't need them, thus you can<br>
use Vim without these DLL files.<br>
<span class="Todo">NOTE</span>: Newer version of MzScheme (Racket) require earlier (trampolined)<br>
initialisation via scheme_main_setup. So Vim always loads the MzScheme DLL at<br>
startup if possible.<br>
<br>
To use the MzScheme interface the MzScheme DLLs must be in your search path.<br>
In a console window type "path" to see what directories are used.<br>
<br>
The names of the DLLs must match the MzScheme version Vim was compiled with.<br>
For MzScheme version 209 they will be "libmzsch209_000.dll" and<br>
"libmzgc209_000.dll". To know for sure look at the output of the ":version"<br>
command, look for -DDYNAMIC_MZSCH_DLL="something" and<br>
-DDYNAMIC_MZGC_DLL="something" in the "Compilation" info.<br>
<br>
For example, if MzScheme (Racket) is installed at C:\Racket63, you may need<br>
to set the environment variable as the following:<br>
<br>
<div class="helpExample"> PATH=%PATH%;C:\Racket63\lib<br>
PLTCOLLECTS=C:\Racket63\collects<br>
PLTCONFIGDIR=C:\Racket63\etc</div>
<br>
<span class="PreProc">==============================================================================</span><br>
8. MzScheme setup <a class="Constant" href="if_mzsch.html#mzscheme-setup" name="mzscheme-setup">mzscheme-setup</a> <a class="Constant" href="if_mzsch.html#E895" name="E895">E895</a><br>
<br>
Vim requires "racket/base" module for if_mzsch core (fallback to "scheme/base"<br>
if it doesn't exist), "r5rs" module for test and "raco ctool" command for<br>
building Vim. If MzScheme did not have them, you can install them with<br>
MzScheme's raco command:<br>
<br>
<div class="helpExample"> raco pkg install scheme-lib # scheme/base module<br>
raco pkg install r5rs-lib # r5rs module<br>
raco pkg install cext-lib # raco ctool command</div>
<br>
<span class="PreProc">======================================================================</span><br>
vim:tw=78:ts=8:sts=4:ft=help:norl:<br>
</div>
</article>
<footer>
<a href="#top">Return to the top</a> - <a href="index.html">Return to main</a>
<span class="EnglishJapaneseLink">
<span class="CurrentLanguage">English</span>
</span>
<br />
<div style="text-align:right;">
Hosted by <a href="https://github.com/vim-jp/vimdoc-en">vimdoc-en project</a><br />
If you met any problem, please report it to <a href="https://github.com/vim-jp/vimdoc-en/issues">issue</a>.<br />
</div>
</footer>
<!--<script src="js/check-referrer.js" type="text/javascript"></script>-->
</body>
</html>
<!-- vim:set ts=8 sts=2 sw=2 tw=0 et: -->
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。