dotfiles/nyxt/init.lisp
2021-05-25 08:23:58 -05:00

157 lines
4.4 KiB
Common Lisp

(in-package :nyxt-user) ; While implicit, this allows SLY to know which package we are in.
(define-configuration (prompt-buffer)
((default-modes (append '(vi-insert-mode) %slot-default%))))
;; Create a function to launch mpv with given url
(defun mpv (url)
"MPV launches with given url"
(uiop:run-program (list "mpv" url)))
;; Let's create a function to hint videos and play them in MPV
(define-command hint-mpv (&key nyxt/web-mode::annotate-visible-only-p)
"Show a set of element hints, and copy the URL of the user inputted one."
(nyxt/web-mode:query-hints "Copy element URL"
(lambda (nyxt/web-mode::result)
(echo (first nyxt/web-mode::result)))
:annotate-visible-only-p
nyxt/web-mode::annotate-visible-only-p))
(defvar *chris-keymap* (make-keymap "chris-map"))
(define-key *chris-keymap*
"K" 'switch-buffer-next
"J" 'switch-buffer-previous
"b" 'switch-buffer
"v" 'hint-mpv)
(define-mode chris-mode ()
"Dummy mode for the custom key bindings in `*chris-keymap*'."
((keymap-scheme (keymap:make-scheme
scheme:vi-normal *chris-keymap*))
(visible-in-status-p nil)))
(define-configuration buffer
((default-modes (append '(vi-normal-mode
auto-mode
reduce-tracking-mode
force-https-mode
chris-mode)
%slot-default%))))
(define-configuration status-buffer
((style
(str:concat
%slot-default%
(cl-css:css
'((body
:background "#282a36"
:color "#e2e4e5")
("#container"
:grid-template-columns "0px 0px 1.5fr 0px 2fr 0px 1fr 0px")
("#controls"
:background-color "#282a36"
:color "#f3f99d"
:width "0px"
:padding-left "0px"
:hidden)
("#url"
:background-color "#282a36"
:color "#5af78e")
("#modes"
:background-color "#282a36"
:color "#f3f99d")
("#tabs"
:background-color "#282a36"
:color "#5af78e")
(".tab"
:background-color "#282a36"
:color "#9aedfe")
(".tab:hover"
:background-color "#282a36"
:color "#f1f1f0")
(".button"
:background-color "#282a36"
:color "#5af78e")
(".button:hover"
:background-color "#282a36"
:color "#f1f1f0")
(".arrow"
:width "0px"
:height "0px")
(".arrow-right"
:background-color "#282a36"
:color "#5af78e")
(".arrow-left"
:background-color "#282a36"
:color "#5af78e")
))))))
(define-configuration internal-buffer
((style
(str:concat
%slot-default%
(cl-css:css
'((body
:background "#282a36"
:color "#e2e4e5")
(.button
:color "#e2e4e5")))))))
(define-configuration window
((message-buffer-style
(str:concat
%slot-default%
(cl-css:css
'((body
:background-color "#282a36"
:color "#e2e4e5")))))))
(define-configuration prompt-buffer
((style
(str:concat
%slot-default%
(cl-css:css
'((body
:background-color "#282a36"
:color "#e2e4e5")
("#prompt-area"
:background-color "#282a36"
:color "#57c7ff")
("#prompt"
:background-color "#282a36"
:color "#e2e4e5")
("#input"
:background-color "#282a36"
:color "#e2e4e5")
("#suggestions"
:background-color "#282a36"
:color "#e2e4e5")
(.source
:margin-left "5px")
(.source-name
:background-color "#282a36"
:color "#e2e4e5")
(.source-content
:background-color "#282a36"
:color "#e2e4e5")
(".source-content td"
:background-color "#282a36"
:color "#e2e4e5")
(".source-content th"
:background-color "#43454f"
:color "#e2e4e5")
("#selection"
:background-color "#57c7ff"
:color "#e2e4e5")
(.marked
:background-color "#5af78e"
:color "#e2e4e5")
(.selected
:background-color "#57c7ff"
:color "#e2e4e5")
(.button
:color "#e2e4e5")))))))
(load-after-system :slynk (nyxt-init-file "my-slynk.lisp"))