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))

 

Reserved Hashtags

Note the following hashtag names purposely are not preceeded with # symbols so they don't take effect on this page.

 

  • KeepHashtags - When present on a page, following a SkipHashtags hashtag, the hashtag scanner will resume looking for hashtags on the page.
  • SkipHashtags - When present on a page, the hashtag scanner will ignore all hastags until the bottom of the page or until it sees the keephasthags hashtag.
  • SkipWiki - When a page title includes this tag, it will not be included in the output of the Wiki generation script /docs/Build.ps1 in the OneMore repo. This does not apply when the tag is in the page body.

 

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.

 

Insert Hashtags

Default shortcut is Alt + T

Inserts one or more selected tags onto the page. Tags can be inserted at the cursor, replace select content, or be appending to the tag bank at the top of the page.

 

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.

 

Next Unread Page

Starting from the current page, find the next unread page across all notebooks and navigate to that page.

 

Previous Unread Page

Starting from the current page, find the previous unread page across all notebooks and navigate to that page.

 

 

#omwiki #omcommands

 

© 2020 Steven M Cohn. All rights reserved.

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

 

 

Created with OneNote.