Next: Update define-key, use get-default and add search-engines
parent
ad5169682f
commit
06c53487be
|
@ -1,16 +1,21 @@
|
||||||
(in-package :next)
|
(in-package :next)
|
||||||
|
|
||||||
;; Use development platform port.
|
;; Use development platform port.
|
||||||
(setf (slot-value *port* 'path)
|
(setf (get-default 'port 'path)
|
||||||
(format nil "~a/common-lisp/next/ports/gtk-webkit/next-gtk-webkit"
|
(format nil "~a/common-lisp/next/ports/gtk-webkit/next-gtk-webkit"
|
||||||
(uiop:getenv "HOME")))
|
(uiop:getenv "HOME")))
|
||||||
|
|
||||||
(define-key *global-map* (key "C-M-b") #'switch-buffer)
|
;; (setf (cdr (last (eval (get-default 'window 'search-engines))))
|
||||||
(define-key *global-map* (key "C-M-w") #'make-window)
|
;; '(("yt" . "https://www.youtube.com/results?search_query=~a")))
|
||||||
(define-key *global-map* (key "C-M-d") #'delete-buffer)
|
(nconc (eval (get-default 'window 'search-engines))
|
||||||
(define-key *global-map* (key "C-;") #'execute-extended-command)
|
'(("yt" . "https://www.youtube.com/results?search_query=~a")))
|
||||||
(define-key *global-map* (key "M-g") #'go-anchor-new-buffer)
|
|
||||||
(define-key *global-map* (key "C-M-C") #'kill)
|
(define-key (key "C-M-b") #'switch-buffer
|
||||||
|
(key "C-M-w") #'make-window
|
||||||
|
(key "C-M-d") #'delete-buffer
|
||||||
|
(key "C-;") #'execute-command
|
||||||
|
(key "M-g") #'go-anchor-new-buffer
|
||||||
|
(key "C-M-C") #'kill)
|
||||||
|
|
||||||
(defun eval-in-emacs (&rest s-exps)
|
(defun eval-in-emacs (&rest s-exps)
|
||||||
"Evaluate S-EXPS with emacsclient."
|
"Evaluate S-EXPS with emacsclient."
|
||||||
|
@ -37,7 +42,7 @@
|
||||||
:description ,title)))
|
:description ,title)))
|
||||||
`(org-capture))))
|
`(org-capture))))
|
||||||
|
|
||||||
(define-key *global-map* (key "C-M-o") #'org-capture)
|
(define-key (key "C-M-o") #'org-capture)
|
||||||
|
|
||||||
(define-command youtube-dl-current-page ()
|
(define-command youtube-dl-current-page ()
|
||||||
"Download a video in the currently open buffer."
|
"Download a video in the currently open buffer."
|
||||||
|
@ -46,10 +51,10 @@
|
||||||
(if (search "youtu" url)
|
(if (search "youtu" url)
|
||||||
`(progn (youtube-dl ,url) (youtube-dl-list))
|
`(progn (youtube-dl ,url) (youtube-dl-list))
|
||||||
`(ambrevar/youtube-dl-url ,url)))))
|
`(ambrevar/youtube-dl-url ,url)))))
|
||||||
(define-key *global-map* (key "C-M-c d") 'youtube-dl-current-page)
|
(define-key (key "C-M-c d") 'youtube-dl-current-page)
|
||||||
|
|
||||||
(define-command play-video-in-current-page ()
|
(define-command play-video-in-current-page ()
|
||||||
"Play video in the currently open buffer."
|
"Play video in the currently open buffer."
|
||||||
(with-result (url (buffer-get-url))
|
(with-result (url (buffer-get-url))
|
||||||
(uiop:run-program (list "mpv" url))))
|
(uiop:run-program (list "mpv" url))))
|
||||||
(define-key *global-map* (key "C-M-c v") 'play-video-in-current-page)
|
(define-key (key "C-M-c v") 'play-video-in-current-page)
|
||||||
|
|
Loading…
Reference in New Issue