random
random

Reputation: 183

Vim project plugin \R not refreshing new directories created

I'm using the vim project plugin to manage a project, and whenever a new file goes in I need to use \R to refresh the project tree. This is fine, but I recently created a new directory in the tree, and \R doesn't update it and put it into the project.

What am I doing wrong?

Upvotes: 1

Views: 1895

Answers (3)

pedro mota
pedro mota

Reputation: 11

If you need to update one only folder, you can add it manually on the form:

folder=folder {
}

Then position the cursor above the folder line and hit '\R'. That will populate with the files but not with subfolders.

I found that for several folders, it is faster to delete the project and recreate it with '\C'.

Under GnomeVim (GVim) and MacVim it opens the GUI folder window waiting for a file to be selected for the project root folder. It's a no go. Better do it on a terminal, inserting the full root path.

Upvotes: 0

DrAl
DrAl

Reputation: 72696

\R only updates the folds. The only satisfactory ways I've found to do add new directories is either to remove the entry and re-run \C to create the project again (I only tend to use this if there are a lot of new directories to include) or to add the directory manually like this:

Name=Path {
}

and then hit \r in that fold.

Although I've find this frustrating at times, I tend to consider it a feature now: I have a Documentation directory in my project, which contains all of the doxygen generated files and directories, of which there are masses. If I use \C after running doxygen, there are a ridiculous number of folds, so I then delete them from the list. \R then doesn't re-add them, which is a good thing.

It also means I can have (for example) a daft folder structure like this:

Project/
    Source/
        File1.c
        File2.c
    Headers/
        File1.h
        File2.h
    LibraryModules/
        FreeRTOS/
            Source/
                RTOSSource.c
                portable/
                    RVDS/
                        ARM_CM3/
                            port.c

and have it displayed as:

Project=/path/to/Project {
  Source=Source {
    File1.c
    File2.c
  }
  Headers=Headers {
    File1.h
    File2.h
  }
  LibraryModules=LibraryModules {
    FreeRTOSSource=FreeRTOS/Source {
      RTOSSource.c
    }
    FreeRTOSPort=FreeRTOS/Source/portable/RVDS/ARM_CM3 {
      port.c
    }
  }
}

which is at least a BIT more manageable.

Upvotes: 2

Habi
Habi

Reputation: 3300

My understanding is that \R updates folds of the project plugin recursively not directories in which the files are stored. To include a directory you have to set the filter accordingly, e.g.:

filter="newdirectory/*.c *.c *.h"

Upvotes: 0

Related Questions