commit e545250d7de849799e26dbc3994ef2bf05f0a7bd
Author: Simon Watson <spw01@protonmail.com>
Date: Wed Jul 14 16:14:55 2021 -0400
Added yasnippets for all configs and a few example snippets
diff --git a/emacs/.emacs-all b/emacs/.emacs-all
index bc172f5..fa0a1b0 100644
--- a/emacs/.emacs-all
+++ b/emacs/.emacs-all
@@ -39,6 +39,9 @@
(straight-use-package 'focus)
(straight-use-package 'solarized-theme)
(straight-use-package 'windresize)
+(straight-use-package 'yasnippet)
+
+(require 'yasnippet)
;; Configure focus
(require 'focus)
@@ -160,6 +163,11 @@
;;; Slime/etc
(if (eq system-type 'darwin)
(progn
+ ;; Configure yasnippet
+ (setq yas-snippet-dirs
+ '("~/Repos/dotfiles/emacs/yasnippets/"))
+ (yas-global-mode 1)
+
(setq inferior-lisp-program "/opt/homebrew/bin/sbcl")
(load (expand-file-name "~/.local/opt/quicklisp/slime-helper.el"))
(load "/Users/swatson/.emacs.d/.erc-auth.el")
@@ -182,6 +190,11 @@
;; Load for Windows10
(if (eq system-type 'windows-nt)
(progn
+ ;; Configure yasnippet
+ (setq yas-snippet-dirs
+ '("C:/Users/watsonsi/Documents/Github/dotfiles/emacs/yasnippets/"))
+ (yas-global-mode 1)
+
(load "C:/Users/watsonsi/Documents/GitHub/dotfiles/emacs/windows-load/customs.el")
(setq visible-bell 1)
(load-theme 'solarized-light t)))
@@ -190,6 +203,14 @@
(if (eq system-type 'gnu/linux)
(if (display-graphic-p)
(progn
+ (setq yas-snippet-dirs
+ '("~/Repos/dotfiles/emacs/yasnippets/"))
+ (yas-global-mode 1)
+
+ ;; Set to make mouse focus window
+ (setq mouse-autoselect-window t
+ focus-follows-mouse t)
+
(straight-use-package 'exwm)
(require 'exwm)
diff --git a/emacs/yasnippets/eshell-mode/for b/emacs/yasnippets/eshell-mode/for
new file mode 100644
index 0000000..bfa3b35
--- /dev/null
+++ b/emacs/yasnippets/eshell-mode/for
@@ -0,0 +1,4 @@
+#name : Eshell for loop
+#key : for
+# --
+for f in ${1:*} { ${2:echo} "$f"; $3} $0
\ No newline at end of file
diff --git a/emacs/yasnippets/eshell-mode/ll b/emacs/yasnippets/eshell-mode/ll
new file mode 100644
index 0000000..fef9b62
--- /dev/null
+++ b/emacs/yasnippets/eshell-mode/ll
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: exa list
+# key: /ll
+# --
+exa -lah
diff --git a/emacs/yasnippets/lisp-mode/defun b/emacs/yasnippets/lisp-mode/defun
new file mode 100644
index 0000000..0d6c39a
--- /dev/null
+++ b/emacs/yasnippets/lisp-mode/defun
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: defun elisp
+# key: /df
+# --
+(defun ${1:fun-name} ()
\ No newline at end of file