This repository has been archived on 2024-03-23. You can view files and clone it, but cannot push or open issues or pull requests.
dianciemacs/lisp/editor.el

113 lines
3 KiB
EmacsLisp
Raw Normal View History

;;; lisp/editor.el --- Default configration for Dianciemacs' editor -*- lexical-binding: t; -*-
;;; Commentary:
;;
;; Emacs' default editing experience sucks a lot. There's too much most people
;; will never need and I personally believe modal keybinds to be superior.
;; So, there's a lot changes Dianciemacs will be making to the editor, all of which can be seen in this file.
;;
;;; Code:
2022-11-08 17:53:06 +00:00
2022-11-08 17:53:07 +00:00
;; Quit input dialogues after pressing escape once
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
2022-11-13 18:41:10 +00:00
; Line Wrapping
(global-visual-line-mode 1) ; Prevent wrapping of words
2023-06-26 18:12:37 +01:00
;; yasnippet - A template system for Emacs
2023-06-27 17:23:00 +01:00
;; (use-package yasnippet
;; :config
;; (yas-reload-all)
;; (yas-global-mode))
2023-06-26 18:12:37 +01:00
;; yasnippet-snippets - A snippet collection package by AndreaCotti
2023-06-27 17:23:00 +01:00
;; (use-package yasnippet-snippets
;; :after yasnippet)
2023-06-26 18:12:37 +01:00
;; evil - A Vi Layer inside of Emacs
(use-package evil
:custom
(evil-want-keybinding nil) ; Make room for evil-collection
(evil-want-integration t) ; Same as above
(evil-undo-system 'undo-fu) ; Set the undo/redo system
2022-11-13 16:46:40 +00:00
(evil-respect-visual-line-mode t) ; Make evil respect line wrapping
:config
(evil-mode 1))
2022-11-19 12:18:42 +00:00
;; evil-commentary - Comment stuff out
(use-package evil-commentary
2022-11-20 08:03:40 +00:00
:after evil
2022-11-20 09:45:00 +00:00
:config
2022-11-19 12:18:42 +00:00
(evil-commentary-mode))
2022-11-20 08:03:40 +00:00
;; evil-surround - You will be surrounded
(use-package evil-surround
:after evil
2022-11-20 09:45:00 +00:00
:config
2022-11-20 08:03:40 +00:00
(global-evil-surround-mode))
;; evil-snipe - 2-char searching for evil-mode
(use-package evil-snipe
:after evil
2022-11-20 09:45:00 +00:00
:config
(evil-snipe-mode 1)
2022-11-20 08:03:40 +00:00
(evil-snipe-override-mode 1))
;; evil-collection - A collection of keybinds for evil
(use-package evil-collection
2022-11-20 08:03:40 +00:00
:after evil
:custom (evil-collection-setup-minibuffer t)
:init (evil-collection-init))
;; evil-escape - Escape from insert mode using jk
(use-package evil-escape
2022-11-20 08:03:40 +00:00
:after evil
:config
(setq-default evil-escape-key-sequence "jk")
:init
(evil-escape-mode 1))
;; undo-fu, used by evil for undo/redo functionality
2022-11-20 08:03:40 +00:00
(use-package undo-fu
:after evil)
2022-11-08 17:53:07 +00:00
2022-11-08 17:53:07 +00:00
;; Disable the creation of files ending with '~' (backup files)
(setq make-backup-files nil)
;; Move files with '#' to system tmp directory
(setq create-lockfiles nil)
(setq backup-directory-alist
`((".*" . ,temporary-file-directory)))
(setq auto-save-file-name-transforms
`((".*" ,temporary-file-directory t)))
2023-06-27 17:31:58 +01:00
;; Set theme to `hazakura', Dianicemacs' default
(use-package autothemer)
2023-06-27 17:31:58 +01:00
(use-package hazakura-theme
:straight (:package "hazakura" :host github
:repo "devraza/hazakura-emacs"))
(load-theme 'hazakura t)
2022-11-08 17:53:06 +00:00
;; rainbow-mode - Colourful colour codes!
(use-package rainbow-mode
:hook
(prog-mode . rainbow-mode))
;; general - More convenient key definitions for Emacs
(use-package general
2022-11-20 08:03:40 +00:00
:after evil
:config
(general-evil-setup t)
:init
(general-create-definer diancite/leaders
2022-11-14 21:24:46 +00:00
:prefix leader-key))
2022-11-20 08:03:40 +00:00
(with-eval-after-load 'general
(diancite/leaders
:keymaps 'normal
"f" '(:wk "File")
"n" '(:wk "Org")
"m" '(:wk "Magit")
"w" '(:wk "Evil")
"p" '(:wk "Projects")))
;;; editor.el ends here