diff options
Diffstat (limited to '.config/nyxt/config.lisp')
-rw-r--r-- | .config/nyxt/config.lisp | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/.config/nyxt/config.lisp b/.config/nyxt/config.lisp new file mode 100644 index 0000000..6300ad7 --- /dev/null +++ b/.config/nyxt/config.lisp @@ -0,0 +1,89 @@ +(in-package #:nyxt-user) + +#-quicklisp +(let ((quicklisp-init + (merge-pathnames "quicklisp/setup.lisp" (user-homedir-pathname)))) + (when (probe-file quicklisp-init) + (load quicklisp-init))) + +(defvar *web-buffer-modes* + '(:emacs-mode + ;; :blocker-mode :force-https-mode + :reduce-tracking-mode + :user-script-mode :bookmarklets-mode) + "The modes to enable in any web-buffer by default. +Extension files (like dark-reader.lisp) are to append to this list. + +Why the variable? Because it's too much hassle copying it everywhere.") + +(define-nyxt-user-system-and-load nyxt-user/basic-config + :components ("keybinds" "colorscheme")) + + +(define-configuration (:modable-buffer :prompt-buffer :editor-buffer) + "Set up Emacs keybindings everywhere possible." + ((default-modes `(:emacs-mode ,@%slot-value%)))) + +(define-configuration :prompt-buffer + "Make the attribute widths adjust to the content in them. + +It's not exactly necessary on master, because there are more or less +intuitive default widths, but these are sometimes inefficient (and +note that I made this feature so I want to have it :P)." + ((dynamic-attribute-width-p t))) + +;; (define-configuration :web-buffer +;; ((search-always-auto-complete-p +;; nil +;; :doc "I don't like search completion when I don't need it.") +;; (global-history-p +;; t +;; :doc "It was disabled after 2.2.4, while being a useful feature. +;; I'm forcing it here, because I'm getting lost in buffer-local +;; histories otherwise..."))) + +(define-configuration :web-buffer + "Basic modes setup for web-buffer." + ((default-modes `(,@*web-buffer-modes* ,@%slot-value%)))) + +;; (define-configuration :browser +;; "Set new buffer URL (a.k.a. start page, new tab page)." +;; ((default-new-buffer-url (quri:uri "nyxt:nyxt/mode/repl:repl")))) + +(define-configuration :hint-mode + "Set up QWERTY home row as the hint keys." + ((hints-alphabet "DSJKHLFAGNMXCWEIO"))) + +(defmethod files:resolve ((profile nyxt:nyxt-profile) (file nyxt/mode/bookmark:bookmarks-file)) + "Reroute the bookmarks to the config directory." + #p"~/.config/nyxt/bookmarks.lisp") + +(define-configuration :reduce-tracking-mode + ((query-tracking-parameters + (append '("utm_source" "utm_medium" "utm_campaign" "utm_term" "utm_content") + %slot-value%) + :doc "This is to strip UTM-parameters off all the links. +Upstream Nyxt doesn't have it because it may break some websites.") + (preferred-user-agent + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36" + :doc "Mimic Chrome on MacOS."))) + +;; Search engines + + +(defvar *my-search-engines* + (list + '("google" "https://google.com/search?q=~a" "https://google.com") + '("doi" "https://dx.doi.org/~a" "https://dx.doi.org/") + '("python3" "https://docs.python.org/3/search.html?q=~a" + "https://docs.python.org/3") + '("duck" "https://duckduckgo.com/?q=~a" "https://duckduckgo.com")) + "List of search engines.") + +(define-configuration context-buffer + "Go through the search engines above and make-search-engine out of them." + ((search-engines + (append %slot-default% + (mapcar + (lambda (engine) (apply 'make-search-engine engine)) + *my-search-engines*))))) |