From 1edef2d7b9f098cf89e684cbe6be041803ef021a Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Thu, 19 Oct 2023 21:06:27 -0400 Subject: Add emacs settings --- emacs/.config/emacs-kj/init.el | 46 +++++++----------------------- emacs/.config/emacs-kj/lisp/kj-defaults.el | 30 +++++++++++++++++++ 2 files changed, 41 insertions(+), 35 deletions(-) create mode 100644 emacs/.config/emacs-kj/lisp/kj-defaults.el (limited to 'emacs/.config') diff --git a/emacs/.config/emacs-kj/init.el b/emacs/.config/emacs-kj/init.el index 2454577..3b3055c 100644 --- a/emacs/.config/emacs-kj/init.el +++ b/emacs/.config/emacs-kj/init.el @@ -34,34 +34,12 @@ (use-package straight :custom (straight-use-package-by-default t)) -;; (let ((my-font "Iosevka-18")) -;; (set-face-attribute 'default t :font my-font) -;; (set-frame-font my-font)) -(set-language-environment "utf-8") -;; (set-default-coding-systems 'utf-8) -(setq-default indent-tabs-mode nil) -(setq sentence-end-double-space nil) -(setq save-interprogram-paste-before-kill t) -(setq enable-recursive-minibuffers t) (global-hl-line-mode 1) (global-auto-revert-mode 1) (setq visible-bell t ring-bell-function 'ignore) -;; Backup file settings. -;; Keep backups, but avoid same directory since it can be slow on tramp. -(setq backup-directory-alist `(("." . "~/.cache/emacs-backups")) - version-control t - delete-old-versions -1 - vc-make-backup-files t - create-lockfiles nil) - -(use-package modus-themes) -(use-package doom-themes) - -(load-theme 'modus-vivendi-tinted) - (custom-theme-set-faces 'modus-vivendi-tinted '(avy-lead-face ((t :inherit (bold modus-themes-subtle-blue)))) @@ -69,16 +47,10 @@ '(avy-lead-face-1 ((t :inherit (bold modus-themes-subtle-green)))) '(avy-lead-face-2 ((t :inherit (bold modus-themes-subtle-magenta))))) -;; ;; Modus theme setup. -;; (use-package emacs -;; :init -;; ;; Add all your customizations prior to loading the themes -;; (setq modus-themes-region '(accented)) -;; :config -;; ;; Load the theme of your choice: -;; (load-theme 'modus-operandi) ;; OR (load-theme 'modus-vivendi) -;; :bind ("" . modus-themes-toggle)) +(use-package modus-themes) +(use-package doom-themes) +(load-theme 'modus-vivendi-tinted) (setq alert-default-style 'libnotify) (use-package all-the-icons @@ -218,10 +190,6 @@ :init (vertico-mode)) -(use-package savehist - :init - (savehist-mode)) - ;; Rebind C-x? (global-set-key (kbd "C-t") 'ctrl-x-map) (define-key global-map (kbd "C-t") ctl-x-map) @@ -839,3 +807,11 @@ ;; Restore gc. (setq gc-cons-threshold (* 16 1024 1024)) + +;; Shell completion +(use-package native-complete + :init + (defun kj/shell-completion () + (setq completion-at-point-functions + '(native-complete-at-point t))) + :hook (shell-mode . kj/shell-completion)) diff --git a/emacs/.config/emacs-kj/lisp/kj-defaults.el b/emacs/.config/emacs-kj/lisp/kj-defaults.el new file mode 100644 index 0000000..7312661 --- /dev/null +++ b/emacs/.config/emacs-kj/lisp/kj-defaults.el @@ -0,0 +1,30 @@ +;; Backups +(make-directory "~/.cache/emacs_backups/" t) +(make-directory "~/.cache/emacs_autosave/" t) +(setq backup-directory-alist '(("." . "~/.cache/emacs_backups/"))) +(setq auto-save-file-name-transforms '((".*" "~/.cache/emacs_autosave/" t))) + +;; Keep backups, but avoid same directory since it can be slow on tramp. +(setq version-control t + delete-old-versions -1 + vc-make-backup-files t + create-lockfiles nil + backup-by-copying t) + +(provide 'kj-defaults) + +(setq-default indent-tabs-mode nil) +(setq sentence-end-double-space nil) +(setq save-interprogram-paste-before-kill t) +(setq mouse-yank-at-point t) +(setq enable-recursive-minibuffers t) +(set-language-environment "utf-8") +(setq require-final-newline t) + +(savehist-mode 1) + +;; Resize settings +(setq frame-inhibit-implied-resize t) +(setq pixel-scroll-precision-mode t) + +(setq kill-whole-line t) -- cgit v1.2.3