Custom Selected Word Count

by banisterious
favorite
share
Score: 50/100
Description
Category: Note Enhancements

The Custom Selected Word Count plugin adds precise and flexible word counting for selected text across all editing modes. It goes far beyond the default functionality by allowing users to exclude specific file paths, file types, and even URL-like strings from counts. Advanced users can define their own regex patterns for detecting words, with an interactive test area to validate and refine these patterns. It also logs word count history with timestamps, making it useful for writing sessions or progress tracking. The detailed settings give fine control over behaviour, from path exclusion rules to UI preferences, making it highly customisable for both casual users and power users alike.

Stats
2
stars
180
downloads
0
forks
28
days
7
days
9
days
1
total PRs
0
open PRs
0
closed PRs
1
merged PRs
0
total issues
0
open issues
0
closed issues
0
commits
Latest Version
9 days ago
Changelog

Custom Selected Word Count v1.5.0

This release introduces powerful per-note exclusion overrides, improved UI organization, and comprehensive documentation updates.

Highlights

  • Per-note exclusion overrides - Override global settings for individual notes
  • Inline comment markers - Disable exclusions for specific text sections
  • Code exclusion UI - Previously hidden settings now accessible
  • Better organized settings - Improved visual hierarchy and property references
  • Comprehensive docs - All features now fully documented

New Features

Per-Note Exclusion Override System

Override global exclusion settings for individual notes using YAML frontmatter:

---
cswc-disable: [exclude-urls, exclude-comments]
---

Or disable all exclusions at once:

---
cswc-disable: all
---

Supported override values:

  • Path exclusions: exclude-windows-paths, exclude-unix-paths, exclude-unc-paths, exclude-environment-paths
  • Content exclusions: exclude-urls, exclude-code-blocks, exclude-inline-code, exclude-comments
  • Structure exclusions: exclude-headings, exclude-specific-headings, exclude-words-phrases

Inline Comment-Based Overrides

Use special comment markers to disable exclusions for specific sections within your notes:

This text follows global exclusion rules.

<!-- cswc-disable -->
This section ignores all exclusions - URLs, paths, and comments are counted.
<!-- cswc-enable -->

Back to normal exclusion rules.

Also works with Obsidian comment syntax: %% cswc-disable %% and %% cswc-enable %%

Code Exclusion Settings

The settings UI now includes previously missing code exclusion toggles:

  • Master toggle "Exclude code"
  • Sub-options for "Exclude code blocks" (triple-backtick blocks)
  • Sub-options for "Exclude inline code" (single-backtick code)

Improvements

Settings UI Enhancements

  • Added property value indicators next to each exclusion toggle (e.g., Property: exclude-urls)
  • Added collapsible "Using per-note exclusion overrides" help section with examples
  • Reorganized settings with better grouping and visual hierarchy
  • Improved section headings and descriptions for clarity

Technical Improvements

  • Added proper word-count- prefix to CSS classes for better scoping
  • Implemented efficient frontmatter parsing using Obsidian's MetadataCache API
  • Minimal performance impact with smart caching

Documentation

All documentation has been overhauled to include the new features:

  • Architecture overview updated with per-note override system details
  • User guides now cover all features from the architecture
  • Settings reference includes all new options
  • Added comprehensive examples and use cases

Technical Details

New Functions:

  • getDisabledExclusionsFromFrontmatter() - Parses YAML frontmatter for overrides
  • processTextWithOverrides() - Handles inline comment markers

Updated Functions:

  • All counting functions (countSelectedWords, countSelectedCharacters, countSelectedSentences) now respect override settings

Installation

From Obsidian Community Plugins

  1. Open Settings → Community Plugins
  2. Search for "Custom Selected Word Count"
  3. Install and enable the plugin

Manual Installation

  1. Download main.js, manifest.json, and styles.css from this release
  2. Place them in your vault's .obsidian/plugins/custom-selected-word-count/ folder
  3. Enable the plugin in Settings → Community Plugins

Acknowledgments

Thank you to all users who have provided feedback and feature requests. Your input helps make this plugin better for everyone!

Bug Reports & Feature Requests

If you encounter any issues or have suggestions for future improvements, please create an issue.

Support

If you find this plugin useful, consider supporting its development:

Buy Me A Coffee


Full Changelog: https://github.com/banisterious/obsidian-custom-selected-word-count/compare/1.4.0…1.5.0

README file from
Similar Plugins
info
• Similar plugins are suggested based on the common tags between the plugins.
Regex Find and Replace
4 years ago by Martin Eder
Plugin for Obsidian, providing search/replace functionality which supports regular expressions and selections.
Dynamic Highlights
3 years ago by nothingislost
An experimental Obsidian plugin that highlights all occurrences of the word under the cursor
File Info Panel
3 years ago by CattailNu
This plugin for Obsidian creates a small File Info view that displays the active file's date created, date modified, file size, and links to open the file in its native application and to open the file's folder.
Novel Word Count
3 years ago by Isaac Lyman
Obsidian plugin. Displays a word count or other statistic for each file, folder and vault in the File Explorer pane.
Linkify
3 years ago by Matthew Chan
Bulk Rename
3 years ago by Oleg Lustenko
Global Search and Replace
2 years ago by Mahmoud Fawzy Khalil
A plugin to do a global search and replace in all your Obsidian vault files.
File Explorer++
2 years ago by kelszo
A plugin for https://obsidian.md, which enables the ability to hide and pin specific files and folders in the file explorer by applying custom filters.
Writing Goals
2 years ago by James Lynch
Set yourself dynamic writing goals for notes and folders to help you hit your long form writing targets with Obsidian.
R.E.L.A.X.
2 years ago by Syr
Regex Obsidian Plugin
Tag Links
a year ago by Zacchary Dempsey-Plante
A plugin for Obsidian that allows tags to be opened as links using a hotkey.
Target Word Count
a year ago by TwoFive Labs
Target Word Count Plugin for Obsidian
LinkMagic
a year ago by AndyReifman
Regex Mark
a year ago by Mara-Li
Daily Statistics
a year ago by yefengr
obsidian daily statistics
Better Word Count
5 years ago by Luke Leppan
Counts the words of selected text in the editor.
Daily Stats
4 years ago by Dhruvik Parikh
Plugin to view your daily word count across all notes in your Obsidian.md vault.
Find and replace in selection
4 years ago by Dmitry Savosh
Obsidian plugin. Find and replace in selection.
Regex Pipeline
4 years ago by No3371
An Obsidian plugin that allows users to setup custom regex rules to automatically format notes.
Beeminder Word Count
4 years ago by Yuta Miyama
Beeminder integration with Obsidian, so that your word count in Obsidian contributes to your writing goals.
Blue Star
8 months ago by Wang Guoshi
A plugin for Obsidian that generates Anki flashcards in various ways.
Keep the Rhythm
6 months ago by Ezben
An Obsidian plugin to track your daily word count through a heatmap.
Hide Commands in Menu
5 months ago by bomian98
Obsidian Plugin, hide different commands in different menus.
YourPulse - Your Writing Activity Visualised
5 months ago by Jiri Sifalda
YourPulse.cc - Obsidian.md plugin that turns your vault into a reflection of your creativity, and put your writing on steroids 💪
Wordflow Tracker
4 months ago by LeCheenaX
Track the changes and stats of your edited note files automatically in Obsidian. Record the modified notes and statistics to your daily note with various customizations!
AutoMover
4 months ago by Al0cam
Moves files with specified names into the same folder
aDHL
2 months ago by tine-schreibt
The Dynamic Highlights Plugin, but with hotkeys, more options and sorting; works well with Highlightr.
FileName Styler
2 months ago by Marc Feininger
An Obsidian plugin to hide, customize, and decorate file names in the sidebar using regex and customizable profiles.
Regex Line Filter
2 months ago by 64MM4-KN1F3
A note filtering plugin for Obsidian
CJK Count
a month ago by Louie Kurenai
Auto Replacer
15 days ago by Alecell
A live text replacement plugin that applies automatic formatting, corrections, or custom replacements in real-time. Define your own regex-based rules and transformation logic to modify text dynamically as you type.