2022-11-16 21:10:34 +00:00
|
|
|
;;; 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
|
2022-11-08 22:05:28 +00:00
|
|
|
(global-visual-line-mode 1) ; Prevent wrapping of words
|
|
|
|
|
2022-11-12 20:44:43 +00:00
|
|
|
;; evil - A Vi Layer inside of Emacs
|
2022-11-08 17:53:07 +00:00
|
|
|
(use-package evil
|
2022-11-08 22:05:28 +00:00
|
|
|
:custom
|
2022-11-09 18:04:45 +00:00
|
|
|
(evil-want-keybinding nil) ; Make room for evil-collection
|
2022-11-08 22:05:28 +00:00
|
|
|
(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
|
2022-11-08 17:53:07 +00:00
|
|
|
: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-19 12:18:42 +00:00
|
|
|
:init
|
|
|
|
(evil-commentary-mode))
|
|
|
|
|
2022-11-20 08:03:40 +00:00
|
|
|
;; evil-surround - You will be surrounded
|
|
|
|
(use-package evil-surround
|
|
|
|
:after evil
|
|
|
|
:init
|
|
|
|
(global-evil-surround-mode))
|
|
|
|
|
|
|
|
;; evil-snipe - 2-char searching for evil-mode
|
|
|
|
(use-package evil-snipe
|
|
|
|
:after evil
|
|
|
|
:init
|
|
|
|
(evil-snipe-override-mode 1))
|
|
|
|
|
2022-11-09 18:04:45 +00:00
|
|
|
;; evil-collection - A collection of keybinds for evil
|
|
|
|
(use-package evil-collection
|
2022-11-20 08:03:40 +00:00
|
|
|
:after evil
|
2022-11-09 18:04:45 +00:00
|
|
|
: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
|
2022-11-09 18:04:45 +00:00
|
|
|
:config
|
|
|
|
(setq-default evil-escape-key-sequence "jk")
|
|
|
|
:init
|
|
|
|
(evil-escape-mode 1))
|
|
|
|
|
2022-11-08 17:53:07 +00:00
|
|
|
;; 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)
|
|
|
|
|
2022-11-12 17:38:40 +00:00
|
|
|
;; Move files with '#' to system tmp directory
|
2022-11-12 13:03:29 +00:00
|
|
|
(setq create-lockfiles nil)
|
2022-11-12 17:38:40 +00:00
|
|
|
(setq backup-directory-alist
|
|
|
|
`((".*" . ,temporary-file-directory)))
|
|
|
|
(setq auto-save-file-name-transforms
|
|
|
|
`((".*" ,temporary-file-directory t)))
|
2022-11-12 13:03:29 +00:00
|
|
|
|
2022-11-19 08:06:06 +00:00
|
|
|
;; Set theme to `graphite', Dianicemacs' default
|
|
|
|
(use-package autothemer)
|
|
|
|
(use-package graphite-theme
|
2022-11-19 12:18:42 +00:00
|
|
|
:straight (:package "graphite" :host github
|
2022-11-19 16:28:24 +00:00
|
|
|
:repo "devraza/graphite-emacs"))
|
2022-11-17 21:54:06 +00:00
|
|
|
(load-theme 'graphite t)
|
2022-11-08 17:53:06 +00:00
|
|
|
|
2022-11-12 20:44:43 +00:00
|
|
|
;; rainbow-mode - Colourful colour codes!
|
|
|
|
(use-package rainbow-mode
|
2022-11-16 21:10:34 +00:00
|
|
|
:hook
|
|
|
|
(prog-mode . rainbow-mode))
|
2022-11-12 20:44:43 +00:00
|
|
|
|
2022-11-08 22:05:28 +00:00
|
|
|
;; general - More convenient key definitions for Emacs
|
|
|
|
(use-package general
|
2022-11-20 08:03:40 +00:00
|
|
|
:after evil
|
2022-11-08 22:05:28 +00:00
|
|
|
:config
|
|
|
|
(general-evil-setup t)
|
|
|
|
:init
|
|
|
|
(general-create-definer diancite/leaders
|
2022-11-14 21:24:46 +00:00
|
|
|
:prefix leader-key))
|
2022-11-08 22:05:28 +00:00
|
|
|
|
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")))
|
|
|
|
|
2022-11-16 21:10:34 +00:00
|
|
|
;;; editor.el ends here
|