My Nyxt Configuration Files
This is my repo with small tweaks to Nyxt that make it more comfortable and personal. Things of interest here:
BEWARE: I’m always using most recent Nyxt possible, often building from master branch. While I try to make my configuration portable, I may fail to do so for your version, especially if you’re using any version other than latest stable or latest master. In particular, I’m going to drop all Nyxt 2.* configuration after the 3.0.0 release, so clone this if necessary.
The hub of configuration (init.lisp for 2.*, config.lisp AND init.lisp for 3.*)
This loads other configuration files:
- Nyxt-dependent:
- keybinds.lisp,
- passwd.lisp,
- slynk.lisp,
- status.lisp,
- style.lisp,
- commands.lisp,
- unpdf.lisp;
- and extension-dependent:
- ace.lisp
- kaomoji.lisp
- search-engines.lisp
- freestance.lisp
- dark-reader.lisp
And configures some basic things, like default modes for buffers.
Everything interesting is in other files.
There is also a load-after-system*
portability macro to load system and its configuration file on both Nyxt 2 and Nyxt 3.
Some custom keybindings (keybinds.lisp)
There are some things that irritate me in default keybindings (like C-R
in auto-mode
on 2.*) and I want to unbind/rebind these.
There are some commands that I lack keybindings for (e.g., password management, prompting history movement) and I want to add these.
A good example of how you can redefine mode keybinding there! There’s also a portable (between 2.* and 3.*) macro to redefine the whole keymap-schemes — alter-keyscheme
.
Alternative format for status-buffer (status.lisp)
I don’t like the default wordy version of status-buffer (especially with long mode names), so I define my own laconic-format-status
to make modeline a bit more minimalistic. Several helper functions (laconic-format-status-*
) are there to make things easier.
It’s currently all commented out as Nyxt’s status bar is a moving target that I cannot fully track.
This can evolve into an extension someday.
Styling (style.lisp)
I love dark themes everywhere, and I don’t like any colors but red. This have made me to do black-red-and-green laconia-theme. I’m trying to reproduce it in style.lisp.
Right now it uses the 3.0 theme
library (made by yours truly :P). If you’re on 2.* Nyxt, see 1416f93927f6e91050da82e81dafe37e3e713ebf for the way of configuration that might work for you.
Additional commands (commands.lisp)
I lack some things in Nyxt, like the ability to evaluate arbitrary Lisp expression without a REPL (there used to be a command for that in 1.5, but it was phased out) and horisontal split , so I hack those with some possibly non-portable things and internal Nyxt APIs. It’s mostly 3.*-only.
A barebones PDF text reader (unpdf.lisp)
This one leverages Nyxt 3.* improved request processing to redirect any PDF file I load to a separate buffer, where its text is parsed with pdftotext
. I like pdftotext
(even if it’s quite chaotic at times), so why not extend this passion to Nyxt? :P
Lots of search engines for different things (search-engines.lisp)
This file has actually evolved from small configuration to an extension: nx-search-engines, so now it’s basically an extension configuration. To use it, you need to do
(load-after-system* :nx-search-engines (nyxt-init-file "search-engines.lisp"))
in your init.lisp.
A KeePassXC configuration (passwd.lisp)
This used to contain a setup-keepassxc
function to setup KeePassXC to better work with built-in password interface. Now this function is merged upstream as part of this password interface, so what’s left is just a simple re-configuration of defaults.
Bookmarks relocation (bookmarks.lisp)
This is a file with all my bookmarks, Git-synced across devices. The snippet (in init.lisp) that enables it is:
(defmethod files:resolve ((profile nyxt:nyxt-profile) (file nyxt/bookmark-mode:bookmarks-file))
(uiop:parse-unix-namestring "~/.config/nyxt/bookmarks.lisp"))
Ace editor inside Nyxt (ace.lisp)
This configures nx-ace to work as a default editor-mode
. To enable it, you need to use
(load-after-system* :nx-ace (nyxt-init-file "ace.lisp"))
in your init.lisp.
Easy-to-paste Kaomojis (kaomoji.lisp)
I fell in love with Kaomojis, and I need an easy way to paste these in my browser. That’s why I made nx-kaomoji! Now I can paste over-emotional responses everywhere!
This file is simply a keybinding configuration. To enable nx-kaomoji, you need to use
(load-after-system* :nx-kaomoji (nyxt-init-file "kaomoji.lisp"))
in your init.lisp.
Using SLY with Nyxt (slynk.lisp)
This is a simple copy-paste from the developer manual, nothing interesting.
Redirections to free alternatives for Twitter/YouTube
I rely on kssytsrk/nx-freestance-handler here. It’s mostly plug-n-play, so not much configuration there.
A reasonable dark theme via Dark Reader
This is based on my extension using Dark Reader to offer a good dark theme for almost any website. Does nothing special – simply configures some colors for Dark Reader to work better with my theme from style.lisp.