Mac-specific bindings, new startup fixes

This commit is contained in:
Ian Keane 2023-11-28 10:16:48 -05:00
parent 40704fda2e
commit ea486d0db9

View file

@ -1,5 +1,5 @@
#+title Ian's Emacs Config #+title Ian's Emacs Config
#+PROPERTY: header-args:emacs-lisp :tangle ~/.config/emacs/init.el #+PROPERTY: header-args:emacs-lisp :tangle (if eq system-type 'darwin "~/dotfiles/guix/init.el" "~/.config/emacs/init.el")
* First things first * First things first
** Literate Config Setup ** Literate Config Setup
@ -23,8 +23,6 @@ To get started, run =C-c C-v t=
("org" . "https://orgmode.org/elpa/") ("org" . "https://orgmode.org/elpa/")
("elpa" . "https://elpa.gnu.org/packages/"))) ("elpa" . "https://elpa.gnu.org/packages/")))
(package-initialize) (package-initialize)
(unless package-archive-contents
(package-refresh-contents))
;; Initialize use-package on non-linux platforms ;; Initialize use-package on non-linux platforms
(unless (package-installed-p 'use-package) (unless (package-installed-p 'use-package)
@ -33,18 +31,28 @@ To get started, run =C-c C-v t=
(require 'use-package) (require 'use-package)
(setq use-package-always-ensure t) (setq use-package-always-ensure t)
(package-refresh-contents)
;; Persist history over Emacs restarts. Vertico sorts by history position. ;; Persist history over Emacs restarts. Vertico sorts by history position.
(use-package savehist (use-package savehist
:init :init
(savehist-mode)) (savehist-mode))
#+end_src #+end_src
** Environment-specific setup
#+begin_src emacs-lisp
(setq IS-MACOS (eq system-type 'darwin))
(setq openai-key-string
(if IS-MACOS "self/openai-alt" "openai-alt"))
#+end_src
** Secrets ** Secrets
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package pinentry) (use-package pinentry
(use-package pass) :ensure t)
(use-package pass
:ensure t)
(use-package password-store) (use-package password-store)
(pinentry-start) (pinentry-start)
(setq gptel-api-key (password-store-get "openai-alt")) ;; TODO if-macos (setq gptel-api-key (password-store-get openai-key-string)) ;; TODO if-macos
#+end_src #+end_src
** Global variables ** Global variables
** Handle config file ** Handle config file
@ -738,10 +746,10 @@ Idk I think this came from the vertico readme
** Snippets ** Snippets
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package yasnippet) (use-package yasnippet)
(use-package yasnippet-snippets) (use-package yasnippet-snippets
:after lsp-mode)
(yas-global-mode) (yas-global-mode)
#+end_src #+end_src
<el
* Languages * Languages
** LSP ** LSP
#+begin_src emacs-lisp #+begin_src emacs-lisp