Update
This commit is contained in:
1
init.el
1
init.el
@@ -24,6 +24,7 @@
|
||||
|
||||
(require 'init-llm)
|
||||
|
||||
(require 'init-snippet)
|
||||
(require 'init-coding)
|
||||
(require 'init-check)
|
||||
(require 'init-eglot)
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
(global-set-key (kbd "M-p") #'duplicate-dwim)
|
||||
(global-set-key (kbd "C-c y") #'copy-from-above-command)
|
||||
(global-set-key (kbd "s-k") #'kill-current-buffer)
|
||||
(global-set-key (kbd "C-c q r") #'restart-emacs)
|
||||
|
||||
(global-set-key (kbd "C-c C-c") #'compile)
|
||||
|
||||
|
||||
@@ -44,31 +44,6 @@
|
||||
hungry-delete-except-modes
|
||||
'(help-mode minibuffer-mode minibuffer-inactive-mode calc-mode)))
|
||||
|
||||
;; Yasnippet settings
|
||||
(use-package yasnippet
|
||||
:diminish
|
||||
:ensure t
|
||||
:hook (elpaca-after-init . yas-global-mode)
|
||||
:hook ((LaTeX-mode . yas-minor-mode)
|
||||
(post-self-insert . my/yas-try-expanding-auto-snippets))
|
||||
:config
|
||||
(use-package warnings
|
||||
:ensure nil
|
||||
:config
|
||||
(cl-pushnew '(yasnippet backquote-change)
|
||||
warning-suppress-types
|
||||
:test 'equal))
|
||||
|
||||
(setq yas-triggers-in-field t)
|
||||
(setq yas-key-syntaxes '("w" "w_" "w_." "^ " yas-try-key-from-whitespace))
|
||||
|
||||
;; Function that tries to autoexpand YaSnippets
|
||||
;; The double quoting is NOT a typo!
|
||||
(defun my/yas-try-expanding-auto-snippets ()
|
||||
(when (and (boundp 'yas-minor-mode) yas-minor-mode)
|
||||
(let ((yas-buffer-local-condition ''(require-snippet-condition . auto)))
|
||||
(yas-expand)))))
|
||||
|
||||
(use-package abbrev
|
||||
:diminish
|
||||
:ensure nil
|
||||
|
||||
28
lisp/init-snippet.el
Normal file
28
lisp/init-snippet.el
Normal file
@@ -0,0 +1,28 @@
|
||||
;; -*- lexical-binding: t; -*-
|
||||
|
||||
;; Yasnippet settings
|
||||
(use-package yasnippet
|
||||
:diminish
|
||||
:ensure t
|
||||
:hook (elpaca-after-init . yas-global-mode)
|
||||
:hook ((LaTeX-mode . yas-minor-mode)
|
||||
(post-self-insert . my/yas-try-expanding-auto-snippets))
|
||||
:config
|
||||
(use-package warnings
|
||||
:ensure nil
|
||||
:config
|
||||
(cl-pushnew '(yasnippet backquote-change)
|
||||
warning-suppress-types
|
||||
:test 'equal))
|
||||
|
||||
(setq yas-triggers-in-field t)
|
||||
(setq yas-key-syntaxes (list #'yas-longest-key-from-whitespace "w_.()" "w_." "w_" "w"))
|
||||
|
||||
;; Function that tries to autoexpand YaSnippets
|
||||
;; The double quoting is NOT a typo!
|
||||
(defun my/yas-try-expanding-auto-snippets ()
|
||||
(when (and (boundp 'yas-minor-mode) yas-minor-mode)
|
||||
(let ((yas-buffer-local-condition ''(require-snippet-condition . auto)))
|
||||
(yas-expand)))))
|
||||
|
||||
(provide 'init-snippet)
|
||||
@@ -1,5 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: get-buffer
|
||||
# key: gb
|
||||
# --
|
||||
(get-buffer "${1:`(read-buffer "Buffer:")`}")$0
|
||||
@@ -1,5 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: get-buffer-create
|
||||
# key: gbc
|
||||
# --
|
||||
(get-buffer-create $0)
|
||||
@@ -1,5 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: message
|
||||
# key: msg
|
||||
# --
|
||||
(message ${1:(format "$2")})$0
|
||||
@@ -1,5 +0,0 @@
|
||||
# key: mk
|
||||
# name: paren-insert
|
||||
# condition: 'auto
|
||||
# --
|
||||
($0)
|
||||
@@ -1,5 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: point-max
|
||||
# key: pM
|
||||
# --
|
||||
(point-max)
|
||||
@@ -1,5 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: pp
|
||||
# key: pp
|
||||
# --
|
||||
(pp $3 $1)$0
|
||||
@@ -1,6 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: provide
|
||||
# key: provide
|
||||
# --
|
||||
|
||||
(provide '${1:`(file-name-base (or (buffer-file-name) ""))`})$0
|
||||
@@ -1,4 +0,0 @@
|
||||
#name : Eshell for loop
|
||||
#key : for
|
||||
# --
|
||||
for f in ${1:*} { ${2:echo} "$f"; $3} $0
|
||||
@@ -1 +0,0 @@
|
||||
emacs-lisp-mode
|
||||
@@ -1 +0,0 @@
|
||||
emacs-lisp-mode
|
||||
@@ -1,11 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Karthik Chikmagalur
|
||||
# name: switch
|
||||
# key: switch
|
||||
# --
|
||||
switch ${1:variable}
|
||||
case ${2:value}
|
||||
$3
|
||||
otherwise
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user