Compare commits

..
1 Commits
Author SHA1 Message Date
JosephFerano 526b2e1f87 emacs: emacs style ergonomic buffer keybindings, more clean up 2026-04-12 20:36:37 +08:00
6 changed files with 113 additions and 274 deletions

No files matched your search

+1 -1
View File
@@ -101,7 +101,7 @@
(buffer-size)
(erase-buffer)
(goto-char (point-min))
(insert-image (create-image (expand-file-name "Emacs@256.png" user-emacs-directory)))
(insert-image (create-image "/home/joe/.config/emacs/Emacs@256.png"))
(insert "\n\n\n")
(insert "Welcome to Emacs!\n\n")
;; (dashboard-insert-center "testing this thing out\n\n")
+102 -226
View File
@@ -205,7 +205,6 @@ Finish up
all-the-icons-completion
;; eat
;; Enhancements
centaur-tabs
olivetti
helpful
vterm
@@ -270,7 +269,7 @@ need to benchmark slow init times later.
** Misc Stuff
#+begin_SRC emacs-lisp
(setq default-directory (expand-file-name "~"))
(setq default-directory "/home/joe/")
(setq vc-follow-symlinks t) ; Visit real file when editing a symlink without prompting.
(global-auto-revert-mode t) ; Revert buffer's file when the file changes on disk
@@ -532,8 +531,8 @@ Setup other stuff
;; TODO Likely not needed anymore
(dolist (mode '(dired-mode-hook lsp-help-mode-hook fundamental-mode-hook))
(add-hook mode (lambda () (setq truncate-lines t))))
;; (dolist (mode '(dired-mode-hook lsp-help-mode-hook fundamental-mode-hook))
;; (add-hook mode (lambda () (setq truncate-lines t))))
#+end_src
Ligatures... are they that useful?
@@ -640,7 +639,7 @@ Emacs is an great operating system, if only it had a good text editor...
(global-set-key (kbd "M-o") #'joe/insert-line-below)
(global-set-key (kbd "M-O") #'joe/insert-line-above)
(setq-default truncate-lines t)
;; (setq-default truncate-lines nil)
(setq-default truncate-partial-width-windows nil)
(defun joe/backward-kill-word-or-kill-region ()
@@ -809,6 +808,25 @@ Fill region is great, except when you don't need it...
(evil-get-auxiliary-keymap joe/evil-space-mode-map state t t)
state))
(evil-define-key 'normal joe/evil-space-mode-map
(kbd "SPC fb") 'bookmark-jump
(kbd "SPC fr") 'consult-recent-file
(kbd "SPC ff") 'project-find-file
(kbd "SPC fa") '(lambda () (interactive) (project-find-file t))
(kbd "SPC fi") 'joe/edit-init
(kbd "SPC bi") 'ibuffer
(kbd "SPC bu") 'recentf-open-most-recent-file
(kbd "SPC bm") 'joe/toggle-buffer-mode
(kbd "SPC br") 'joe/revert-buffer-no-confirm
(kbd "SPC ss") 'joe/vterm-here
(kbd "SPC sv") 'vterm-other-window
(kbd "SPC mm") 'mu4e
(kbd "SPC cl") 'consult-line
(kbd "SPC cy") 'consult-yank-from-kill-ring
(kbd "SPC cg") 'consult-ripgrep
(kbd "SPC cF") 'consult-find
(kbd "SPC co") 'consult-outline)
(define-key evil-window-map "u" #'winner-undo)
(define-key evil-window-map "U" #'winner-redo)
@@ -845,13 +863,6 @@ Fill region is great, except when you don't need it...
(setq evil-goggles-pulse t)
(setq evil-goggles-async-duration 0.55)
(defun joe/evil-search-symbol-forward ()
(interactive)
(evil-search-word t nil t))
(evil-global-set-key 'normal "*" #'joe/evil-search-symbol-forward)
(evil-global-set-key 'normal "#" #'evil-search-word-forward)
;; Recenter lines after mark jump
;; (defun joe/recenter-after-goto-mark ()
;; (interactive)
@@ -946,18 +957,6 @@ Fill region is great, except when you don't need it...
(keymap-set smartparens-mode-map "M-(" 'sp-wrap-round)
(keymap-set smartparens-mode-map "M-[" 'sp-wrap-square)
(keymap-set smartparens-mode-map "M-{" 'sp-wrap-curly)
(defun sp-wrap-single-quote ()
(interactive)
(sp-wrap-with-pair "'"))
(defun sp-wrap-double-quote ()
(interactive)
(sp-wrap-with-pair "\""))
(keymap-set smartparens-mode-map "M-'" 'sp-wrap-single-quote)
(keymap-set smartparens-mode-map "M-\"" 'sp-wrap-double-quote)
#+end_src
*** expand-region
#+begin_src emacs-lisp
@@ -1021,7 +1020,10 @@ Fill region is great, except when you don't need it...
(require 'all-the-icons-ibuffer)
(add-hook 'ibuffer-mode-hook #'all-the-icons-ibuffer-mode)
(global-set-key [remap list-buffers] 'ibuffer)
(global-set-key (kbd "C-x b") #'consult-buffer)
(evil-define-key '(normal insert visual emacs) 'global
(kbd "C-b") #'consult-buffer)
(evil-define-key '(normal insert visual emacs) 'global
(kbd "C-S-b") #'ibuffer)
(defun joe/switch-other-buffer ()
"Switch to other buffer"
@@ -1029,7 +1031,6 @@ Fill region is great, except when you don't need it...
(switch-to-buffer (other-buffer)))
(global-set-key (kbd "C-x l") 'joe/switch-other-buffer)
(global-set-key (kbd "C-x C-l") 'joe/switch-other-buffer)
(save-place-mode t)
(setq save-place-file (expand-file-name "places" user-emacs-directory))
@@ -1069,78 +1070,6 @@ Harpoon lets you quickly switch between bookmarked buffers
#+end_src
*** Centaur Tabs
#+begin_src emacs-lisp
;; (require 'centaur-tabs)
(setq centaur-tabs-set-bar 'under)
(setq x-underline-at-descent-line t)
(setq centaur-tabs-set-close-button nil)
(setq centaur-tabs-set-icons t)
(setq centaur-tabs-show-navigation-buttons nil)
(setq centaur-tabs-set-modified-marker nil)
(setq centaur-tabs-show-new-tab-button nil)
(setq centaur-tabs-label-fixed-length 0)
(setq centaur-tabs-label-rename-function
(lambda (buf) (if (> (length (buffer-name buf)) 20)
(concat (substring (buffer-name buf) 0 17) "...")
(buffer-name buf))))
(global-set-key (kbd "s-n") #'centaur-tabs-forward-tab)
(global-set-key (kbd "s-p") #'centaur-tabs-backward-tab)
(global-set-key (kbd "C-s-p") #'centaur-tabs-forward-group)
(global-set-key (kbd "C-s-n") #'centaur-tabs-backward-group)
(global-set-key (kbd "s-P") #'centaur-tabs-move-current-tab-to-left)
(global-set-key (kbd "s-N") #'centaur-tabs-move-current-tab-to-right)
(let ((modes '(magit-status-mode
dired-mode
mu4e-main-mode
mu4e-headers-mode
mu4e-view-mode)))
(dolist (mode modes)
(add-hook (intern (concat (symbol-name mode) "-hook"))
(lambda () (centaur-tabs-local-mode -1)))))
(with-eval-after-load 'centaur-tabs
(defun joe/fix-centaur-tabs (THEME)
(centaur-tabs-mode -1)
(centaur-tabs-mode))
(advice-add 'consult-theme :after #'joe/fix-centaur-tabs)
(defun centaur-tabs-buffer-groups ()
(list
(cond
;; Work buffers: REPLs, Claude, Chat, eww, cider-repl
((or (derived-mode-p 'comint-mode)
(derived-mode-p 'sql-interactive-mode)
(derived-mode-p 'compilation-mode)
(derived-mode-p 'compilation-mode)
(string-match "^\\*HTTP" (buffer-name))
(string-match "^\\*cider-repl" (buffer-name))
(bound-and-true-p gptel-mode)
(derived-mode-p 'eww-mode))
"Work")
;; Special *buffers* (scratch, Messages, etc.)
((and (string-equal "*" (substring (buffer-name) 0 1))
(not (string-match "^\\*Org Src" (buffer-name))))
"*Buffers*")
;; Everything else in one group
(t
"Emacs")))))
(global-set-key (kbd "M-1") 'centaur-tabs-select-visible-tab)
(global-set-key (kbd "M-2") 'centaur-tabs-select-visible-tab)
(global-set-key (kbd "M-3") 'centaur-tabs-select-visible-tab)
(global-set-key (kbd "M-4") 'centaur-tabs-select-visible-tab)
(global-set-key (kbd "M-5") 'centaur-tabs-select-visible-tab)
(global-set-key (kbd "M-6") 'centaur-tabs-select-visible-tab)
(global-set-key (kbd "M-7") 'centaur-tabs-select-visible-tab)
(global-set-key (kbd "M-8") 'centaur-tabs-select-visible-tab)
(global-set-key (kbd "M-9") 'centaur-tabs-select-visible-tab)
(centaur-tabs-mode +1)
#+end_src
*** Window Management
#+begin_src emacs-lisp
@@ -1531,63 +1460,19 @@ odd looking ~'(t .t)~ is for specifying a default for all other actions.
;; (require 'consult-lsp)
(defvar consult-map (make-sparse-keymap))
(global-set-key (kbd "C-;") consult-map)
(define-key consult-map (kbd "a") 'command-a)
;; Bind the prefix
(define-key consult-map (kbd "l") #'consult-line)
(define-key consult-map (kbd "C-l") #'consult-line-multi)
(define-key consult-map (kbd "F") #'consult-find)
(define-key consult-map (kbd "g") #'consult-ripgrep)
(define-key consult-map (kbd "y") #'consult-yank-from-kill-ring)
(define-key consult-map (kbd "r") #'consult-recent-file)
(define-key consult-map (kbd "i") #'consult-imenu)
(define-key consult-map (kbd "t") #'consult-theme)
(global-set-key (kbd "C-. C-l") 'consult-line)
(global-set-key (kbd "C-. C-i") 'consult-imenu)
(global-set-key (kbd "C-. C-t") 'joe/consult-theme)
(global-set-key (kbd "C-. C-r") 'consult-recent-file)
(global-set-key (kbd "C-. C-y") 'consult-yank-from-kill-ring)
(defun joe/evil-search-symbol-forward ()
(interactive)
(evil-search-word-forward 1 t))
(evil-global-set-key 'normal "*" #'joe/evil-search-symbol-forward)
(evil-global-set-key 'normal "#" #'evil-search-word-forward)
(defun joe/consult-line-symbol-at-point ()
"Search for a line matching the symbol found near point."
(interactive)
(consult-line
(or (thing-at-point 'symbol))))
(defun joe/consult-line-word-at-point ()
"Search for a line matching the word found near point."
(interactive)
(consult-line
(or (thing-at-point 'word))))
(defun joe/consult-ripgrep-symbol-at-point ()
"Run consult-ripgrep with the symbol at point as the initial search term."
(interactive)
(let* ((term (thing-at-point 'symbol))
(search-term (if term term "")))
(consult-ripgrep nil search-term)))
(defun joe/consult-ripgrep-word-at-point ()
"Run consult-ripgrep with the word at point as the initial search term."
(interactive)
(let* ((term (thing-at-point 'symbol))
(search-term (if term term "")))
(consult-ripgrep default-directory search-term)))
(define-key consult-map (kbd ".") #'joe/consult-line-symbol-at-point)
(define-key consult-map (kbd "C-.") #'joe/consult-line-word-at-point)
(define-key consult-map (kbd ",") #'joe/consult-ripgrep-symbol-at-point)
(define-key consult-map (kbd "C-,") #'joe/consult-ripgrep-word-at-point)
#+end_src
*** Orderless
#+begin_src emacs-lisp
(require 'orderless)
(setq completion-styles '(orderless basic)
(require 'orderless)
(setq completion-styles '(orderless basic)
completion-category-overrides '((file (styles basic partial-completion))))
#+end_src
** App Launcher
@@ -1656,7 +1541,7 @@ odd looking ~'(t .t)~ is for specifying a default for all other actions.
(kbd "M-l") #'dirvish-ls-switches-menu
(kbd "M-m") #'dirvish-mark-menu
(kbd "M-t") #'dirvish-layout-toggle
(kbd "M-<return>") #'dirvish-setup-menu
(kbd "M-s") #'dirvish-setup-menu
(kbd "M-e") #'dirvish-emerge-menu
(kbd "M-j") #'dirvish-fd-jump)))
@@ -1695,8 +1580,6 @@ odd looking ~'(t .t)~ is for specifying a default for all other actions.
(require 'mu4e)
(setq mu4e-use-maildirs-extension nil)
(global-set-key (kbd "C-c m") #'mu4e)
;; Attach files to a message composition buffer by going into `dired'
;; and doing C-c C-m C-a (M-x `gnus-dired-attach').
(require 'gnus-dired) ; does not require `gnus'
@@ -1790,11 +1673,13 @@ odd looking ~'(t .t)~ is for specifying a default for all other actions.
;; (:name "Ferano.io Unread" :query "m:/ferano.io/Inbox AND g:unread" :key ?u)))
#+end_src
** Avy
#+begin_src emacs-lisp
(require 'avy)
(setq avy-case-fold-search nil)
(setq avy-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l ?q ?w ?e ?r ?u ?i ?o ?p ?z ?x ?c ?v ?n ?m))
(global-set-key (kbd "M-s") #'avy-goto-char) ;; I use this most frequently
;; (define-key global-map (kbd "C-;") 'avy-goto-char) ;; I use this most frequently
(define-key global-map (kbd "M-s") 'avy-goto-char) ;; I use this most frequently
;; (define-key global-map (kbd "C-'") 'avy-goto-line) ;; Consistent with ivy-avy
(define-key global-map (kbd "M-g c") 'avy-goto-char)
(define-key global-map (kbd "M-g e") 'avy-goto-word-0) ;; lots of candidates
@@ -1837,7 +1722,8 @@ odd looking ~'(t .t)~ is for specifying a default for all other actions.
(with-current-buffer vterm-buf
(setq popper-popup-status 'raised))))
(global-set-key (kbd "C-c t") #'joe/vterm-here)
;; (global-set-key (kbd "C-c t") #'vterm)
;; (global-set-key (kbd "C-c T") #'joe/vterm-here)
;; (setq explicit-shell-file-name "~/Development/fell/fell")
(add-hook 'shell-mode (lambda () (setq-local global-hl-line-mode nil)))
(setq shell-kill-buffer-on-exit t)
@@ -2028,7 +1914,6 @@ These help speed eglot up apparently [[https://www.reddit.com/r/emacs/comments/1
(setq lsp-modeline-diagnostics-enable nil)
(setq lsp-modeline-code-actions-enable nil)
(setq lsp-lens-enable nil)
(setq lsp-ui-doc-show-with-mouse nil)
(setq lsp-signature-auto-activate nil)
(setq lsp-eldoc-enable-hover nil)
(setq eldoc-echo-area-use-multiline-p 'truncate-sym-name-if-fit)
@@ -2048,7 +1933,14 @@ These help speed eglot up apparently [[https://www.reddit.com/r/emacs/comments/1
(evil-global-set-key 'normal (kbd "M-D") #'lsp-describe-thing-at-point)
(evil-global-set-key 'normal (kbd "M-r") #'lsp-rename)
(evil-global-set-key 'insert (kbd "M-i") #'lsp-signature-activate)
(evil-global-set-key 'normal (kbd "gD") #'xref-find-definitions-other-window))
(evil-global-set-key 'normal (kbd "gD") #'xref-find-definitions-other-window)
(evil-global-set-key 'normal (kbd "SPC la") #'lsp-execute-code-action)
(evil-global-set-key 'normal (kbd "SPC lt") #'lsp-find-type-definition)
(evil-global-set-key 'normal (kbd "SPC lr") #'lsp-find-references)
(evil-global-set-key 'normal (kbd "SPC ld") #'lsp-find-definition)
(evil-global-set-key 'normal (kbd "SPC ls") #'consult-lsp-symbols)
(evil-global-set-key 'normal (kbd "SPC lD") #'consult-lsp-diagnostics)
(evil-global-set-key 'normal (kbd "SPC lf") #'consult-lsp-file-symbols))
#+end_src
@@ -2104,7 +1996,6 @@ start it, so go through all existing buffers that match the mode and belong to t
(defun joe/flycheck-buffer-and-previous () (interactive) (flycheck-buffer) (flycheck-previous-error))
(defun joe/flycheck-clear-if-active ()
(interactive)
(when (bound-and-true-p flycheck-mode)
(flycheck-clear)))
@@ -2177,54 +2068,30 @@ start it, so go through all existing buffers that match the mode and belong to t
#+end_src
** AI
#+begin_src emacs-lisp
(defun joe/read-file-or-nil (filename)
"Read FILENAME from emacs directory, return nil if file doesn't exist."
(let ((path (expand-file-name filename user-emacs-directory)))
(when (file-exists-p path)
(with-temp-buffer
(insert-file-contents path)
(string-trim (buffer-string))))))
(setq gptel-default-mode #'org-mode)
(when-let ((gpt-key (joe/read-file-or-nil "gptel-gpt-key")))
(setq gptel-api-key gpt-key))
(when-let ((claude-key (joe/read-file-or-nil "gptel-key")))
(gptel-make-anthropic "Claude" :stream t :key claude-key)
(setq gptel-model 'claude-sonnet-4-6)
(setq gptel-backend (gptel-get-backend "Claude")))
(when-let ((gpt-key (joe/read-file-or-nil "gptel-gpt-key")))
(gptel-make-openai "ChatGPT" :stream t :key gpt-key))
(setq gptel-api-key (with-temp-buffer
(insert-file-contents (expand-file-name "gptel-gpt-key" user-emacs-directory))
(buffer-string)))
(gptel-make-anthropic "Claude" :stream t :key (with-temp-buffer
(insert-file-contents (expand-file-name "gptel-key" user-emacs-directory))
(buffer-string)))
(setq gptel-prompt-prefix-alist '((markdown-mode . "### ")
(org-mode . "* ")
(text-mode . "### ")))
(setq gptel-cache '(system message))
;; (setq gptel-log-level 'debug)
(define-prefix-command 'joe/gptel-map)
(global-set-key (kbd "C-c a") 'joe/gptel-map)
(evil-define-key 'normal joe/evil-space-mode-map (kbd "SPC a a") #'gptel)
(evil-define-key 'normal joe/evil-space-mode-map (kbd "SPC a RET") #'gptel-ask)
(evil-define-key 'normal joe/evil-space-mode-map (kbd "SPC a M") #'gptel-mode)
(evil-define-key 'normal joe/evil-space-mode-map (kbd "SPC a c") #'gptel-add) ;; Will delete context at point
(evil-define-key 'normal joe/evil-space-mode-map (kbd "SPC a A") #'gptel-abort)
(evil-define-key 'normal joe/evil-space-mode-map (kbd "SPC a <backspace>") #'joe/gptel-context-remove-all)
(define-key joe/gptel-map (kbd "a") #'gptel)
;; (define-key joe/gptel-map (kbd "RET") #'gptel-ask)
(define-key joe/gptel-map (kbd "m") #'gptel-mode)
(define-key joe/gptel-map (kbd "RET") #'gptel-add)
(define-key joe/gptel-map (kbd "q") #'gptel-abort)
(define-key joe/gptel-map (kbd "<backspace>") #'joe/gptel-context-remove-all)
(define-key joe/gptel-map (kbd "r") #'gptel-rewrite)
(defun gptel-mark-region-role (start end role)
"Mark region from START to END with the llm or user role."
(interactive (list (region-beginning) (region-end)
(completing-read "Mark region role as: " '(response prompt))))
(if (or (not transient-mark-mode)
(use-region-p))
(with-silent-modifications
(put-text-property start end 'gptel (and (equal role "response") 'response))
(message "Region marked as %s" role))
(message "No region specified, action canceled")))
(evil-define-key 'visual joe/evil-space-mode-map (kbd "SPC a r") #'gptel-rewrite)
(evil-define-key 'visual joe/evil-space-mode-map (kbd "SPC a RET") #'gptel-ask)
(evil-define-key 'visual joe/evil-space-mode-map (kbd "SPC a c") #'gptel-add)
(setq gptel-model 'claude-sonnet-4-6)
(setq gptel-backend (gptel-get-backend "Claude"))
#+end_src
gptel-context-remove-all without confirmation
@@ -2284,6 +2151,27 @@ nice to add some more functionality similar to gptel-quick, like dwim behavior
(clipboard-kill-region (point-min) (point-max)))
#+end_src
** Programming Languages
*** COMMENT treesitter
#+begin_src emacs-lisp
(setq major-mode-remap-alist
'((csharp-mode . csharp-ts-mode)))
#+end_src
To run the default hooks, I came up with this, which is either really stupid or really cool.
This checks if it’s a ts mode then runs their counterparts.
– MahmoudAdam
[[https://www.emacswiki.org/emacs/Tree-sitter][Link]]
#+begin_src emacs-lisp
(defun run-non-ts-hooks ()
(let ((major-name (symbol-name major-mode)))
(when (string-match-p ".*-ts-mode" major-name)
(run-hooks (intern (concat (replace-regexp-in-string "-ts" "" major-name) "-hook"))))))
(add-hook 'prog-mode-hook 'run-non-ts-hooks)
#+end_src
*** Clojure
#+begin_src emacs-lisp
(require 'clojure-mode)
@@ -2430,7 +2318,7 @@ it doesn't close it.
(deactivate-mark))))
;; This is required so that .dir-locals that read env files for credentials works
;; (require 'dotenv)
(require 'dotenv)
(defun joe/sql-mode-hook ()
(define-key sql-mode-map (kbd "C-M-h") #'joe/mark-sql-defun)
(define-key sql-mode-map (kbd "C-M-x") #'sql-send-pg-function)
@@ -2510,7 +2398,6 @@ Apparently this helps with the performance of dape, as well as LSP
** org-mode
*** General
#+begin_src emacs-lisp
(require 'org)
(setq org-todo-keywords '((sequence "TODO" "IN-PROGRESS" "|" "DONE" "BACKLOG")))
(setq org-directory "~/Notes/")
@@ -2619,6 +2506,7 @@ Org mode buffers have associated files.
(700 900 1200 1700 1900 2030 2300)
" ═════ "
" ════════════════════ "))
(define-key global-map (kbd "C-c a") #'org-agenda)
(setq org-agenda-custom-commands
'(("n" "Agenda and all TODOs"
@@ -2760,7 +2648,7 @@ with the cursor you hit TAB and you complete the following;
(setq org-download-image-dir "./Images/")
(setq org-download-heading-lvl nil)
#+end_src
*** COMMENT org-transclusion
*** org-transclusion
#+begin_src emacs-lisp
(define-key global-map (kbd "C-c t t") #'org-transclusion-mode)
(define-key global-map (kbd "C-c t a") #'org-transclusion-add)
@@ -2783,25 +2671,14 @@ with the cursor you hit TAB and you complete the following;
#+end_src
** Calendar
#+begin_src emacs-lisp
(defun joe/fit-text-scale-to-window ()
"Scale text so buffer content fills the window width."
(let* ((window (get-buffer-window (current-buffer)))
(win-width (window-body-width window t)) ; pixels
(char-width (frame-char-width))
(buffer-cols 90) ; nano-calendar is 90 chars wide
(desired-scale (log (/ (float win-width)
(* char-width buffer-cols))
1.2)))
(text-scale-set (floor desired-scale))))
(defun joe/nano-calendar ()
(interactive)
(nano-calendar)
(with-current-buffer "*nano-calendar*"
(joe/fit-text-scale-to-window)
(text-scale-set 2)
(evil-emacs-state)))
(global-set-key (kbd "C-c M-c") #'joe/nano-calendar)
(evil-global-set-key 'normal (kbd "SPC cc") #'joe/nano-calendar)
#+end_src
** Magit
@@ -2813,11 +2690,11 @@ The best git porcelain/client I've ever used. Also kill stray magit buffers left
(defun joe/magit-kill-buffers (param)
"Restore window configuration and kill all Magit buffers."
(let ((buffers (magit-mode-get-buffers)))
;; (magit-restore-window-configuration)
(magit-restore-window-configuration)
(mapc #'kill-buffer buffers)))
(when (boundp 'evil-mode)
(add-hook 'with-editor-mode-hook 'evil-emacs-state))
(add-hook 'with-editor-mode-hook 'evil-insert-state))
(setq magit-bury-buffer-function #'joe/magit-kill-buffers)
(setq magit-clone-set-remote.pushDefault t)
@@ -2830,14 +2707,11 @@ The best git porcelain/client I've ever used. Also kill stray magit buffers left
(display-buffer buffer '(display-buffer-same-window)))))
(magit-status)))
(define-prefix-command 'joe/magit-map)
(global-set-key (kbd "C-x g") 'joe/magit-map)
(evil-define-key 'normal joe/evil-space-mode-map (kbd "SPC g h") #'joe/magit-status-here)
(evil-define-key 'normal joe/evil-space-mode-map (kbd "SPC g f") #'magit-find-file)
;; (define-key magit-mode-map "h" 'backward-char)
;; (define-key magit-mode-map "l" 'backward-char)
(define-key joe/magit-map (kbd "g") #'magit-status)
(define-key joe/magit-map (kbd "h") #'joe/magit-status-here)
(define-key joe/magit-map (kbd "f") #'magit-find-file)
(evil-set-initial-state 'magit-status-mode 'emacs)
#+end_src
TODO: We need to create a var for a project based base branch
@@ -2859,8 +2733,10 @@ TODO: We need to create a var for a project based base branch
nil nil "origin/dev")))
(magit-log-other (list (concat base "..HEAD")))))
(define-key joe/magit-map (kbd "b") #'joe/magit-diff-branch-changes)
(define-key joe/magit-map (kbd "l") #'joe/magit-log-branch-commits)
(with-eval-after-load 'magit
(evil-define-key 'normal joe/evil-space-mode-map (kbd "SPC g b") #'joe/magit-diff-branch-changes)
(evil-define-key 'normal joe/evil-space-mode-map (kbd "SPC g l") #'joe/magit-log-branch-commits))
#+end_src
** Restclient
@@ -2877,7 +2753,7 @@ TODO: We need to create a var for a project based base branch
** Initial Buffer
#+begin_src emacs-lisp
(load-file (expand-file-name "elisp/welcome.el" user-emacs-directory))
(load-file "/home/joe/.config/emacs/elisp/welcome.el")
#+end_src
* COMMENT Local variables
;; Local Variables:
+5 -3
View File
@@ -1,3 +1,6 @@
if status is-interactive
# Commands to run in interactive sessions can go here
end
set -gx XDG_CONFIG_HOME /home/joe/.config
set -gx XDG_DATA_HOME /home/joe/.local/share
set -gx XDG_CACHE_HOME /home/joe/.cache
@@ -73,13 +76,12 @@ end
fish_ssh_agent
# The next line updates PATH for the Google Cloud SDK.
# if [ -f '/home/joe/Downloads/google-cloud-sdk/path.fish.inc' ]; . '/home/joe/Downloads/google-cloud-sdk/path.fish.inc'; end
if [ -f '/home/joe/Downloads/google-cloud-sdk/path.fish.inc' ]; . '/home/joe/Downloads/google-cloud-sdk/path.fish.inc'; end
# opam configuration
# source /home/joe/.opam/opam-init/init.fish > /dev/null 2> /dev/null; or true
source /home/joe/.opam/opam-init/init.fish > /dev/null 2> /dev/null; or true
if test -e "/home/joe/Repositories/emsdk/emsdk_env.fish"
source "/home/joe/Repositories/emsdk/emsdk_env.fish"
set -gx EMSDK_QUIET 1
end
alias claude="/home/joe/.claude/local/claude"
+2 -2
View File
@@ -15,7 +15,7 @@ SETUVAR WINEPREFIX:/home/joe/\x2elocal/share/wine
SETUVAR XDG_CACHE_HOME:/home/joe/\x2ecache
SETUVAR XDG_CONFIG_HOME:/home/joe/\x2econfig
SETUVAR XDG_DATA_HOME:/home/joe/\x2elocal/share
SETUVAR __fish_initialized:3800
SETUVAR __fish_initialized:3400
SETUVAR _fisher_ankitsumitg_2F_docker_2D_fish_2D_completions_files:/home/joe/\x2econfig/fish/completions/docker\x2efish
SETUVAR _fisher_plugins:ankitsumitg/docker\x2dfish\x2dcompletions
SETUVAR fish_color_autosuggestion:969896
@@ -36,7 +36,7 @@ SETUVAR fish_color_operator:00a6b2
SETUVAR fish_color_param:81a2be
SETUVAR fish_color_quote:b5bd68
SETUVAR fish_color_redirection:8abeb7
SETUVAR fish_color_search_match:white\x1e\x2d\x2dbackground\x3dbrblack
SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack
SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack
SETUVAR fish_color_status:red
SETUVAR fish_color_user:brgreen
+3 -37
View File
@@ -84,34 +84,6 @@ def new_client(client):
y = client.group.screen.height - client.height - padding - 22
client.set_position_floating(x,y)
def move_to_corner(corner: str) -> Callable:
def _inner(qtile) -> None:
win = qtile.current_window
if win is None:
return
if not win.floating:
win.toggle_floating()
screen = qtile.current_screen
padding = 0
bar_height = 24
w = win.width
h = win.height
sw = screen.width
sh = screen.height
positions = {
"top-left": (padding, bar_height + padding),
"top-right": (sw - w - padding, bar_height + padding),
"bottom-left": (padding, sh - h - padding),
"bottom-right": (sw - w - padding, sh - h - padding),
}
x, y = positions[corner]
win.set_position_floating(x, y)
return _inner
keys = [
# A list of available commands that can be bound to keys can be found
# at https://docs.qtile.org/en/latest/manual/config/lazy.html
@@ -119,8 +91,8 @@ keys = [
# .when(wm_class != 'kitty')
# Key([mod], "h", lazy.function(move_focus, direction='left'), desc="Move focus to left"),
Key([mod], "h", lazy.layout.left().when(focused=Match(wm_class=re.compile('(?![Ee]macs)'))), desc="Move focus to left"),
# Key([mod], "j", lazy.layout.down().when(focused=Match(wm_class=re.compile('(?![Ee]macs)'))), desc="Move focus to left"),
# Key([mod], "k", lazy.layout.up().when(focused=Match(wm_class=re.compile('(?![Ee]macs)'))), desc="Move focus to left"),
Key([mod], "j", lazy.layout.down().when(focused=Match(wm_class=re.compile('(?![Ee]macs)'))), desc="Move focus to left"),
Key([mod], "k", lazy.layout.up().when(focused=Match(wm_class=re.compile('(?![Ee]macs)'))), desc="Move focus to left"),
Key([mod], "l", lazy.layout.right().when(focused=Match(wm_class=re.compile('(?![Ee]macs)'))), desc="Move focus to left"),
# Key([alt], "tab", lazy.layout.next(), desc="Move window focus to other window"),
@@ -189,25 +161,19 @@ keys = [
),
Key([mod], "t", lazy.window.toggle_floating(), desc="Toggle floating on the focused window"),
Key([mod, "control"], "r", lazy.reload_config(), desc="Reload the config"),
Key([mod, "shift"], "r", lazy.spawn("reload_wm.sh"), desc="Kill Unity"),
Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"),
Key([mod, alt], "space", lazy.function(toggle_language), desc="Toggle Language Layout"),
Key([mod], "r", lazy.spawncmd(), desc="Spawn a command using a prompt widget"),
Key([], "XF86AudioLowerVolume", lazy.spawn("amixer sset Master 5%-")),
Key([], "XF86AudioRaiseVolume", lazy.spawn("amixer sset Master 5%+")),
Key([], "XF86Launch1", lazy.spawn("playerctl play-pause")),
Key([], "XF86AudioMicMute", lazy.spawn("playerctl play-pause")),
Key([], "XF86AudioPlay", lazy.spawn("playerctl play-pause")),
Key([], "XF86MonBrightnessDown", lazy.spawn("brightnessctl set 5%-")),
Key([], "XF86MonBrightnessUp", lazy.spawn("brightnessctl set +5%")),
# This uses discrete values
Key([], "XF86KbdBrightnessDown", lazy.function(kbd_brightness_down)),
Key([], "XF86KbdBrightnessUp", lazy.function(kbd_brightness_up)),
Key([mod, alt, "control", "shift"], "q", lazy.function(move_to_corner("top-left")), desc="Move float to top-left"),
Key([mod, alt, "control", "shift"], "w", lazy.function(move_to_corner("top-right")), desc="Move float to top-right"),
Key([mod, alt, "control", "shift"], "a", lazy.function(move_to_corner("bottom-left")), desc="Move float to bottom-left"),
Key([mod, alt, "control", "shift"], "s", lazy.function(move_to_corner("bottom-right")), desc="Move float to bottom-right"),
Key([mod, "control", "shift", alt], "1", lazy.window.set_position_floating(5, 28), desc="Put the window in the corner"),
]
pape_dir = '/home/joe/Pictures/Wallpapers/'
-5
View File
@@ -1,11 +1,6 @@
#!/bin/bash
BATTERY_LEVEL=$(upower -i $(upower -e | grep 'BAT') | grep -E "percentage" | awk '{print $2}' | sed 's/%//')
AC_POWER=$(cat /sys/class/power_supply/AC0/online)
if [ $AC_POWER -eq 1 ]; then
exit
fi
if [ $BATTERY_LEVEL -le 5 ]; then
notify-send "Low Battery" "Battery level is ${BATTERY_LEVEL}%" -u critical
exit