Search and Tag Commands

 

 

Monday, February 20, 2023

7:33 AM

 

    Page Tags  #OneNote #OneMore #hashtags-are-awesome

 

Search and Replace

Default shortcut is Ctrl + H

Searches the current page for the specified phrase and replaces it with a new phrase. Use standard Regular Expression syntax for advanced searches; substitution parameters can be used to inject regular expression captures.

 

This searches line-by-line so it will not find text that spans paragraphs or table cells. If the text cursor is currently within a word, that word is shown as the default text to replace in the Find what field.

 

 

If the Replace with text contains the sequence \n then that is replaced with a Newline character. For example, replacing text with "one\ntwo" will result in two lines as follows:

 

one
two

 

Due to the way regular expressions are interpreted, if you want to replace 12:33:47 with 12:33 then use a regular expression like ((\d{2}:\d{2}):\d{2}) and replace with $2. If you exclude the outer parenthesis and replace with $1, the result will be no change.

 

Search and Copy/Move

Default shortcut is Alt + F

Searches for keywords across pages and copies or moves selected pages (Alt + F) to another section

 

 

 

Hashtags

#SkipHashtags

Hashtags offer contextual references within the text of a page. Hashtags can be prefaced with either one or two hash symbols #, such as #hashtag or ##hashtag. Tags may contain letters, digits, hyphens, and underscores. Any other character will terminate the hashtag.

 

Single hash hashtags must not begin with a number. #a123 is valid but #1abc is not. This is to ensure OneMore differentiates between a hashtag and a numbered sequence like #1, #2, # 3, etc. If you want a tag such as #123 then use two number signs, such as ##123.

 

If you are a programmer and tend to have HTML Hex colors, like #FFCC00, or have C# or C++ pragma directives, like #include or #define, OneMore excludes these patterns by default. You can treat these as hashtags by checking the Treat box in Settings.

 

The full list of keywords OneMore excludes by default is #define|#else|#endif|#endregion|#error|#include|#if|#ifdef|#ifndef|#line|#pragma|#region|#undef.

 

PowerShell, Python and shell scripts use the hash symbol to start a single-line comment. If a space is not inserted immediately following the hash symbol then OneMore will pick that up as a hashtag. To tell OneMore to ignore these blocks of text, surround the text with the special hashtags markers #SkipHashtags and #KeepHashtags. These are not case-sensitive. Anything between those two markers is ignored. If only the #SkipHashtags marker is present on a page without a #KeepHashtags marker, then the remainder of the page is ignored. Notice that this section of this page is surrounded by these markers.

#KeepHashtags

 

Search Hashtags

Default shortcut is Alt + F9

To search for hashtags use the Search Hashtags dialog. All pages that containg the specified hashtags will be displayed. The date shows the last date the page was updated. Hover over each contextual snippet to see when that paragraph was last updated. Click the page to navigate to the top of the page. Click a contextual snippet to navigate directly to that paragraph.

 

 

As you start typing a hashtag, a list of known tags is displayed. You can enter a partial hashtag or select a tag from the list. Tags can be combined with AND or OR logical operators; AND is implied if not specified between two tags. Double ampersand, &&, is equivalent to AND, and double vertical bar, ||, is equivalent to OR. Precedence can be specified using parentheses. Use an asterisk as a wildcard; to search for "abc" and not "abcdef", terminate the tag with a period such as abc. Some valid query expressions include:

 

  • tag
  • tag tag2*
    • This is equivalent to (tag AND tag2*)
  • tag (#tag2 or tag3)
    • This is equivalent to (tag AND (#tag2 OR tag3))

 

Operations

The Index button will create a new page with an index of selected pages.

The Copy button will copy the selected pages to another section or notebook.

The Move button will move the selected pages to another section or notebook.

 

Add Tag Bank

Adds an specialized outline below the page title, next to the date and time, in which you can type your own inline hashtags, or any other content. As an example, see the tag bank at the top of this page.

 

Remove Tag Bank

Removes the tag bank from the current page. If the tag bank has any content, you will be prompted to confirm if you want to delete the content and remove the tag bank.

 

──────────────────────────────────────────────────────────────────────────────────────────────────

Page Tags

These tags mark entire pages with user-supplied keywords. They are not searchable per se, but are rather indexed and can be used to lookup pages marked with one or more specified tags.

 

Note that Page Tag commands are now deprecrated. You will be asked to update your Page Tags to Hashtags when using any Page Tag command. The Page Tag commands will be removed in a future version of OneMore.

 

Tag Page

Default shortcut is Alt + T

Adds one or more arbitrary text tags to a page. Tags can be entered on the fly by typing into the text box. Tags can also be chosen by clicking any from a list of recently used tags or tags inferred from the most commonly occurring words on the page. Enter tags separated with a comma; this allows multi-word tags such as "Wonder Woman".

 

Tags will appear below the page title, next to the date and time. Note that while this is a block of text that can be edited, that will not change the tags on the page. Page tags must be added, removed, and edited using the Tag Page dialog. Do not modify this text block manually.

 

Find Tagged Pages

Default shortcut is Ctrl + Alt + T

Searches all pages in a specified scope with a combination of one or more tags.

 

Tags must be separated with a comma. This list of tags is parsed into an inclusion list and an exclusion list where tags are included unless prefaced with a minus operator such as "-Fish", which will exclude all pages that are tagged with "Fish". Searching is done by applying both the inclusion list and exclusion list as follows: a page is matched and included in the result list if the page has one or more of the inclusion tags but none of the exclusion tags.

 

You can add tags to the filter by clicking any of the recently used tags; this shows up to 30 tags from the most recently modified pages. This is not a list of recently searched tags but rather a list of actual tags that currently exist on pages.

 

When results are shown, click on each page to force OneNote to navigate to and display that page.

 

Select individual pages by ticking the checkbox next to each page. Then create an index page of the selected pages or choose to copy or move those pages to another notebook or another section.

 

 

#omwiki #omcommands

 

© 2020 Steven M Cohn. All rights reserved.

Please consider a sponsorship or one-time donation to support ongoing development

 

 

Created with OneNote.