summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.config/nyxt/commands.lisp36
-rw-r--r--.config/nyxt/config.lisp3
2 files changed, 20 insertions, 19 deletions
diff --git a/.config/nyxt/commands.lisp b/.config/nyxt/commands.lisp
index e89bea0..1739793 100644
--- a/.config/nyxt/commands.lisp
+++ b/.config/nyxt/commands.lisp
@@ -1,3 +1,5 @@
+(in-package #:nyxt-user)
+
(defvar *thanos/search-engines*
(list
'("google" "https://google.com/search?q=~a")
@@ -25,23 +27,23 @@ t if so and nil otherwise. The URL must not contain spaces."
Applies `func` to the query`.
Requires the variable `*thanos/search-engines*` for search queries."
(cond
- ((or (str:starts-with-p "localhost" query))
- (funcall func (str:concat "http://" query)))
- ((direct-url-p query)
- (funcall func (str:concat "https://" query)))
- ((str:starts-with-p "http" query)
- (funcall func query))
- ((let ((split-result (str:split #\Space query)))
- (find (first split-result) *thanos/search-engines* :key #'first :test #'string=))
- (let* ((engine-tag (subseq query 0 (position #\Space query)))
- (query (subseq query (+ 1 (position #\Space query))))
- (engine (find engine-tag *thanos/search-engines* :key #'first :test #'string=))
- (search-url (second engine)))
- (funcall func (cl-ppcre:regex-replace "~a" search-url (quri:url-encode query)))))
- (t
- (let* ((engine (first (last *thanos/search-engines*)))
- (search-url (second engine)))
- (funcall func (cl-ppcre:regex-replace "~a" search-url (quri:url-encode query)))))))
+ ((or (str:starts-with-p "localhost" query))
+ (funcall func (str:concat "http://" query)))
+ ((direct-url-p query)
+ (funcall func (str:concat "https://" query)))
+ ((str:starts-with-p "http" query)
+ (funcall func query))
+ ((let ((split-result (str:split #\Space query)))
+ (find (first split-result) *thanos/search-engines* :key #'first :test #'string=))
+ (let* ((engine-tag (subseq query 0 (position #\Space query)))
+ (query (subseq query (+ 1 (position #\Space query))))
+ (engine (find engine-tag *thanos/search-engines* :key #'first :test #'string=))
+ (search-url (second engine)))
+ (funcall func (cl-ppcre:regex-replace "~a" search-url (quri:url-encode query)))))
+ (t
+ (let* ((engine (first (last *thanos/search-engines*)))
+ (search-url (second engine)))
+ (funcall func (cl-ppcre:regex-replace "~a" search-url (quri:url-encode query)))))))
(defun thanos/make-buffer-focus-url (url)
(make-buffer-focus :url url))
diff --git a/.config/nyxt/config.lisp b/.config/nyxt/config.lisp
index d7c8ca5..6540815 100644
--- a/.config/nyxt/config.lisp
+++ b/.config/nyxt/config.lisp
@@ -17,8 +17,7 @@ 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" "commands"))
-
+ :components ("keys" "colors" "commands"))
(define-configuration (:modable-buffer :prompt-buffer :editor-buffer)
"Set up Emacs keybindings everywhere possible."