1
0
Fork 0

Finally making a usable Emacs config 🤩

This commit is contained in:
Jarkko Toivanen 2023-10-19 05:12:33 +03:00
parent 07b6c83356
commit 01207f238f
Signed by: jt
GPG key ID: 9151B109B73ECAD5

71
.emacs
View file

@ -1,18 +1,85 @@
(setq inhibit-startup-message t) ;; Hide the startup message ;; Thank you Bozhidar Batsov for inspiration!
;; Inspirational config found from https://github.com/bbatsov/emacs.d/
;; Also check out Emacs Prelude at https://github.com/bbatsov/prelude/
(setq inhibit-startup-message t)
(global-linum-mode t) (global-linum-mode t)
(global-whitespace-mode t) (global-whitespace-mode t)
(delete-selection-mode t)
(global-tab-line-mode t)
(when (fboundp 'tool-bar-mode)
(tool-bar-mode -1))
(setq backward-delete-char-untabify-method nil) (setq backward-delete-char-untabify-method nil)
(setq c-default-style '((java-mode . "java") (awk-mode . "awk") (other . "linux"))) (setq c-default-style '((java-mode . "java") (awk-mode . "awk") (other . "linux")))
(defalias 'yes-or-no-p 'y-or-n-p) (defalias 'yes-or-no-p 'y-or-n-p)
;; mode line settings
(line-number-mode t)
(column-number-mode t)
(size-indication-mode t)
;; nice scrolling
(setq scroll-margin 0
scroll-conservatively 100000
scroll-preserve-screen-position 1)
;; store all backup and autosave files in the tmp dir
(setq backup-directory-alist
`((".*" . ,temporary-file-directory)))
(setq auto-save-file-name-transforms
`((".*" ,temporary-file-directory t)))
(require 'package)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/") t)
;; keep the installed packages in .emacs.d
(setq package-user-dir (expand-file-name "elpa" user-emacs-directory))
(package-initialize)
;; update the package metadata is the local cache is missing
(unless package-archive-contents
(package-refresh-contents))
(unless (package-installed-p 'use-package)
(package-install 'use-package))
(require 'use-package)
(setq use-package-verbose t)
(use-package hl-line
:config
(global-hl-line-mode +1))
(use-package monokai-theme
:ensure t
:config
(load-theme 'monokai t))
(use-package magit
:ensure t
:bind (("C-x g" . magit-status)))
(use-package rust-mode
:ensure t)
(use-package which-key
:ensure t
:config
(which-key-mode +1)
;(diminish 'which-key-mode)
)
(custom-set-variables (custom-set-variables
;; custom-set-variables was added by Custom. ;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful. ;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance. ;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right. ;; If there is more than one, they won't work right.
'(custom-enabled-themes '(tango-dark))) '(package-selected-packages '(which-key rust-mode magit monokai-theme use-package)))
(custom-set-faces (custom-set-faces
;; custom-set-faces was added by Custom. ;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful. ;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance. ;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right. ;; If there is more than one, they won't work right.
) )
(put 'dired-find-alternate-file 'disabled nil)