Custom Selected Word Count

by banisterious
5
4
3
2
1
Score: 52/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.

Reviews

No reviews yet.

Stats

4
stars
826
downloads
0
forks
327
days
274
days
274
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 months ago

Changelog

Version 1.6.2

Fixed an issue where clicking the status bar after using Select All (Ctrl+A or Cmd+A) in Reading Mode would show "No text selected" instead of opening the word count modal. The modal now correctly displays word count details for all selected text.

README file from

Github

Custom Selected Word Count for Obsidian

A plugin for Obsidian that provides comprehensive text analysis for selected text across all view modes and Canvas cards. Features advanced word counting, character counting, and sentence counting with customizable path exclusion, modern UI design, and detailed history tracking.

Downloads

Plugin in Action

See the Custom Selected Word Count plugin in active use, demonstrating how it provides real-time feedback in your editor.

Settings Overview

This animated overview showcases the various configuration options available within the Custom Selected Word Count plugin.


Key Features

  • Comprehensive Text Analysis: Advanced word, character (with configurable modes), and sentence counting with sophisticated detection across all view modes and Canvas cards.
  • Modern User Interface: Card-based modal design, individual copy buttons, multi-metric history tracking, command palette, and optional status bar/ribbon integration.
  • Granular Exclusion Rules: Fine-tune counting by excluding code, paths, comments, headings, specific words/phrases, and support for per-note overrides.
  • Customization & Extensibility: Define custom word detection via regex for expert users and enjoy flexible, persistent settings.
  • Accurate Link Processing: Ensures only visible text in Markdown links is counted.

Installation

  1. Open Obsidian Settings
  2. Go to Community Plugins and disable Safe Mode
  3. Click Browse and search for "Custom Selected Word Count"
  4. Install the plugin
  5. Enable the plugin in your list of installed plugins

Usage

  1. Select text in any view mode or Canvas card
  2. Access the text analysis:
    • Use the command palette and search for "Count Selected Words"
    • Click the ribbon button (if enabled)
    • Click the status bar count (if enabled)
    • View the real time word count in the status bar (if enabled)
  3. View comprehensive analysis in the modal:
    • Word count with advanced detection
    • Character count (if enabled in settings)
    • Sentence count (if enabled in settings)
    • Copy individual metrics to clipboard
    • View historical analysis data

Detailed Configuration & Screenshots

For a comprehensive look at all of the plugin's settings and how they are presented, refer to the screenshots below:

Screenshot Description
Status bar: Show count in status bar, Enable live updates, Hide core wordcount, Status bar labelModal: Show character count, Character counting mode, show sentence count, Show date/time in history
Code: Exclude code, Exclude code blocks, Exclude inline codePaths:Exclude paths from word count, Exclude Windows paths, Exclude Unix paths, Exclude UNC paths, Exclude environment paths
Comments: Exclude Obsidian comments, Exclude Obsidian comment content, Exclude HTML comments, Exclude HTML comment contentHeadings: Exclude heading markers only, Exclude entire heading lines, Exclude heading sections
Words and phrases: Exclude words, Exclude phrasesLogging: Enable debug logging, Logging level (not shown)Custom word detection regex
Custom word detection regex (continued)

Per-Note Exclusion Overrides

You can override global exclusion settings for individual notes using two methods:

YAML Frontmatter Override

Add a cswc-disable property to your note's frontmatter:

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

Or disable all exclusions:

---
cswc-disable: all
---

Inline Comment Override

Use special comments to disable exclusions for specific sections:

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.

You can also use Obsidian comment syntax: %% cswc-disable %% and %% cswc-enable %%.


Support My Work

If you find this plugin useful, please consider supporting its development!

Documentation

For comprehensive documentation, visit the Documentation Hub which includes:

The settings page now includes a detailed "Exclusion Logic Details" section. For each exclusion type (Windows Paths, UNC Paths, Unix Paths, Environment Variable Paths, File Extension Exclusion, file:/// Protocol), you will see:

  • The regex pattern used
  • A plain-English explanation
  • Example matches and non-matches
  • A "Copy Regex" button for advanced users
  • All details are in a collapsible section for clarity

This makes it easy to understand what is being excluded and why.


Getting Support

If you encounter any issues or have a feature request, please create a GitHub issue.

Mobile Compatibility

This plugin is primarily developed and tested for Obsidian Desktop. While it may work on Obsidian Mobile, mobile support is currently untested. Some features—such as the ribbon button and status bar integration—are not available on mobile. If you use this plugin on mobile and encounter any issues or have suggestions, please report them on GitHub. Your feedback is appreciated and will help improve mobile compatibility in future updates.

License

MIT License

Similar Plugins

info
• Similar plugins are suggested based on the common tags between the plugins.
Better Word Count
6 years ago by Luke Leppan
Counts the words of selected text in the editor.
Novel Word Count
4 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.
File Explorer++
3 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.
Regex Find and Replace
4 years ago by Martin Eder
Plugin for Obsidian, providing search/replace functionality which supports regular expressions and selections.
Global Search and Replace
3 years ago by Mahmoud Fawzy Khalil
A plugin to do a global search and replace in all your Obsidian vault files.
Writing Goals
3 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.
Dynamic Highlights
4 years ago by nothingislost
An experimental Obsidian plugin that highlights all occurrences of the word under the cursor
Daily Stats
5 years ago by Dhruvik Parikh
Plugin to view your daily word count across all notes in your Obsidian.md vault.
Regex Pipeline
5 years ago by No3371
An Obsidian plugin that allows users to setup custom regex rules to automatically format notes.
File Info Panel
4 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.
Find and replace in selection
5 years ago by Dmitry Savosh
Obsidian plugin. Find and replace in selection.
Keep the Rhythm
a year ago by Ezben
An Obsidian plugin to track your daily word count through a heatmap.
Bulk Rename
4 years ago by Oleg Lustenko
Linkify
4 years ago by Matthew Chan
Regex Mark
2 years ago by Mara-Li
aDHL
a year ago by tine-schreibt
The Dynamic Highlights Plugin, but with hotkeys, more options and sorting; works well with Highlightr.
AutoMover
a year ago by Al0cam
Move files and notes with specified names into their designated folders according to rules you define.
Wordflow Tracker
a year 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!
Daily Statistics
2 years ago by yefengr
obsidian daily statistics
Beeminder Word Count
5 years ago by Yuta Miyama
Beeminder integration with Obsidian, so that your word count in Obsidian contributes to your writing goals.
R.E.L.A.X.
2 years ago by Syr
Regex Obsidian Plugin
YourPulse - Your Writing Activity Visualised
a year 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 💪
FileName Styler
a year ago by Marc Feininger
An Obsidian plugin to hide, customize, and decorate file names in the sidebar using regex and customizable profiles.
Auto Replacer
10 months 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.
LinkMagic
2 years ago by AndyReifman
Tag Links
2 years ago by Zacchary Dempsey-Plante
A plugin for Obsidian that allows tags to be opened as links using a hotkey.
Hide Commands in Menu
a year ago by bomian98
Obsidian Plugin, hide different commands in different menus.
Vault Stats
9 months ago by Blue Heron
A plugin with some simple statistics.
URL Formatter
8 months ago by Thomas Snoeck
Automatically formats specific URLs pasted into Obsidian into clean Markdown links.
Target Word Count
2 years ago by TwoFive Labs
Target Word Count Plugin for Obsidian
Blue Star
2 years ago by Wang Guoshi
A plugin for Obsidian that generates Anki flashcards in various ways.
Regex Line Filter
a year ago by 64MM4-KN1F3
A note filtering plugin for Obsidian
CJK Count
a year ago by Louie Kurenai
Efficient Word Count
9 months ago by Blue Heron
Efficiently calculates and caches word counts for notes, with folder exclusion. Uses cache to avoid recalculating word counts for unchanged notes.
WPM Reading Time - How Long to Read This Text
a month ago by Santi Younger
Calculate reading time estimates for selected text using your own reading speed in Words Per Minute.