forked from FG42/FG42
1
0
Fork 0

Add tempel as the yasnippet replacement

This commit is contained in:
Sameer Rahmani 2024-05-01 14:17:51 +01:00
parent cd6cecdbbb
commit 7cd44271c1
Signed by: lxsameer
GPG Key ID: 8741FACBF412FFA5
2 changed files with 46 additions and 12 deletions

View File

@ -46,6 +46,8 @@ let
org-ql
org-modern
base16-theme
tempel
tempel-collection
]);
drv = makeFG42Drv {

View File

@ -26,17 +26,6 @@
;; We build this file via the main FG42's Nix derivation. It
;; contains the final Nix configuration of FG42.
(require 'fg42/config)
;; ;; Language support
;; (require 'fg42/autocomplete)
;; (require 'fg42/langs/langs)
;; (require 'fg42/eglot)
;; (require 'fg42/langs/cpp)
;; (require 'fg42/langs/verilog)
;; (require 'fg42/langs/python)
;; (require 'fg42/langs/elisp)
;; (require 'fg42/langs/nix)
;; (require 'fg42/wm)
(require 'fg42/organize))
(require 'server)
@ -53,7 +42,6 @@
(set-face-attribute 'default t :font name)))
(use! origami
"A text folding minor mode for Emacs."
:bind
@ -61,6 +49,7 @@
:config
(global-origami-mode t))
(use! which-key
"which-key is a minor mode for Emacs that displays the key bindings following
your currently entered incomplete command (a prefix) in a popup. For example,
@ -72,6 +61,7 @@ This includes prefixes like ~C-x 8~ which are shown in a different face."
(which-key-setup-side-window-bottom)
(which-key-mode))
(use! projectile
"Projectile is a project interaction library for Emacs. Its goal is to provide
a nice set of features operating on a project level without introducing
@ -112,44 +102,53 @@ contextual information."
("C-h x" . helpful-command)
("C-c C-d" . helpful-at-point)))
(use! envrc
"Activate direnv whenever encounter a `.envrc' file"
:config
(envrc-global-mode))
(use! pinentry
"Pinentry cube with setup the =pinentry= program to be used within FG42."
:commands pinentry-start
:init
(setq epa-pinentry-mode 'loopback))
(use! imenu-list
"his Emacs minor-mode creates an automatically updated buffer
called `Ilist' that is populated with the current buffer's imenu entries.
The `Ilist' buffer is typically shown as a sidebar (Emacs vertically splits the window)."
:bind (("C-'" . imenu-list-smart-toggle)))
(use! discover
"Adds support for the discover.el `https://github.com/mickeynp/discover.el'.")
(use! exec-path-from-shell
"This package fixes the =exec-path-from-shell= issue on MacOS."
:config
(when (memq window-system '(mac ns x))
(exec-path-from-shell-initialize)))
(use! hl-line
"Highlights the current line."
:hook (emacs-startup . global-hl-line-mode))
(use! avy
"This cube controls the different aspect of buffer navigation"
:bind ("M-1" . avy-goto-word-1))
(use! ace-window
"This cube controls the different aspect of buffer navigation"
:bind ("C-<tab>" . ace-window))
(when-not-wm
(use! flyspell
"Spell checking on the fly"
@ -165,6 +164,7 @@ contextual information."
:init
(savehist-mode))
(use! display-line-numbers
"The builtin replacement of linum. It's is pretty fast."
:config
@ -175,6 +175,7 @@ contextual information."
"Flycheck is a modern on-the-fly syntax checking extension for GNU Emacs."
:config (global-flycheck-mode))
(use! rainbow-delimiters
"It is a rainbow parentheses like mode which highlights delimiters such as
parentheses, brackets or braces according to their depth."
@ -188,6 +189,37 @@ contextual information."
(direnv-mode))
(use! tempel
"Tempel is a tiny template package for Emacs, which uses the syntax
of the Emacs Tempo library."
:bind (("M-+" . tempel-complete) ;; Alternative tempel-expand
("M-*" . tempel-insert)
("C-," . tempel-previous)
("C-." . tempel-next))
:init
;; Setup completion at point
(defun tempel-setup-capf ()
;; Add the Tempel Capf to `completion-at-point-functions'.
;; `tempel-expand' only triggers on exact matches. Alternatively use
;; `tempel-complete' if you want to see all matches, but then you
;; should also configure `tempel-trigger-prefix', such that Tempel
;; does not trigger too often when you don't expect it. NOTE: We add
;; `tempel-expand' *before* the main programming mode Capf, such
;; that it will be tried first.
(setq-local completion-at-point-functions
(cons #'tempel-expand
completion-at-point-functions)))
(add-hook 'conf-mode-hook 'tempel-setup-capf)
(add-hook 'prog-mode-hook 'tempel-setup-capf)
(add-hook 'text-mode-hook 'tempel-setup-capf))
(use! tempel-collection
"A collection of tempel templates.")
(defun fg42/setup-editor ()
"Setup the overall functionality of FG42."