From 6700ee2ea87895570df68728ff3caf8720be74ad Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Mon, 10 Jun 2019 11:21:15 +0200 Subject: [PATCH] Next: Switch to VI bindings --- .config/next/init.lisp | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/.config/next/init.lisp b/.config/next/init.lisp index d802e508..8e6a22d6 100644 --- a/.config/next/init.lisp +++ b/.config/next/init.lisp @@ -5,19 +5,14 @@ (format nil "~a/common-lisp/next/ports/gtk-webkit/next-gtk-webkit" (uiop:getenv "HOME"))) -;; (setf (cdr (last (eval (get-default 'window 'search-engines)))) -;; '(("yt" . "https://www.youtube.com/results?search_query=~a"))) +(add-to-default-list 'vi-normal-mode 'buffer 'default-modes) + +;; ;; (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)) '(("q" . "http://quickdocs.org/search?q=~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) "Evaluate S-EXPS with emacsclient." (let ((s-exps-string (cl-strings:replace-all @@ -25,9 +20,9 @@ `(progn ,@s-exps) :case :downcase) ;; Discard the package prefix. "next::" ""))) - (format *error-output* "Sending to Emacs:~%~a~%" s-exps-string) - (uiop:run-program - (list "emacsclient" "--eval" s-exps-string)))) + (log:debug "Sending to Emacs: ~a" s-exps-string) + (ignore-errors (uiop:run-program + (list "emacsclient" "--eval" s-exps-string))))) (define-command org-capture () "Org-capture current page." @@ -43,7 +38,9 @@ :description ,title))) `(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 () "Download a video in the currently open buffer." @@ -52,10 +49,10 @@ (if (search "youtu" url) `(progn (youtube-dl ,url) (youtube-dl-list)) `(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 () "Play video in the currently open buffer." (with-result (url (buffer-get-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)