Make it yours
Your configuration filePermalink to Your configuration file#
Everything so far has used Oriel's defaults. On this last page, we'll write a configuration file together and turn the quickmarks you've been adding into something you keep.
Oriel reads its configuration from ~/.config/oriel/config.sgl when it starts. There's no file there yet, and that's fine: without one, Oriel uses its defaults and doesn't complain. Create the file in your editor and put this in it:
(config
default-search: "ddg"
quickmarks: (quickmarks
"ddg" "https://duckduckgo.com/?q={}"
"mail" "https://fastmail.com"
"hub" "https://github.com/{}"))Let's read it from the outside in. config describes the changes you want, and you name each setting you're changing followed by its value, like default-search: "ddg". Anything you don't name keeps its default, so this file sets two things and leaves every key exactly as it was.
quickmarks takes pairs: a name, then its address. They work like the quickmarks you added with :quickmark-add in Find your way back, but now they're in a file you can keep in version control and copy to another machine. When a name is in both places, the one in this file wins, so the copies Oriel saved in quickmarks.sgv next to it are no longer used. You can delete those lines whenever you like.
default-search: names a quickmark that takes an argument, and Oriel uses it whenever what you type in the address prompt isn't an address. Oriel already comes with a ddg quickmark and searches with it by default, so o how to cook rice has worked since your first page. Your own quickmarks don't replace that built-in one, so you don't strictly need the ddg line. Writing it out keeps your search next to your other quickmarks, and it's the line to change when you'd rather search somewhere else.
See it take effectPermalink to See it take effect#
Oriel reads this file once, when it starts. Save it, close Oriel with :quit, and open it again. Now o mail opens your mail and o hub daviwil/dotfiles opens that repository.
What if you make a typo? Let's find out on purpose. Change "ddg" in the default-search: line to "dgg", save, and restart Oriel. It starts with its defaults instead of your file, and shows you what went wrong:
default-search: "dgg" isn't a quickmark with {} in it (/home/you/.config/oriel/config.sgl:2)
Using defaults. Fix the file and restart Oriel.Oriel never applies half a configuration. Either the whole file loads, or none of it does, so you never end up wondering which half of your settings is in effect. If the message has scrolled away, :config-error shows it again. Put "ddg" back, restart, and everything works again.
Add a keyPermalink to Add a key#
Now let's change a key. Say you'd like x to close a tab, because D means reaching for Shift. Add a nav-keymap: setting:
(config
default-search: "ddg"
quickmarks: (quickmarks
"ddg" "https://duckduckgo.com/?q={}"
"mail" "https://fastmail.com"
"hub" "https://github.com/{}")
nav-keymap: (keys "x" 'tab-close))nav-keymap: changes NAV mode, the one where Oriel has all your keys. keys takes pairs: a key sequence, then the command it runs. "x" is the key, written the way Emacs writes keys, so "C-x k" would be Control and x, then k. And 'tab-close is the same command D runs.
nav-keymap: adds your keys to the defaults, so D still works too. Commands you can bind has the full list of commands, and Change your keys covers replacing the whole keymap.
Keep tabs open when you stashPermalink to Keep tabs open when you stash#
In the stash workflow on the last page, ss closes tabs after saving. If you'd rather close them yourself, add stash-close-tabs: #f. In Sigil, #f means false and #t means true.
(config
default-search: "ddg"
quickmarks: (quickmarks
"ddg" "https://duckduckgo.com/?q={}"
"mail" "https://fastmail.com"
"hub" "https://github.com/{}")
nav-keymap: (keys "x" 'tab-close)
stash-close-tabs: #f)It's a programPermalink to It's a program#
I said at the start that your configuration is code, and here's what that buys you. Say you have several GitHub pages you visit, all starting with the same address. You can name that address once with define and build the rest from it:
(define github "https://github.com/")
(config
default-search: "ddg"
quickmarks: (quickmarks
"ddg" "https://duckduckgo.com/?q={}"
"mail" "https://fastmail.com"
"hub" (str github "{}")
"ghn" (str github "notifications")
"dot" (str github "daviwil/dotfiles"))
nav-keymap: (keys "x" 'tab-close))Definitions can go anywhere above the config, and the config has to come last. You don't need to know Sigil to keep a file like this one, but when you want to compute something, the whole language is there.
Where to go from herePermalink to Where to go from here#
That's the tutorial! You can browse without the mouse, switch tabs by name, get back to pages you've visited, and you have a configuration file that's yours.
You can also put tabs aside in a stash and bring them back when you're ready.
From here, the guides are there when you want them. Some good next steps:
Configure Oriel lists every setting and shows how to keep more than one configuration.
Change your keys covers how Oriel reads key sequences, and Commands you can bind lists every command.
Profiles and private browsing explains what Oriel saves between runs, and how to browse without saving anything.