简体   繁体   English

如何链接到vim中的另一个文件?

[英]How to link to another file in vim?

I downloaded the DrawIt plugin to draw a diagram in vim. 我下载了DrawIt插件以在vim中绘制图表。 I successfully installed that plugin. 我成功安装了该插件。 Then I found DrawIt.vba file in my home directory and opened the file. 然后我在我的主目录中找到了DrawIt.vba文件并打开了该文件。 It had the following content: 它有以下内容:

 " Vimball Archiver by Charles E. Campbell, Jr., Ph.D.
 UseVimball
 finish
 +-- 67 lines: plugin/DrawItPlugin.vim--------------------------------------------
 +--484 lines: plugin/cecutil.vim ------------------------------------------------
 +--1662 lines: autoload/DrawIt.vim-----------------------------------------------
 +--401 lines: doc/DrawIt.txt-----------------------------------------------------

In that file, I placed the cursor in the + (plus) and I pressed the right arrow key(->). 在该文件中,我将光标置于+(加号)上,然后按了右箭头键(->)。 It opens the specified path ( plugin/DrawItPlugin.vim ) of the file. 它打开文件的指定路径( plugin/DrawItPlugin.vim )。 I really wonder about that one. 我真的很想知道那个。

I want to create something like this. 我想创造这样的东西。 I searched in NET, but I didn't get any proper way to do it. 我在NET中进行搜索,但没有任何适当的方法来进行搜索。

Can you help me do this? 你能帮帮我吗?

Actually, that is not what is happening. 实际上,这不是正在发生的事情。

"Vimball" files are archive type files that contain number of other files in them. “Vimball”文件是存档类型文件,其中包含许多其他文件。 When you "source" such file, Vim extracts these files into specified paths, for example the content under plugin/DrawItPlugin.vim will get extracted into a file with that name inside your $VIM directory. 当您“获取”此类文件时,Vim会将这些文件提取到指定的路径中,例如, plugin/DrawItPlugin.vim下的内容将被解压缩到$VIM目录中具有该名称的文件中。

What you actually describe is an example of folding. 你实际描述的是一个折叠的例子。 Vim can "fold" parts of a file, so that they are hidden, and replaced by just one line. Vim可以“折叠”文件的一部分,以便它们被隐藏,并且只用一行代替。

+-- 67 lines: plugin/DrawItPlugin.vim--------------------------------------------

means that there is 67 lines of hidden content, starting with the text plugin/DrawItPlugin.vim . 意味着有67行隐藏内容,从文本plugin/DrawItPlugin.vim When you navigate the cursor into this text, it gets unfolded. 当您将光标导航到此文本时,它将展开。

Type :he folding in Vim to read the Vim help on folding. 类型:he folding在Vim中:he folding以阅读:he folding时的Vim帮助。

You can "jump" to a file whose path is under cursor with gf (goto file). 您可以使用gf (goto文件)“跳转”到路径位于光标下的文件。 Type :he gf for details. 输入:he gf以获得详细信息。

Finally, using the "VimWiki" plugin, you can create files that link to other files, in a Wiki fashion. 最后,使用“VimWiki”插件,您可以创建以Wiki方式链接到其他文件的文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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