summaryrefslogtreecommitdiff
path: root/config/editor.el
diff options
context:
space:
mode:
authorSam Light <samlight1994@gmail.com>2025-05-17 20:17:44 +0100
committerSam Light <samlight1994@gmail.com>2025-05-17 20:17:44 +0100
commit0b48b7d84872ea328ff942d2a2f786efc3319e82 (patch)
tree1d83b715d124d0a812df6669ac8e8ee4a27a5d26 /config/editor.el
Inital commit
Diffstat (limited to 'config/editor.el')
-rw-r--r--config/editor.el85
1 files changed, 85 insertions, 0 deletions
diff --git a/config/editor.el b/config/editor.el
new file mode 100644
index 0000000..0542f12
--- /dev/null
+++ b/config/editor.el
@@ -0,0 +1,85 @@
+;; -*- lexical-binding: t; -*-
+
+(setq-default indent-tabs-mode nil) ;; don't use tabs to indent
+(setq-default tab-width 4) ;; but maintain correct appearance
+
+;; Newline at end of file
+(setq require-final-newline t)
+
+;; delete the selection with a keypress
+(delete-selection-mode t)
+
+(global-auto-revert-mode t)
+
+(global-hl-line-mode 1)
+
+;; meaningful names for buffers with the same name
+(use-package uniquify
+ :config
+ (setq uniquify-buffer-name-style 'forward)
+ (setq uniquify-separator "/")
+ (setq uniquify-after-kill-buffer-p t) ; rename after killing uniquified
+ (setq uniquify-ignore-buffers-re "^\\*")) ; don't muck with special buffers
+
+;; saveplace remembers your location in a file when saving files
+(setq save-place-file (expand-file-name "saveplace" savefile-dir))
+
+;; activate it for all buffers
+(save-place-mode 1)
+
+;; savehist keeps track of some history
+(use-package savehist
+ :config
+ (setq savehist-additional-variables
+ ;; search entries
+ '(search-ring regexp-search-ring)
+ ;; save every minute
+ savehist-autosave-interval 60
+ ;; keep the home clean
+ savehist-file (expand-file-name "savehist" savefile-dir))
+ (savehist-mode +1))
+
+
+;; smart tab behavior - indent or complete
+(setq tab-always-indent 'complete)
+
+(use-package diminish :ensure t)
+
+(use-package smartparens
+ :ensure t
+ :config
+ (require 'smartparens-config)
+ (smartparens-global-mode t)
+ (show-smartparens-global-mode t)
+ (setq sp-base-key-bindings 'paredit)
+ (setq sp-autoskip-closing-pair 'always)
+ (setq sp-hybrid-kill-entire-symbol nil)
+ (setq blink-matching-paren nil))
+
+(use-package easy-kill
+ :ensure t
+ :config
+ (global-set-key [remap kill-ring-save] 'easy-kill)
+ (global-set-key [remap mark-sexp] 'easy-mark))
+
+(use-package whitespace-cleanup-mode
+ :ensure t
+ :config
+ (global-whitespace-cleanup-mode t))
+
+(use-package whitespace
+ :config
+ (setq whitespace-line-column 80) ;; limit line length
+ (setq whitespace-style '(face tabs empty trailing lines-tail))
+ (global-whitespace-mode t))
+
+(use-package super-save
+ :ensure t
+ :config
+ (super-save-mode +1))
+
+(use-package volatile-highlights
+ :ensure t
+ :diminish t
+ :config
+ (volatile-highlights-mode t))