简体   繁体   中英

What does vim ` char mean?

I am looking around to try and understand a line of code via latest snipMate plugin source.

The statement appears at the autoload section of the plugin

for expr in s:snippet_filenames(scope,escape(a:trigger, "*[]?{}`'$|#%"))
     for path in g:snipMate.snippet_dirs
           for file in s:Glob(path, expr)
                source `=file`    <-----
           endfor
     endfor
endfor

The above code iterates over all files found in the snippet folder and executes the source statement - but what exactly does it do? what does =file means?

See :help `= . Basically, it will evaluate file as a VimL expression, then insert the result into the command line. Eg echo `="file" . "name"` echo `="file" . "name"` will expand to echo filename , and will print the value of the variable filename .

In your case, for example, if file is ticks.txt , source `=file` will execute source ticks.txt .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM