fixing local leader using a function

This commit is contained in:
Matt Nish-Lapidus 2025-03-19 13:05:47 -04:00
parent cb3b0c1921
commit c25d932193
3 changed files with 19 additions and 45 deletions

View file

@ -1,9 +1,5 @@
;;; bindings.el -*- lexical-binding: t; -*-
;; left option is meta, right option is option
(setq ns-alternate-modifier 'meta)
(setq ns-right-alternate-modifier 'none)
(map! :leader
"`" nil
;; (:prefix ("m" . "<localleader>")) ; bound locally
@ -366,8 +362,8 @@
"C-<return>" #'split-window-vertically
"C-S-<return>" #'split-window-horizontally
"C-<backspace>" #'sp-backward-delete-word
"C-<delete>" #'sp-delete-word
"C-M-<SPC>" #'my/call-localleader)
"C-<delete>" #'sp-delete-word)
;; "C-M-<SPC>" #'my/call-localleader)
(map! (:when (modulep! :ui popup)
"C-`" #'+popup/toggle
@ -387,6 +383,20 @@
"C-9" #'+workspace/switch-to-8
"C-0" #'+workspace/switch-to-final))
(setq doom-leader-alt-key "C-<SPC>")
(setq doom-localleader-alt-key "C-M-<SPC>")
;; Also use SPC m for localleader
(defun my/call-localleader ()
(interactive)
(setq unread-command-events (listify-key-sequence (kbd "C-M-SPC"))))
(map! :leader (:desc "localleader" "m" #'my/call-localleader))
;; left option is meta, right option is option
(setq ns-alternate-modifier 'meta)
(setq ns-right-alternate-modifier 'none)
;; mu4e bindings
(map! :map (list mu4e-main-mode-map mu4e-compose-mode-map mu4e-headers-mode-map mu4e-view-mode-map)
:localleader

View file

@ -46,7 +46,6 @@
(setq org-directory "~/Documents/Obsidian/Primary")
(use-package! kbd-mode :defer t)
(use-package! kdl-mode)
(use-package! direnv
:config
@ -66,9 +65,6 @@
(call-interactively #'consult-yasnippet))
(t (call-interactively #'yas-insert-snippet))))
;; set default frame size on launch
;; (setq default-frame-alist '( (left . 0) (top . 0) (height . 48) (width . 160)))
;; some global settings
(setq shell-file-name (executable-find "bash"))
(setq dired-vc-rename-file t) ; renaming and changing files in dired now integrates with magit
@ -92,14 +88,6 @@
kill-buffer-delete-auto-save-files t
scroll-conservatively 0)
;; nicer resizing
(cond
((string-equal system-type "darwin")
(setq frame-resize-pixelwise t
window-resize-pixelwise t)))
;; tabs! i like them
;; (setq-default indent-tabs-mode t)
(setq-default tab-width 2)
(after! treemacs
@ -160,22 +148,18 @@
(setq markdown-list-indent-width 2)
(setq markdown-enable-wiki-links t))
;; fix centaur tabs to show at the right times and add my muscle memory keybind
;; fix centaur tabs to show at the right times
(after! centaur-tabs
(setq centaur-tabs-set-bar 'right)
(setq centaur-tabs-cycle-scope 'tabs))
;; use kitty for terminal-here
;; (setq terminal-here-mac-terminal-command '("kitty" "@" "launch" "--type=tab"))
;; set project paths and ignore buffers
(setq projectile-project-search-path '(("~/Projects" . 4) ("~/source" . 2)))
(setq projectile-globally-ignored-buffers
'("*scratch*"
"*lsp-log*"))
;; ignoring buffers by their major mode
;; projectile ignoring buffers by their major mode
(setq projectile-globally-ignored-modes
'("erc-mode"
"help-mode"
@ -219,12 +203,6 @@
(after! nix-mode
(set-formatter! 'alejandra '("alejandra" "--quiet") :modes '(nix-mode)))
;; adding supercollider path
;;(setq exec-path (append exec-path '("/Applications/SuperCollider.app/Contents/MacOS/")))
;; tidal cycles!
;; (setq tidal-boot-script-path "~/.cabal/share/aarch64-osx-ghc-9.4.2/tidal-1.9.3/BootTidal.hs")
;; add platformio to ino files
(add-to-list 'auto-mode-alist '("\\.ino\\'" . arduino-mode))
(add-to-list 'auto-mode-alist '("\\.ino\\'" . platformio-mode))
@ -260,19 +238,15 @@
(load! "obsidian-config.el")
(load! "mu4e-config.el")
;; import all my customized keybindings based on doom vil mode, but with meow instead.
;; import all my customized keybindings based on doom evil mode, but with meow instead.
(load! "bindings.el")
(load! "meow.el")
;;(unless server-running-p (server-start))
(delete-selection-mode t) ; delete stuff!
(setq delete-active-region t) ; delete selected stuff!
(+global-word-wrap-mode +1) ; default to soft word wrap
(use-package! colorful-mode
;; :diminish
;; :ensure t ; Optional
:custom
(colorful-use-prefix t)
(colorful-only-strings 'only-prog)

10
meow.el
View file

@ -1,15 +1,5 @@
;;; meow.el -*- lexical-binding: t; -*-
(setq doom-leader-alt-key "C-<SPC>")
(setq doom-localleader-alt-key "C-M-<SPC>")
;; Also use SPC m for localleader
(defun my/call-localleader ()
(interactive)
(setq unread-command-events (listify-key-sequence (kbd "C-M-SPC"))))
(map! :leader (:desc "localleader" "m" #'my/call-localleader))
(defun meow--eval-sexp ()
(interactive)
(cond ((derived-mode-p 'lisp-mode) (sly-eval-defun))