Changing the default Source File Directory in Visual Studio

前端 未结 3 1988
盖世英雄少女心
盖世英雄少女心 2020-12-18 18:18

This is not a work-stopper in any way, but I thought I should ask anyway because it is a little annoying. Let\'s say I create a new project and start putting source

相关标签:
3条回答
  • 2020-12-18 18:35

    Changing the Default Project Folder may help. This page demonstrates how to change the default for Visual Studio 2005, and it should be the same for later versions.

    0 讨论(0)
  • 2020-12-18 18:47

    I had the same problem when I started using build systems (CMake, Premake) which requires me to keep my project files separate from my source files, which hampered my workflow.

    Although changing the default source directory seems impossible, if you aren't afraid to spend money, the workaround I found was to use the Visual Assist extension.

    • You can bind a shortcut of your choise to the Create File command which creates a new file relative to the directory or your open file.
    • I'd also recommend to base one's workflow around the wonderful Create from Usage command (which I think greatly boosts productivity) which almost eliminates the need to manually create files.

    The extension is great, albeit a bit costly. I would love to see Microsoft incorporate these features directly in the IDE eventually as they are found vanilla in a lot of other IDEs e.g. Eclipse, Intellij.

    There might be some free extensions available that does the same thing, but I haven't found any.

    0 讨论(0)
  • 2020-12-18 18:48

    I have run into the same nuisance. I like to put the public interface header files for a library in a separate directory, but end up with file directory typos because I forget to navigate to the correct directory when saving a new file. Unfortunately, Visual Studio does not offer a setting to change the default directory for new C++ source files.

    0 讨论(0)
提交回复
热议问题