Specify Multiple Directories in Notepad++ Find in Files - replace

Notepad++'s "Find in Files" is amazingly helpful. But I want to specify a bunch of directories in which the search should take place.
Above you see me add the wildcards to the "Directory" field:
C:\*\vc90\*
However my version of Notepad++ doesn't seem to tolerate asterisks in the path.
I have about 30 Visual Studio Projects who's names I want to be grabbed by the first asterisks in the path, but I only want to modify files in the vc90 version of these projects (not vc80, vc100, etc.), and I don't want to have to go individually specify each of the directories.
Is there some other recourse for me?

PowerGREP
While it's not Notepad++, and it's not free, PowerGREP can do what you're looking for. You can download an evaluation version, which appears to still be working on my machine, months later.
I created a few mock files/folders and it seems to work as you expect. There are options to create backups, etc.

VSCode is free and supports wilcards for both files and paths in search/replace operations.

Related

cmake project include dirs detection in vim editor [duplicate]

I have a cmake project. I want to do the following easily
search the declaration, definition and references of any variable, function, etc. under the cursor, which may be declared in an external header file whose path is added using INCLUDE_DIRECTORIES in CMakeLists.txt
rename a variable, function, etc. that is declared in the project
How can I set this up?
You can try to use vim plugin cmake4vim in order to integrate CMake to Vim.
This plugin helps to work with cmake targets and allows to generate compilation database file (compile_commands.json). A lot of plugins use this file for code completion, jump to definition and etc. (for example YCM)
Also you can use vim lsp plugins (for example vim-lsp) these plugins use language servers for code completion, refactoring and another good features.
But CMake project integration (cmake cache generation, project compilation, etc.) and search the declaration, definition and etc are different tasks. And different plugins and tools solve these tasks.
You can tell Vim where to look for includes by adding entries to the path option. I don't have enough experience with Cmake to know how to pull paths from CMakeLists.txt, though.
See :help 'path'.
Assuming a properly set path, it is possible to use the built-in :dsearch and related commands to search for definitions across includes.
The define option has a prescriptive name but it could be used to find any specific pattern so you could alter it to match declarations, too, or really anything.
See :help include-search and :help 'define'.
Vim has no built-in concept of "reference". :isearch and friends should work for that but they will probably be too noisy.
Renaming is usually done with something like:
:grep foo paths
:cwindow
:cdo s/foo/bar/gc
YouCompleteMe will help you. It uses compilation_database.json, witch can be generated by cmake.
This plugin also provides autocompetion for many languages.
I use functions in vim and assign them to a hotkey.
https://developer.ibm.com/tutorials/l-vim-script-2/
it gives you more an IDE feel. but at the end of the day you get a bit more control.

Per-project options in Visual Lint?

I've used Visual Lint (as a frontend for PC-lint) in the past and somehow configured it to use a different options.lnt file for different projects. My recollection, which might be incorrect, is that it was configured to automatically pick up anything called "options.lnt" in any project's directory - i.e. I didn't have to configure this for each project individually.
So for example I might have two projects, ProjX and ProjY, and I might have different options.lnt files in each of them:
C:\MyProjects\ProjX\options.lnt
C:\MyProjects\ProjY\options.lnt
Possibly those might refer to certain sets of general options stored in other files; for example I have C:\MyProjects\Lint\options.lnt for very general things, and then more specific options files for things related to certain packages; for example I have C:\MyProjects\Lint\options_boost.lnt for use by projects that use Boost. So if ProjX uses Boost, C:\MyProjects\ProjX\options.lnt will contain (at least) the lines:
C:\MyProjects\Lint\options.lnt
C:\MyProjects\Lint\options_boost.lnt
Whereas perhaps ProjY doesn't use Boost, and so its options.lnt would have the "general" line, but not the Boost-specific line.
This was all working fine, but I've migrated to a new computer, and I can't seem to get it working again. When I run Visual Lint against ProjX, it shows messages that should be suppressed by (for example) entries in C:\MyProjects\Lint\options_boost.lnt.
I have gone into Visual Lint's "Tools / Options", and under the "Analysis" tab, I have set "Preferred Analysis method" to "Per project". I have the Professional edition, which I believe is required for this functionality. I am using version 5 (whereas the previous machine, on which this was working, was version 4).
Am I perhaps missing some additional configuration I need to set up in order to get Visual Lint to pay attention to the project's options file?
Answering my own question:
In Visual Lint, go to Tools / Options / PC-lint. In there, there's a "Configuration" field, containing the name of a *.lnt file (like C:\Lint\std.lnt) that applies to anything you do in PC-lint via Visual Lint. Edit that file to contain the line:
options.lnt
Without specifying a full path. That seems to make it pick up the copy of options.lnt from the project's directory, and that file can then contain the more specific lines as shown in the question, such as:
C:\MyProjects\Lint\options.lnt
C:\MyProjects\Lint\options_boost.lnt

How can I rename multiple files in Eclipse?

I'd like to rename multiple files(/resources) in Eclipse.
Functionality by order of usefulness:
Rename files in search results (i.e. search for pattern, see which files match
Rename files using a regexp which runs on all filenames (e.g. s/stuff(.*)\.c/stuff\1.c.old/)
Rename files in the selection in the package explorer (F2 doesn't do this...)
How can I do this? Is there a relevant add-on maybe?
May be you can use Jalopy, unfortunately its not free. Am not sure how usefull it can be in your case.

C/C++ editor that can create projects from lists of files

I recently asked a question about importing from a list of source/header files in Eclipse
I haven't found a good solution to this, so I thought I'd check out other IDEs. I want an IDE that does not need to "own" everything from a top directory and down. When creating a new project I want to have a text file that lists source/header files (autogenerated by the build tool), and have the IDE create a project with those files. The only IDE I know of that does this is SlickEdit, which is great, but also rather expensive. Do you know of any other IDEs that have this feature.
Eclipse wants to own everything in the directory I pointed it to, and I haven't found a way to remove subfolders afterwards (to exclude them from search, indexing and annoying me).
I think CMake can be helpful for you.
Emacs does all this, and more. The desktop feature lets you store a set of files to load and save in a working directory, and the Emacs Code Browser (ECB) extension has support for browsing files and classes, and managing projects. It doesn't own anything, Emacs just gives you lots of tools to manipulate text in godly ways. Along with ECB, SpeedBar and a few other extensions, CEDET is an Emacs "meta"-extension which turns the venerable editor into an IDE. It even does UML!
Emacs IDE: CEDET
Code::Blocks can do this for you.

Should I add .vcxproj.filter files to source control?

While evaluating Visual Studio 2010 Beta 2, I see that in the converted directory, my vcproj files became vcxproj files. There are also vcxproj.filter files alongside each project which appear to contain a description of the folder structure (\Source Files, \Header Files, etc.).
Do you think these filter files should be kept per-user, or should they be shared across the whole dev group and checked into SCC?
My current thinking is to check them in, but I wonder if there are any reasons not to do that, or perhaps good reasons why I should definitely check them in.
The obvious benefit is that the folder structures will match if I'm looking at someone else's machine, but maybe they'd like to reorganize things logically?
We intentionally pulled the .filter. file information out of the .vcproj when we translated to the .vcxproj MSBuild format.
One reason is exactly what you pointed out, that the filters are purely a logical view, and different team members may want different views.
The other is that sometimes the build is set up to check the timestamp of the project file, and trigger a rebuild if it has changed - because that may mean there are different source files to build, or different settings, etc. I don't recall if we actually shipped with the build trigging that way, but the idea was that we did not want to trigger a rebuild simply because the filters changed, as they don't affect the build.
Previous versions of Visual Studio (at least versions 6.0 and 2008) store that information in their own project file (.dsp and .vcproj files respectively), which of course is good to add to SCC.
I cannot think of any reason to not include this .filter files in SCC
I just found that if you use Git you can mark .filter files to be treated as a union for merging to make it simpler. Just add the line:
*.vcxproj.filters merge=union
to your .gitattributes file.
See Using .gitattributes to avoid merge conflicts for more details.
It should not be added in case you use CMake (or similar build tools) to generate files like *.sln, *.vcxproj, *.vcxproj.filters etc., because this files may contain full path to your Project Folder and other only your computer's specific folders.