diff options
| author | tslil clingman <> | 2022-08-09 08:16:16 +0200 |
|---|---|---|
| committer | tslil clingman <> | 2022-08-09 08:20:27 +0200 |
| commit | af3881fdfd45caea6da478ef56082d0c107f4a85 (patch) | |
| tree | d1dfe9fb857ad7d3815ecf6aca0ccfcc7729066a /emacs/work_inits/01-basic.el | |
| parent | fb03d2883abcaac4518296280818dc3162b4d400 (diff) | |
work inits
Diffstat (limited to 'emacs/work_inits/01-basic.el')
| -rw-r--r-- | emacs/work_inits/01-basic.el | 145 |
1 files changed, 145 insertions, 0 deletions
diff --git a/emacs/work_inits/01-basic.el b/emacs/work_inits/01-basic.el new file mode 100644 index 0000000..ecfe165 --- /dev/null +++ b/emacs/work_inits/01-basic.el @@ -0,0 +1,145 @@ +;; Time-stamp: <2022-07-27 11h57 CEST (radix)> + +;; ----------------------------------------------------------------------------- +;; Interface + +(tool-bar-mode -1) +(menu-bar-mode -1) +(scroll-bar-mode -1) +(fset 'yes-or-no-p 'y-or-n-p) + +(setq select-enable-clipboard t + select-enable-primary t + save-interprogram-paste-before-kill t + require-final-newline t + visible-bell nil) + +(setq echo-keystrokes 0.1 + confirm-kill-emacs 'y-or-n-p + disabled-command-function nil + ring-bell-function 'ignore) + +(size-indication-mode t) + +(defun enlarge-to-fill () + "Stretch the buffer to accomodate `fill-column` many columns." + (interactive) + (let ((ww (window-width))) + (when (< ww (+ 1 fill-column)) + (enlarge-window-horizontally (- (+ 1 fill-column) ww))))) + +(global-set-key (kbd "C-c 3") (lambda () + (interactive) + (split-window-horizontally) + (enlarge-to-fill))) + +(add-to-list 'custom-theme-load-path "~/.emacs.d/themes/") + +(when (eq 'x (window-system)) + ;;; Time-based theming + ;; (if (<= 20 (nth 2 (decode-time))) + ;; (load-theme 'nord t) + ;; (load-theme 'solo-jazz t)) + ;; (load-theme 'solo-jazz t) + (load-theme 'acme t) + (set-face-attribute 'font-lock-comment-face nil :slant 'italic) + ;; (set-face-attribute 'region nil :background "orange") + (set-face-attribute 'default nil :font "Iosevka Slab-10") + (set-face-attribute 'variable-pitch nil :font "Frank Ruehl CLM-18")) + + +(setq-default line-spacing nil) + +(blink-cursor-mode 0) +(setq cursor-type 'box) +;; (set-cursor-color "orange") + +(set-fringe-style 0) +;; (set-fringe-mode 128) + +;; ----------------------------------------------------------------------------- +;; Backups + +(setq backup-by-copying t + backup-directory-alist '(("." . "/home/user/store/backups/")) + delete-old-versions t + kept-new-versions 6 + kept-old-versions 2 + version-control t) + +(setq create-lockfiles nil) + +;; ----------------------------------------------------------------------------- +;; Defaults + +(setq fill-column 80) + +(setq standard-indent 4) +(setq-default tab-width 4 + indent-tabs-mode nil) +(add-hook 'before-save-hook #'whitespace-cleanup) + +(show-paren-mode t) + +(setq-default truncate-lines t + truncate-partial-width-windows nil) +(setq scroll-step 1 + scroll-margin 5) + +(setq next-line-add-newlines nil) + +(setq enable-dir-local-variables nil) + +(setq shell-file-name "bash") + +;; ----------------------------------------------------------------------------- +;; Basic packages + +(use-package recentf + :demand t + :config + (setq recentf-max-saved-items 42) + (recentf-mode)) + +(use-package uniquify + :config + (setq uniquify-buffer-name-style 'forward)) + +(use-package tramp + :config + (setq tramp-use-ssh-controlmaster-options nil)) + +(require 'saveplace) +(save-place-mode) + +;; (use-package undo-tree +;; :ensure t +;; :config (setq undo-tree-visualizer-timestamps t) +;; (global-undo-tree-mode 1)) + +;; (use-package keyfreq +;; :ensure t +;; :config +;; (setq keyfreq-file "~/.emacs.d/keyfreq" +;; keyfreq-file-lock "~/.emacs.d/keyfreq.lock") +;; (keyfreq-mode 1) +;; (keyfreq-autosave-mode 1)) + +;; ----------------------------------------------------------------------------- +;; Scratch buffer + +(defun immortal-scratch () + (if (eq (current-buffer) (get-buffer "*scratch*")) + (progn (bury-buffer) nil) t)) + +(add-hook 'kill-buffer-query-functions 'immortal-scratch) + +;; I couldn't understand the config options, so this is the next best thing +(defun display-startup-echo-area-message () nil) + +(setq initial-scratch-message nil + initial-buffer-choice t) + +(add-hook 'after-init-hook + (lambda () + (setq default-directory "~/"))) |
