[TW5] Global Keyboard Shortcut for Plugin Simple Search: Shift + Space

404 views
Skip to first unread message

Thomas Elmiger

unread,
Dec 22, 2018, 5:48:19 PM12/22/18
to TiddlyWiki
Hi folks,

To launch/hide the search via my Simple Search plugin, I have implemented a keyboard shortcut. So far I use the combination
Shift + Space which seems to work fine in Firefox, Safari and Opera on my Mac.

You can try it here: https://tid.li/tw5/plugins.html

As I am a fan of Spotlight search on the Mac, which can be toggled using cmd + Space, I thought it would be a good idea to also use Space. First I used ctrl + Space but that seems to be taken on Windows as well as in Opera.

Does anyone encounter problems with Shift + Space?

By the way: I found it rather difficult to come up with a short combination which is not already used for important functions in browsers or an operating system. So it comes in handy that in TW5 we can use the same keystrokes to switch something on and off, like I do with the search.

And while we are at it: Does anyone know what would be needed to jump from one search result to the next using (only) the down-arrow?

All the best,
Thomas

BurningTreeC

unread,
Dec 23, 2018, 1:10:30 AM12/23/18
to TiddlyWiki

Diego Mesa

unread,
Dec 23, 2018, 11:21:58 AM12/23/18
to TiddlyWiki
Im so happy! I've been wanting something like this forever! I even posted about this in January! 

https://groups.google.com/d/msg/tiddlywiki/yKrgs5ENAII/521K7N7BAAAJ

Im very excited to see all of the excellent work being done in the TW community. Thank you Thomas for this, and to all who have this possible!

Diego Mesa

unread,
Dec 24, 2018, 4:02:55 PM12/24/18
to TiddlyWiki
Hey Thomas,

Just some feedback - When I installed the plugin it acme with a default of 450 delay (I changed it to 0). Also, the EditCompText plugin:


creates a dropdown that you can navigate with your keyboard. now that we can select and search with our keyboard, can we also select hte tiddler with our keyboard?

Thanks!
Diego


On Saturday, December 22, 2018 at 4:48:19 PM UTC-6, Thomas Elmiger wrote:

Odder

unread,
Dec 25, 2018, 4:00:59 AM12/25/18
to TiddlyWiki
Hey Thomas,

I like your simple search very much. But it doesn't work in zoomin-view. The search Tiddler is open but take not focus. After that I have tested it with a fresh downloaded empty.html - the same behaviour.

Many Christmas greetings
Odder

Thomas Elmiger

unread,
Dec 27, 2018, 10:52:36 AM12/27/18
to TiddlyWiki
Thank you all very much for the feedback, Odder, Diego and BTC!

The new version 1.0.10 of Simple Search comes with several improvements:

  • First of all, keyboard accessibility: Press Shift + Space to launch/hide the search field, jump to search results with Tab, then use arrows up and down and confirm with Enter.
  • One for Diego: Make sure to visit the settings tab to adjust your preferences.(The recommendation to reduce animation duration was there before, but maybe nor prominent enough,)
  • Last but not least: Zoomin storyview should work as well.
Have fun!
Thomas

Diego Mesa

unread,
Dec 27, 2018, 10:57:42 AM12/27/18
to TiddlyWiki
Thanks Thomas!

I did indeed see the settings, just thought it strange it came default with a non-recommended setting (400 instead of the recommended less than 150). Also, on my 5.1.19 pressing tab gets me to the search results but the arrows dont navigate it. I have to keep pressing tab to go down the search results list.

Thomas Elmiger

unread,
Dec 27, 2018, 11:09:44 AM12/27/18
to tiddl...@googlegroups.com
Diego, what OS and browser do you use? 

-t

sent from my mobile

Am Do., 27. Dez. 2018, 16:57 hat Diego Mesa <dieg...@gmail.com> geschrieben:
--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/iVXsEIKnkXA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/b3699c42-feb8-427c-8778-7511fddf772e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Odder

unread,
Dec 27, 2018, 11:37:11 AM12/27/18
to TiddlyWiki
Thank you Thomas,

it works perfect now on zoomin view.

odder

Mal

unread,
Dec 28, 2018, 2:42:45 AM12/28/18
to TiddlyWiki
I also have to use tabs instead of arrow keys on Ubuntu 18.04 with Firefox 64.

Mal

S. S.

unread,
Dec 28, 2018, 7:26:31 AM12/28/18
to TiddlyWiki
Same issue as Diego & Mal - Firefox 63.03 on Windows 10 - can't use the up/down arrow keys - have to use Tab - which moves down the results but without highlighting the line in green - just a dotted black box around the line.

I really like that it searches the caption field!

I did make a comment some weeks back on a github issue: Search within the extra fields - that standard search on a TW does not include looking at the caption field - which can be confusing when you can see a title link in a Table of Contents or a <<list-links ...>>  - that then does not show up in a search!

I wonder how hard it would be to have a tick box that then includes searching all fields as well. I feel this option is important when searching.

Also, just as a note, I imagine it is a decision that you had to make - to do it different from a normal TW search - that when a search item matches a title or a tag (and of course a caption), the link result shows the caption instead of the tiddler title. Without giving it much reflection, I think this may be a good idea.

Nice plugin!

Thomas Elmiger

unread,
Dec 28, 2018, 4:03:14 PM12/28/18
to TiddlyWiki
Hi S.S.,

Thanks for your comments! Nice to read your thoughts :)

Am Freitag, 28. Dezember 2018 13:26:31 UTC+1 schrieb S. S.:
Same issue as Diego & Mal - Firefox 63.03 on Windows 10 - can't use the up/down arrow keys - have to use Tab - which moves down the results but without highlighting the line in green - just a dotted black box around the line.

Correct, I see now that browsers handle that differently (I am on FF Developer Edition). I will update the readme accordingly. I do not see this as an issue, it is just HTML and browsers can act on it as they always do. But good to know.
 
I really like that it searches the caption field!
Ah yes, I will have to document that too.

I did make a comment some weeks back on a github issue: Search within the extra fields - that standard search on a TW does not include looking at the caption field - which can be confusing when you can see a title link in a Table of Contents or a <<list-links ...>>  - that then does not show up in a search!
Same here.

I wonder how hard it would be to have a tick box that then includes searching all fields as well. I feel this option is important when searching.
I wondered too, but according to https://tiddlywiki.com/#search%20Operator it should be doable.

Also, just as a note, I imagine it is a decision that you had to make - to do it different from a normal TW search - that when a search item matches a title or a tag (and of course a caption), the link result shows the caption instead of the tiddler title. Without giving it much reflection, I think this may be a good idea.
If it has a caption, I show the caption, like you would see in the TOC. The title is shown on mouseover as a tooltip (if you have a mouse). I am open for better ideas.
 
Nice plugin!

Thomas Elmiger

unread,
Dec 28, 2018, 4:18:19 PM12/28/18
to TiddlyWiki
Hi Diego,

I owe you an explanation as you ...
thought it strange it came default with a non-recommended setting (400 instead of the recommended less than 150).

As the animation duration is a standard TW setting I not invented myself, accessible via the control panel, a user might have set it to 450, or 100 or 0 before installing my plugin. That’s why I did not include a value in the plugin and leave it up to the user for the moment. Maybe unnecessary?

Cheers,
Thomas

Diego Mesa

unread,
Dec 28, 2018, 10:27:41 PM12/28/18
to TiddlyWiki
Thank you Thomas! I had not realized that. 

Thomas Elmiger

unread,
Dec 30, 2018, 9:39:51 AM12/30/18
to TiddlyWiki
Dear TW search fans,

Motivated by the feedback here I have made further optimisations in functionality and finish of details. I proudly present the probably last version of Simple Search for 2018: version 1.0.14.

Main improvements:
  • settings can be reached by clicking a button below the search field
  • settings for fields: Choose fields to search in for the secondary list yourself
  • animation duration: reasonable value of 150 provided with the plugin (will not override anything users have defined themselves)
  • matches counter: counts results for search in ALL fields (unfiltered)
Hope you like it as much as I do :)

All the best for the end of 2018,
Thomas

Diego Mesa

unread,
Dec 30, 2018, 10:16:10 AM12/30/18
to TiddlyWiki
Thanks again Thomas! 

Just curious, on this version I still cant use the arrow keys to navigate the results list. Is this just a browser thing?

Thomas Elmiger

unread,
Dec 30, 2018, 11:16:47 AM12/30/18
to TiddlyWiki
Hi Diego,

Yes, it is a browser thing. It is just an HTML structure, a list of links, marked as accessible for keyboard navigation with an attribute called tabindex. Browsers can do with it what they usually do. No scripting involved.

Cheers,
Thomas

Diego Mesa

unread,
Jan 1, 2019, 2:07:35 PM1/1/19
to TiddlyWiki
Hey Thomas,

Thanks again for all your great work - I just thought id make one more suggestion for a useful feature! When on the search bar, pressing escape closes it, pressing enter when nothing in the results list is highlighted and/or there are no results - creates a new tiddler with the title of the search term. This would be immensely useful, and could even be configurable! 

Best,
Diego

Thomas Elmiger

unread,
Jan 1, 2019, 5:13:40 PM1/1/19
to TiddlyWiki
Hi Diego,

Thank you for the reminder – you brought this up before, no? It is a great idea to create missing tiddlers, I integrated it immediately :)

Get version 1.0.16 from https://tid.li/tw5/plugins.html

You will have to use Tab for now to reach the + button ... and Shift + Space to close instead of escape.

Hope that works for you too.

Cheers,
Thomas

Riz

unread,
Jan 1, 2019, 11:15:47 PM1/1/19
to TiddlyWiki
Hi telmiger

If you are taking more features requests, consider these:

* A setting to toggle showing search results only after pressing enter key. It would help a lot with smaller devices where lag owing to the "refresh on every key press" Tiddlywiki thing is rather annoying. Lofty goal, but devices and browsers are not yet there for that fast processing.


* Instead of just "title template" and "tag template", why can't we have a tiddler template for the new tiddler button?


* Bangs: Like, if you type "!a" in the search field and press tab, it should convert to advanced search.

* Similarly, if you type "!p" in the search field, it should search for page toolbar buttons. Clicking on a result will launch the button function. Like typing "!p<tab>new tiddler<enter>" will create a new tiddler.

sincerely,
Riz

Riz

unread,
Jan 1, 2019, 11:19:50 PM1/1/19
to TiddlyWiki
I also want to reprise my old recommendation that things like these, along with JD's themes, and colour schemes should be bundles with core as a theme.

sincerely
Riz

Thomas Elmiger

unread,
Jan 2, 2019, 2:28:15 AM1/2/19
to TiddlyWiki
Hi Riz,

Thanks for your suggestions, I am sure these are valid proposals for advanced users.

I will consider the template tiddler, but this might take some time as my regular job restarts tomorrow.

Turning it into advanced search or adding more advanced functionality would also lead to a new plugin name like "Power Search" or "Super Search", so I think I will leave that job to others :)
The whole thing is open source and I also tried to make it more modular than the original search by applying the "everything is a tiddler" credo here and there, so it should be quite hackable.

Themes are on my to do list too ... maybe later this year.

All the best,
Thomas

Diego Mesa

unread,
Jan 23, 2019, 2:06:56 PM1/23/19
to TiddlyWiki
Hey Thomas,

I think I found a slight bug: when I click the advanced search button from the search bar without a typing a search term, it does not (but probably should) close the search tiddler (as it does when I click that button with a search term present).

Best,
Diego

Thomas Elmiger

unread,
Jan 24, 2019, 3:40:58 AM1/24/19
to tiddl...@googlegroups.com
Hey Diego,

You are right. But I am afraid my computer needs to be fixed or replaced, so this might take some time. 

All the best, 
Thomas 

ch

unread,
Jan 24, 2019, 8:40:17 AM1/24/19
to tiddl...@googlegroups.com
hi thomas,

sorry being late to this discussion...

about "Does anyone encounter problems with Shift + Space?"

actually, "shift+spacebar" is a default web browser key shortcut you override with the plugin - usually, when hitting the shortcut "spacebar" means that the web browser should scroll forward one screen of texts, and the "reverse" shortcut "shift+spacebar" means scroll back one screen of texts... so, maybe another shortcut for the "simple search" plugin is better... what about "shift+ctrl+spacebar"? is that shortcut taken?

feature request: to be able to forward an optional list of tiddlers (as argument to the macro?) to force which tiddlers to search within, and also an optional extra argument which specify tiddlers to skip.

why? well, for example with a "read-only-mode" wiki, you don't want the reader of the wiki to be able to get search results ending up on tiddlers you really don't want the reader to see, at all.

maybe you already have this feature already, i've not studied your plugin in detail...

cheers!
ch

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.

To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

Thomas Elmiger

unread,
Jan 24, 2019, 11:59:41 AM1/24/19
to tiddl...@googlegroups.com
Hej ch, mange tak! 

Better late than never, I will happily consider your feedback as soon as I have a running laptop again. 

I did notice, that the space bar should scroll down, but I wasn't aware of the reverse option. 

Hilsner, 
Thomas 

David Nebauer

unread,
Jan 25, 2019, 8:33:30 AM1/25/19
to TiddlyWiki
I, too, was unaware that Shift+Space scrolled up. I won't miss it and sure appreciate having such an easily accessible search.

Great plugin!

David.

Thomas Elmiger

unread,
Jan 27, 2019, 5:47:52 PM1/27/19
to TiddlyWiki
Hello searchers,

The bug Diego found is smashed and other small improvements follow along:

* $:/temp/search is no logner emptied when switching to Advanced search
** nice, if you e.g. enter a filter expression in Simple Search, test and modify it in Advanced search and want to return to the initial version, you can go via Simple Search once more and it will still be there.
* The sidebar search is no longer hidden via CSS but removed (that shoud save resources as it was still invisibly updated until now, but works only from TW 5.1.18)

Last good news: After a considerable investment in a new laptop and several hours spent with my backup drives, I am up and running again. So remember: Always save backups!


Cheers,
Thomas

David Nebauer

unread,
Aug 23, 2019, 9:04:41 PM8/23/19
to TiddlyWiki
Since updating to 5.1.20 on node.js the behaviour of the simple search plugin has changed. When I invoke the search dialog with Shift+Space for the first time after opening a wiki, it behaves normally. When I invoke the search dialog thereafter, the dialog opens behind the current tiddler. While the search dialog is obscured, it retains focus, so you can navigate with Tab and select with Enter (althought you are doing it blind!).

I have confirmed this behaviour with both Vanilla and Snow White themes, and in Firefox and Google Chrome (both on Linux).

I can provide further details of my wiki configuration if it would help with troubleshooting.

Regards,
David.

TonyM

unread,
Aug 24, 2019, 12:59:28 AM8/24/19
to TiddlyWiki
David

Perhaps a z value needs to be set or increased to ensure it is on top?. Sticky toolbars and code mirror has done things like this to my wikis in the past.

Regards
Tony

Reply all
Reply to author
Forward
0 new messages