Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EDIT: "How do you unbind semicolon? ; "] I'm having trouble finding some basic stuff in the documentation: What characters are special, and how do you escape them (eg how do you unbind semicolon)? What's the exact syntax for commenting stuff out in the rc file? #3904

Closed
OwenAR opened this issue Sep 5, 2021 · 7 comments

Comments

@OwenAR
Copy link

OwenAR commented Sep 5, 2021

I'm having trouble finding some basic stuff in the documentation,
and I'm afraid I'll end up feeling stupid once I actually find it, but...

  • What characters are special, and how do you escape them? eg, how do you unbind semicolon?

  • What's the exact syntax for commenting stuff out in the tridactylrc file?

@bovine3dom
Copy link
Member

In the command line, there are no special characters except # and space.

Spaces split up arguments; leading spaces are stripped.

A leading # denotes a whole-line comment. Any other # are treated as normal characters.


If you are using the command :composite, ; splits ex-commands. | takes the output of the left hand ex-command, stringifies it, and appends it as a single argument to the next ex-command. If you need to use semicolons in js within :composite, you need to write a :command first to hide the semicolons or :composite will steal them.


In the tridactylrc file you can comment lines out by starting the line with a double quote " or hash #. In-line comments aren't supported.

Additionally, Tridactyl stores its settings using the Firefox storage as soon as they are set. If you add a line to the RC file, run :source, comment that line out and run :source again, you'll find that the setting persists. RC files are predominantly for backup and version control :)

@bovine3dom
Copy link
Member

bovine3dom commented Sep 5, 2021

Oh, and in RC files, newlines are special - they separate commands. You can escape them with \.

No other special characters can be escaped.

@OwenAR
Copy link
Author

OwenAR commented Sep 5, 2021

Well, learning it's persistent makes me significantly less confused
(although now I'm wondering how exactly that interacts with firefox sync...)

I'll have to poke around more, but for now, I just have one major practical problem:

I have a laptop which was not running any version of firefox before.
On it, on youtube, I need to use the ; and : keys (shift-, and shift-.) for "slow down" and "speed up" all the time.
(The laptop has a German keyboard, and < and > don't work for that for some reason... I suspect there's some weird complexity coming from the layout differences that shouldn't be there, but yeah...)

I have : working for "speed up",
and I've managed to unbind ;
but the ; keypress still doesn't go through to the "slow down" function in youtube
-- it just doesn't do anything at all (as far as I can tell).

My rc file has:

" to read this file, use {:source}. it's also read at broswer startup

	" this doesn't seem to be a thing that works
			" unbind all

	" make sure that unsetting an option here also resets it in the running session
		" Q: does this actually work as expected?
			sanitise tridactyllocal tridactylsync

	" hinting
			set hintchars nrtdeaiuhcglmpfvsokwbzjyqx
		" bak: old version:
			" set hintchars eaiouclvwxzpnrtsdhgfkbmy
			set hintnames short

	" newtab
		" i guess i *do* wanna see the docs for now
		" (not sure if it actually speeds things up at all to blank them out, or if that's just mental on my part)
			" set newtab about:blank

	" make tridactyl work on more sites at the expense of some security
		" NOTE: BROKEN STUFF FROM ANCIENT VERSION:
			" set csp clobber
		" SAME WITH THIS (I THINK):
			" fixamo_quiet

	" unbind various things
		" unbind basic keys
				unbind <c-u>
				unbind <c-d>
				unbind <c-f>
				unbind <c-b>
				unbind /
				unbind <F1>
			" Q: this works (it just gets normalized to "<Escape>")
				unbind <esc>

		" unbind dangerous keys i don't use [don't remember what these did and thus why i called them 'dangerous', but whatever]
				unbind d
				unbind w

		" unbind youtube hotkeys i want to use
				unbind k
				unbind f
				unbind N
				unbind >>
				unbind <<
				unbind .
				unbind ,
				unbind P
				unbind N
				unbind :
			" Q: this isn't needed?
				" unbind ::
			" Q: HOW DO I *REALLY* UNBIND SEMICOLON???
				unbind ;
				unbind ;;
				unbind \;
				unbind \;;
				unbind -;
				unbind -;;

	" but make sure i can always get into the console
			" bind : fillcmdline_notrail
			bind <c-:> fillcmdline_notrail source

	" open new tab next to current one
			bind <a-T> tabopen about:blank

	" vimfx keys
			bind r hint
			bind t hint -b
			bind d hint -qb
			bind a hint -y
			bind A hint -p
			bind n hint -;
			bind v hint -h
			bind D tabduplicate

	" next/prev page
			bind x tabprev
			bind * tabnext

and :viewconfig --user gives:

	hintchars:	"nrtdeaiuhcglmpfvsokwbzjyqx"
	hintnames:	"short"
	nmaps:    	
	          	<C-u>:   	null
	          	<C-d>:   	null
	          	<C-f>:   	null
	          	<C-b>:   	null
	          	/:       	null
	          	<F1>:    	null
	          	<Escape>:	null
	          	d:       	"hint-qb"
	          	w:       	null
	          	k:       	null
	          	f:       	null
	          	N:       	null
	          	>>:      	null
	          	<<:      	null
	          	.:       	null
	          	,:       	null
	          	P:       	null
	          	::       	null
	          	;:       	null
	          	;;:      	null
	          	\;:      	null
	          	\;;:     	null
	          	-;:      	null
	          	-;;:     	null
	          	<C-:>:   	"fillcmdline_notrailsource"
	          	<A-T>:   	"tabopenabout:blank"
	          	r:       	"hint"
	          	t:       	"hint-b"
	          	a:       	"hint-y"
	          	A:       	"hint-p"
	          	n:       	"hint-;"
	          	v:       	"hint-h"
	          	D:       	"tabduplicate"
	          	x:       	"tabprev"
	          	*:       	"tabnext"

@bovine3dom
Copy link
Member

Don't use sanitise in your RC file - it causes all kinds of trouble (see #1409). Run it whenever you need to.

The storage doesn't interact with Firefox sync. You can run firefoxsyncpu{sh,ll} on demand.

I understand what you mean about unbinding semicolon - you need to unbind all of the binds that start with semicolon. That's lots - see :viewconfig --default nmaps. Follow #3860 to hear when we implement a nicer solution.

@OwenAR
Copy link
Author

OwenAR commented Sep 5, 2021

Alright, I commented out the line with sanitise tridactyllocal tridactylsync
and I added:

	unbind ;i
	unbind ;b
	unbind ;o
	unbind ;I
	unbind ;k
	unbind ;K
	unbind ;y
	unbind ;Y
	unbind ;p
	unbind ;h
	unbind ;P
	unbind ;r
	unbind ;s
	unbind ;S
	unbind ;a
	unbind ;A
	unbind ;;
	unbind ;#
	unbind ;v
	unbind ;w
	unbind ;t
	unbind ;O
	unbind ;W
	unbind ;T
	unbind ;z
	unbind ;m
	unbind ;M
	unbind ;gi
	unbind ;gI
	unbind ;gk
	unbind ;gy
	unbind ;gp
	unbind ;gP
	unbind ;gr
	unbind ;gs
	unbind ;gS
	unbind ;ga
	unbind ;gA
	unbind ;g;
	unbind ;g#
	unbind ;gv
	unbind ;gw
	unbind ;gb
	unbind ;gF
	unbind ;gf

(all the entries that start with ; from viewconfig --default nmaps)

... but I'm still getting the same problem: : speeds up youtube vids, but ; does nothing??

@bovine3dom
Copy link
Member

When you type out :bind ; do you get any completions?

@OwenAR
Copy link
Author

OwenAR commented Sep 5, 2021

Yes, there was still a ;x and ;X, unbinding...

It works! Thank you! 😁

(
EDIT: for maximum convenient clarity to future me's, this is the full list of what I added to my rc:

	" unbinding semicolon
		"
			unbind ;o
			unbind ;I
			unbind ;k
			unbind ;K
			unbind ;y
			unbind ;Y
			unbind ;p
			unbind ;h
			unbind ;P
			unbind ;r
			unbind ;s
			unbind ;S
			unbind ;a
			unbind ;A
			unbind ;;
			unbind ;#
			unbind ;v
			unbind ;w
			unbind ;t
			unbind ;O
			unbind ;W
			unbind ;T
			unbind ;z
			unbind ;m
			unbind ;M
			unbind ;gi
			unbind ;gI
			unbind ;gk
			unbind ;gy
			unbind ;gp
			unbind ;gP
			unbind ;gr
			unbind ;gs
			unbind ;gS
			unbind ;ga
			unbind ;gA
			unbind ;g;
			unbind ;g#
			unbind ;gv
			unbind ;gw
			unbind ;gb
			unbind ;gF
			unbind ;gf
		"
			unbind ;x
			unbind ;X

(but obviously you'll need to go through the process above to check for yourself if they added any new ones. (ie, checking for any completions to :bind ;))
)

@OwenAR OwenAR closed this as completed Sep 5, 2021
@OwenAR OwenAR changed the title I'm having trouble finding some basic stuff in the documentation: What characters are special, and how do you escape them (eg how do you unbind semicolon)? What's the exact syntax for commenting stuff out in the rc file? [EDIT: "How do you unbind ; semicolon?"] I'm having trouble finding some basic stuff in the documentation: What characters are special, and how do you escape them (eg how do you unbind semicolon)? What's the exact syntax for commenting stuff out in the rc file? Sep 5, 2021
@OwenAR OwenAR changed the title [EDIT: "How do you unbind ; semicolon?"] I'm having trouble finding some basic stuff in the documentation: What characters are special, and how do you escape them (eg how do you unbind semicolon)? What's the exact syntax for commenting stuff out in the rc file? [EDIT: "How do you unbind semicolon? ;"] I'm having trouble finding some basic stuff in the documentation: What characters are special, and how do you escape them (eg how do you unbind semicolon)? What's the exact syntax for commenting stuff out in the rc file? Sep 5, 2021
@OwenAR OwenAR changed the title [EDIT: "How do you unbind semicolon? ;"] I'm having trouble finding some basic stuff in the documentation: What characters are special, and how do you escape them (eg how do you unbind semicolon)? What's the exact syntax for commenting stuff out in the rc file? [EDIT: "How do you unbind semicolon? ; "] I'm having trouble finding some basic stuff in the documentation: What characters are special, and how do you escape them (eg how do you unbind semicolon)? What's the exact syntax for commenting stuff out in the rc file? Sep 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants