Compare commits
9 Commits
0cdb39c77b
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 48feb223f1 | |||
| 9dfd55ada4 | |||
| 2b0ca519c6 | |||
| 2973596913 | |||
| 7344512c3a | |||
| c534cc12bb | |||
| 7209b28ab8 | |||
| 61f1b88d27 | |||
| 6b3b3200ba |
1
emacs/.gitignore
vendored
1
emacs/.gitignore
vendored
@@ -2,6 +2,7 @@
|
||||
!.gitignore
|
||||
!*.org
|
||||
!*.el
|
||||
!reset.sh
|
||||
!.gitkeep
|
||||
!snippets/
|
||||
!snippets/**
|
||||
|
||||
@@ -63,6 +63,9 @@
|
||||
(use-package seq :ensure `(seq :build ,(+elpaca-seq-build-steps)))
|
||||
(use-package transient :ensure t)
|
||||
|
||||
;; Required for magit, but Elpaca seems unable to find it by default
|
||||
(use-package cond-let :ensure (:host github :repo "tarsius/cond-let"))
|
||||
|
||||
;;; OS-specific tweaks
|
||||
(defconst ON-LINUX (eq system-type 'gnu/linux))
|
||||
(defconst ON-MAC (eq system-type 'darwin))
|
||||
@@ -138,8 +141,31 @@
|
||||
(setq ns-command-modifier 'meta)
|
||||
(setq ns-right-command-modifier 'super)
|
||||
|
||||
;; Training wheels for Cmd-S
|
||||
(global-set-key (kbd "M-s M-s") 'save-buffer)
|
||||
;;;;; Training wheels
|
||||
(defun cmd-key-reminder (keybind emacs-alternative)
|
||||
"Display a beep and reminder message for macOS muscle memory keys.
|
||||
KEYBIND is the key combination pressed (e.g., 'Cmd-S').
|
||||
EMACS-ALTERNATIVE is the Emacs equivalent (e.g., 'C-s')."
|
||||
(beep)
|
||||
(message "Muscle memory! Use %s instead of %s" emacs-alternative keybind))
|
||||
|
||||
;; Define reminders for common macOS shortcuts
|
||||
(global-set-key (kbd "s-s") (lambda () (interactive)
|
||||
(cmd-key-reminder "Cmd-S" "C-x C-s (save-buffer)")))
|
||||
(global-set-key (kbd "s-z") (lambda () (interactive)
|
||||
(cmd-key-reminder "Cmd-Z" "C-/ (undo)")))
|
||||
(global-set-key (kbd "s-x") (lambda () (interactive)
|
||||
(cmd-key-reminder "Cmd-X" "C-w (kill-region)")))
|
||||
(global-set-key (kbd "s-c") (lambda () (interactive)
|
||||
(cmd-key-reminder "Cmd-C" "M-w (copy-region-as-kill)")))
|
||||
(global-set-key (kbd "s-v") (lambda () (interactive)
|
||||
(cmd-key-reminder "Cmd-V" "C-y (yank)")))
|
||||
(global-set-key (kbd "s-a") (lambda () (interactive)
|
||||
(cmd-key-reminder "Cmd-A" "C-x h (mark-whole-buffer)")))
|
||||
(global-set-key (kbd "s-0") (lambda () (interactive)
|
||||
(cmd-key-reminder "Cmd-0" "C-x 0 (text-scale-adjust)")))
|
||||
(global-set-key (kbd "s-t") (lambda () (interactive)
|
||||
(cmd-key-reminder "Cmd-T" "C-o t (tab-bar-new-tab)")))
|
||||
|
||||
;;; Editing
|
||||
;;;; MWIM
|
||||
@@ -449,7 +475,7 @@
|
||||
(modify-all-frames-parameters '((alpha 99 99)
|
||||
(top . 50)
|
||||
(left . 100)
|
||||
(width . 120)
|
||||
(width . 190)
|
||||
(height . 60)))
|
||||
|
||||
;;;; Fonts
|
||||
@@ -730,8 +756,11 @@
|
||||
(interactive)
|
||||
(org-agenda nil "d"))
|
||||
|
||||
(add-hook 'org-after-todo-state-change-hook #'save-buffer))
|
||||
(add-hook 'org-after-todo-state-change-hook #'org-save-all-org-buffers))
|
||||
|
||||
(use-package org-agenda
|
||||
:bind (:map org-agenda-mode-map
|
||||
("C-x C-s" . org-save-all-org-buffers)))
|
||||
|
||||
(use-package org-bullets
|
||||
:ensure t
|
||||
@@ -1096,7 +1125,7 @@ any directory proffered by `consult-dir'."
|
||||
`(rxt-elisp-to-pcre (rx ,@rx-sexp))))
|
||||
|
||||
(use-package eshell-p10k
|
||||
:ensure (:host github :repo "elken/eshell-p10k")
|
||||
:ensure (:host github :repo "elken/eshell-p10k" :ref "fce701187de408e7b23884169ea597a49a2d3205")
|
||||
:config
|
||||
(eshell-p10k-def-segment time
|
||||
""
|
||||
|
||||
12
emacs/reset.sh
Executable file
12
emacs/reset.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# See https://stackoverflow.com/a/246128/3561275
|
||||
SOURCE="${BASH_SOURCE[0]}"
|
||||
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
|
||||
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
|
||||
SOURCE="$(readlink "$SOURCE")"
|
||||
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
|
||||
done
|
||||
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
|
||||
|
||||
pushd $DIR &>/dev/null && rm -rf eln-cache elpa elpaca elpaca.lock && popd &> /dev/null
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: bang
|
||||
# name: shebang
|
||||
# key: !
|
||||
# --
|
||||
#!/usr/bin/env bash
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: the currently executing/sourced script's directory
|
||||
# key: script-dir
|
||||
# name: current script's directory
|
||||
# key: sdir
|
||||
# --
|
||||
# See https://stackoverflow.com/a/246128/3561275
|
||||
SOURCE="\${BASH_SOURCE[0]}"
|
||||
|
||||
1
emacs/snippets/sh-ts-mode/.yas-parents
Normal file
1
emacs/snippets/sh-ts-mode/.yas-parents
Normal file
@@ -0,0 +1 @@
|
||||
sh-mode
|
||||
Reference in New Issue
Block a user