Skip to content

Display a text watermark over the Visual Studio editor by folder. For example, auto generated files in a folder can be watermarked with the relative path of the file from the project folder.

License

Notifications You must be signed in to change notification settings

tan00001/SubfolderWatermarks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SubfolderWatermarks

License: MIT Works with Visual Studio 2019 Works with Visual Studio 2022

Table of Contents

  1. What is SubfolderWatermarks
  2. Configuration
  3. Installation
  4. Acknowledgements
  5. License

What is SubfolderWatermarks

SubfolderWatermarks displays a text watermark over the Visual Studio editor for files in specific project subfolders. For example, you can mark auto-generated files with watermarks so that you do not accidentally edit them by mistake.

VS screenshot showing highlighted watermark

The highlighted text may appear as part of the text in the editor but is floating above it. It stays put when you scroll.

Configuration

Size, position, color, and text are fully configurable.

Go to Tools > Options and select Watermarks

Screenshot of Water Mark settings in the Options dialog

Use placeholders

Show something different for each file with placeholders. This can help you (or anyone looking at the screen) differentiate files more easily.

Simply enter one of the following in the configured Displayed text and it will be replaced when shown in the editor.

  • ${currentFilePathInProject} - is replaced with the relative path of the file in the project (within the solution). This is the default.
  • ${currentFileName} - is replaced with the name of the current file.
  • ${currentDirectoryName} - is replaced with the name of the directory (on disk) that contains the current file.
  • ${currentProjectName} - is replaced with the name of the project (within the solution) the file is in.

If any of the placeholders can't be resolved, they're replaced with an empty string.
You can use multiple placeholders at once and combine them with other text.
Placeholders are not case-sensitive.

Display Images

Display an image rather than text.

To do this, set the DisplayedText to start with IMG: immediately followed by an absolute path to the file to use.

Installation

You can install SubfolderWatermarks by going to the "Extensions" menu on the Visual Studio menu bar: Download SubfolderWatermarks in Visual Studio

You may also download SubfolderWatermarks from Visual Studio Marketplace.

Acknowledgements

I would like to express my gratitude to Mr. Matthew Lacey for his inspiring VSWaterMark project, which is the basis of this open source project. Because adding watermark by project subfolders did not fit into Mr. Lacey's plans for VSWaterMark, I created SubfolderWatermarks as a spin-off from VSWaterMark, and SubfolderWatermarks is now developed independently.

I greatly appreciate his dedication to creating valuable open source tools and encourage everyone to explore VSWaterMark at https://github.com/mrlacey/VSWaterMark/.

License

SubfolderWatermarks is under the MIT License.

About

Display a text watermark over the Visual Studio editor by folder. For example, auto generated files in a folder can be watermarked with the relative path of the file from the project folder.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages