简体   繁体   English

通过project.vim将文件添加到项目

[英]Adding a file to a project via project.vim

I'm using project.vim to manage a project, and I'm having trouble adding a file to the project. 我正在使用project.vim来管理项目,但是在向该项目添加文件时遇到了麻烦。 I read the documentation and it said to 'insert the filename into the project entry, then hit return on it'. 我阅读了文档,并说“将文件名插入项目条目,然后按回车键”。

From what I understand, a project entry is one of the sections in the project window that looks like... 据我了解,项目条目是项目窗口中如下所示的部分之一:

 Header Files="Header Files" { 
 // header files listed here 
 } 

so if I go into that list, and insert say, Foo.h, Foo.h should show up in that directory on my system. 因此,如果我进入该列表并插入Foo.h,则Foo.h应该会显示在系统的该目录中。 However, it doesn't. 但是,事实并非如此。 I'm sure I'm doing something wrong, any help is appreciated, thanks. 我确定我做错了,感谢您的帮助。

I don't think project.vim has any support for directly creating files. 我认为project.vim不支持直接创建文件。 If you have created a project entry for an existing directory, something like this: 如果为现有目录创建了项目条目,则如下所示:

Project Name=/path/to/my/project filter="*.c *.h" {
  Header Files=Headers {
  }
  Source Files=Source {
  }
}

You should be able to put the cursor on the "Header Files" line and press \\r to add all the files that are in the directory. 您应该能够将光标放在“ Header Files”行上,然后按\\r添加目录中的所有文件。 Pressing ENTER on any of the files will open it. 在任何文件上按ENTER键将其打开。

There's no 'direct' way to create new files, but you can go into the Headers section and enter "Foo.h". 没有创建新文件的“直接”方法,但是您可以进入“标题”部分并输入“ Foo.h”。 This won't create a file, but if you press ENTER on your new entry, vim will open the non-existent file and you can use :w to create it. 这不会创建文件,但是如果在新条目上按ENTER ,vim将打开不存在的文件,您可以使用:w来创建它。

Hope that helps. 希望能有所帮助。

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

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