diff options
Diffstat (limited to 'init.el')
-rw-r--r-- | init.el | 103 |
1 files changed, 78 insertions, 25 deletions
@@ -279,7 +279,9 @@ (setq auth-sources '("~/.emacs.d/authinfo.gpg" "~/.netrc")) (use-package epa-file - :init (setq epa-file-cache-passphrase-for-symmetric-encryption t) + :init (setq epa-file-cache-passphrase-for-symmetric-encryption t + epa-file-encrypt-to "A247C4780736A6156BC8DA748C081D34D321D881" + plstore-encrypt-to epa-file-encrypt-to) :config (epa-file-enable)) (require 'epa-file) @@ -910,6 +912,7 @@ ;;;; projects (use-package project :demand t) (global-set-key "\C-xp" 'jao-prev-window) +(use-package list-projects :ensure t) ;;;; buffer quit function (the triple ESC) (setq buffer-quit-function (lambda () t)) @@ -930,6 +933,15 @@ scroll-step 1 redisplay-skip-fontification-on-input nil)) +(use-package ultra-scroll + ;:load-path "~/code/emacs/ultra-scroll" ; if you git clone'd instead of using vc + :vc (:url "https://github.com/jdtsmith/ultra-scroll") ; For Emacs>=30 + :init + (setq scroll-conservatively 3 ; or whatever value you prefer, since v0.4 + scroll-margin 0) ; important: scroll-margin>0 not yet supported + :config + (ultra-scroll-mode 1)) + ;;;; show diffs when running C-x s (add-to-list 'save-some-buffers-action-alist `("d" @@ -937,6 +949,26 @@ (diff-buffer-with-file (buffer-file-name buffer))) "show diff between the buffer and its file")) +;;;; copy buffer file name +;; https://stackoverflow.com/questions/18812938/copy-full-file-path-into-copy-paste-clipboard +(defun copy-buffer-file-name-as-kill (choice) + "Copy the buffer-file-name to the kill-ring" + (interactive "cCopy Buffer Name (F) Full, (D) Directory, (N) Name") + (let ((new-kill-string) + (name (if (eq major-mode 'dired-mode) + (dired-get-filename) + (or (buffer-file-name) "")))) + (cond ((eq choice ?f) + (setq new-kill-string name)) + ((eq choice ?d) + (setq new-kill-string (file-name-directory name))) + ((eq choice ?n) + (setq new-kill-string (file-name-nondirectory name))) + (t (message "Quit"))) + (when new-kill-string + (message "%s copied" new-kill-string) + (kill-new new-kill-string)))) + ;;; Windows ;;;; splitting and switch (setq split-height-threshold 80 @@ -1293,9 +1325,10 @@ (defun jao-maybe-view-video (url &rest _ignored) (interactive) - (if (y-or-n-p "View video (y) or web page (n)? ") - (jao-view-video url) - (funcall jao-browse-url-function url))) + (let ((w (read-char "View video (v) or web page (w)? "))) + (cond ((eq w ?v) (jao-view-video url)) + ((eq w ?w) (funcall jao-browse-url-function url)) + (t (message "Aborted"))))) ;;;; web browsers (defun jao-www--buffer-p (b) @@ -1877,10 +1910,10 @@ ;;;; other git packages (use-package git-timemachine :ensure t) -(use-package consult-git-log-grep - :ensure t - :custom (consult-git-log-grep-open-function #'magit-show-commit) - :bind (("C-c K" . consult-git-grep))) +;; (use-package consult-git-log-grep +;; :ensure t +;; :custom (consult-git-log-grep-open-function #'magit-show-commit) +;; :bind (("C-c K" . consult-git-grep))) ;; git config --local git-link.remote / git-link.branch (use-package git-link :ensure t) @@ -2085,7 +2118,7 @@ (add-hook 'emacs-lisp-mode-hook #'jao-outline-minor-mode) (use-package edit-list :ensure t) -(use-package package-lint :ensure t) +;; (use-package package-lint :ensure t) ;; (use-package tree-inspector :ensure t) (defun elisp-disassemble (function) @@ -2395,6 +2428,11 @@ :config (venv-initialize-eshell) (jao-compilation-env "VIRTUAL_ENV")) +;;;; Javascript + +(use-package typescript-mode + :ensure t + :custom ((typescript-indent-level 2))) ;;; Text/data formats ;;;; json @@ -2488,7 +2526,13 @@ lui-track-behavior 'before-tracking-next-buffer) :config - (defsubst jao-circe-nick-no () (length (circe-channel-nicks))) + (defsubst jao-circe-nick-no () + (if (derived-mode-p 'circe-query-mode) + 2 + (length (circe-channel-nicks)))) + + (defsubst jao-circe-netowrk () + (or (plist-get lui-logging-format-arguments :network) "")) (define-minor-mode jao-circe-user-number-mode "" :lighter (:eval (format " [%s]" (jao-circe-nick-no)))) @@ -2496,10 +2540,13 @@ (defun jao-circe-channel-hook () (when jao-mode-line-in-minibuffer (setq header-line-format - '(" %b" (:eval (format " - %s nicks" (jao-circe-nick-no)))))) + '(" %b" (:eval (format "@%s - %s nicks" + (jao-circe-netowrk) + (jao-circe-nick-no)))))) (jao-circe-user-number-mode 1)) (add-hook 'circe-channel-mode-hook #'jao-circe-channel-hook) + (add-hook 'circe-query-mode-hook #'jao-circe-channel-hook) (defun circe-command-RECOVER (&rest _ignore) "Recover nick" @@ -2532,11 +2579,13 @@ (list "Bitlbee" :host "127.0.0.1" :nick u :channels jao-bitlbee-channels :lagmon-disabled t :nickserv-password u :user p)) - (list "localslack" :host "127.0.0.1" :nick "jao" + (list "bigml" :host "127.0.0.1" :nick "jao" :channels jao-slack-channels :port 9007 :lagmon-disabled t) (list "recoveryou" :host "127.0.0.1" :nick "jao" - :port 9008 :lagmon-disabled t))) + :port 9008 :lagmon-disabled t) + (list "grio" :host "127.0.0.1" :nick "jao" + :port 9009 :lagmon-disabled t))) (jao-shorten-modes 'circe-channel-mode 'circe-server-mode @@ -2619,8 +2668,11 @@ :init (setq mastodon-instance-url "https://fosstodon.org" mastodon-active-user "jao@gnu.org" + mastodon-group-notifications t + mastodon-images-in-notifs t mastodon-tl-position-after-update nil - mastodon-toot-display-orig-in-reply-buffer t) + mastodon-toot-display-orig-in-reply-buffer t + mastodon-media--hide-sensitive-media nil) :config ;; (defun jao-mastodon--setup () ;; (setq-local scroll-margin 12)) @@ -2722,15 +2774,13 @@ (jao-with-auth "matrix.org" u p (ement-connect :user-id u :password p)))) (when (and (fboundp 'mastodon) (or p (y-or-n-p "Connect to mastodon? "))) (mastodon)) - (when (or p (y-or-n-p "Connect to libera? ")) - (unless (get-buffer "irc.libera.chat:6697") - (circe "Libera Chat"))) - (when (or p (y-or-n-p "Connect to localslack? ")) - (unless (get-buffer "127.0.0.1:9007") - (circe "localslack"))) - (when (or p (y-or-n-p "Connect to recoveryou? ")) - (unless (get-buffer "127.0.0.1:9008") - (circe "recoveryou")))) + (dolist (c '(("Libera Chat" . "irc.libera.chat:6697") + ("bigml" . "127.0.0.1:9007") + ("recoveryou" . "127.0.0.1:9008") + ("grio" . "127.0.0.1:9009"))) + (unless (get-buffer (cdr c)) + (when (or p (y-or-n-p (format "Connect to %s? " (car c)))) + (circe (car c)))))) (defun jao-all-chats () (interactive) @@ -3287,7 +3337,8 @@ ("do" "open doc" jao-open-doc) ("dr" "search docs with recoll" jao-recoll-consult-docs)] ["Monitors" - ("p" "htop" jao-term-htop) + ("p" "list projects" list-projects) + ;; ("p" "htop" jao-term-htop) ("P" "pasytray" jao-toggle-pasystray-applet) ("x" "restart i3bar" jao-river-restart-i3bar :if jao-river-enabled-p) ("x" "restart xmobar" jao-xmobar-restart :if jao-exwm-enabled-p) @@ -3315,7 +3366,9 @@ ["Helpers" ("a" "aptitude" jao-term-aptitude) ("l" "packages" jao-list-packages) - ("r" "reveal" jao-reveal) + ;; ("r" "reveal" jao-reveal) + ("r" "translate" reverso) + ("f" "copy buffer file name" copy-buffer-file-name-as-kill) ("k" (lambda () (concat "keyboard" (when (jao-kb-toggled-p) "*"))) jao-kb-toggle :if jao-x11-p)]]) |