Next: Switch to VI bindings
parent
24453ab4c2
commit
6700ee2ea8
|
@ -5,19 +5,14 @@
|
||||||
(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")))
|
||||||
|
|
||||||
;; (setf (cdr (last (eval (get-default 'window 'search-engines))))
|
(add-to-default-list 'vi-normal-mode 'buffer 'default-modes)
|
||||||
;; '(("yt" . "https://www.youtube.com/results?search_query=~a")))
|
|
||||||
|
;; ;; (setf (cdr (last (eval (get-default 'window 'search-engines))))
|
||||||
|
;; ;; '(("yt" . "https://www.youtube.com/results?search_query=~a")))
|
||||||
(nconc (eval (get-default 'window 'search-engines))
|
(nconc (eval (get-default 'window 'search-engines))
|
||||||
'(("q" . "http://quickdocs.org/search?q=~a")
|
'(("q" . "http://quickdocs.org/search?q=~a")
|
||||||
("yt" . "https://www.youtube.com/results?search_query=~a")))
|
("yt" . "https://www.youtube.com/results?search_query=~a")))
|
||||||
|
|
||||||
(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."
|
||||||
(let ((s-exps-string (cl-strings:replace-all
|
(let ((s-exps-string (cl-strings:replace-all
|
||||||
|
@ -25,9 +20,9 @@
|
||||||
`(progn ,@s-exps) :case :downcase)
|
`(progn ,@s-exps) :case :downcase)
|
||||||
;; Discard the package prefix.
|
;; Discard the package prefix.
|
||||||
"next::" "")))
|
"next::" "")))
|
||||||
(format *error-output* "Sending to Emacs:~%~a~%" s-exps-string)
|
(log:debug "Sending to Emacs: ~a" s-exps-string)
|
||||||
(uiop:run-program
|
(ignore-errors (uiop:run-program
|
||||||
(list "emacsclient" "--eval" s-exps-string))))
|
(list "emacsclient" "--eval" s-exps-string)))))
|
||||||
|
|
||||||
(define-command org-capture ()
|
(define-command org-capture ()
|
||||||
"Org-capture current page."
|
"Org-capture current page."
|
||||||
|
@ -43,7 +38,9 @@
|
||||||
:description ,title)))
|
:description ,title)))
|
||||||
`(org-capture))))
|
`(org-capture))))
|
||||||
|
|
||||||
(define-key (key "C-M-o") #'org-capture)
|
(define-key "C-M-o" #'org-capture)
|
||||||
|
(define-key :scheme :vi-normal
|
||||||
|
"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."
|
||||||
|
@ -52,10 +49,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 (key "C-M-c d") 'youtube-dl-current-page)
|
(define-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 (key "C-M-c v") 'play-video-in-current-page)
|
(define-key "C-M-c v" 'play-video-in-current-page)
|
||||||
|
|
Loading…
Reference in New Issue