zadam / Trilium-FindWidget

Find in note Trilium widget to replace the crappy ctrl+f search.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trilium-FindWidget

Find in note Trilium widget to replace the crappy ctrl+f search.

Video

sandbox.-.Trilium.Notes.2022-04-22.15-41-19_rescaled.mp4

Features

  • Works on code and text notes.
  • Whole word and case sensitive flags.
  • Hardcoded keys:
    • F3/ctrl+f, to start a search (you will need to disable ctrl+f shortcut in Trilium shortcut dialog box so the widget can receive it).
    • F3/enter shift+f3/shift+enter to go to the next/prev occurrence
    • esc or click on note to end the search and go back to the note
  • Doesn't work on readonly notes, no firm plans to make it work there.
  • Tested on Trilium Desktop 0.50.3

Installation

  • Create a code note of type JS Frontend with the contents of FindWidget.js
  • Set the owned attributes (alt-a) to #widget
  • Set the owned attributes of any note you don't want to enable finding to #noFindWidget
  • Disable Ctrl+f shorcut in Trilium options

Configuration Attributes

In the Text Note

  • noFindWidget: Set on the text notes you don't want to show the ToC for

In the Script Note

  • findWidgetDelayMillis: Number of milliseconds to wait from the time a key is pressed until the search is performed. Prevents stalls typing the first chars search word in long notes. Set to negative to force enter to be pressed in order to search. Default is 250
  • debugLevel: Enable output to the javascript console, default is "info" (without quotes):
    • "error" no javascript console output
    • "warn" enable warn statements to the javascript console
    • "info" enable info and previous levels statements to the javascript console
    • "log" enable log and previous levels statements to the javascript console
    • "debug" enable debug and previous levels statements to the javascript console

Todo

  • Refactoring, code cleanup
  • Regexp search.
  • Find & Replace

Discussions

zadam/trilium#2806

About

Find in note Trilium widget to replace the crappy ctrl+f search.

License:GNU General Public License v3.0


Languages

Language:JavaScript 100.0%