emacs-rice/lisp/00-sane-defaults.el

96 lines
3.8 KiB
EmacsLisp
Raw Permalink Normal View History

2024-09-20 12:18:47 +03:00
;; -*- lexical-binding: t -*-
2024-10-12 21:19:24 +03:00
(setq gc-cons-threshold (* 100 1024 1024)
read-process-output-max (* 1024 1024) ;; 1mb
2024-09-20 12:18:47 +03:00
2024-10-12 21:19:24 +03:00
uniquify-buffer-name-style 'forward
visible-bell t
ring-bell-function 'ignore
window-divider-default-right-width 3
window-divider-default-places 'right-only
2024-09-20 12:18:47 +03:00
2024-10-12 21:19:24 +03:00
backup-directory-alist '(("." . "~/.backups"))
2024-09-20 12:18:47 +03:00
make-backup-files t ; backup of a file the first time it is saved.
backup-by-copying t ; don't clobber symlinks
version-control t ; version numbers for backup files
delete-old-versions t ; delete excess backup files silently
kept-old-versions 6 ; oldest versions to keep when a new numbered
2024-10-12 21:19:24 +03:00
; backup is made (default: 2)
2024-09-20 12:18:47 +03:00
kept-new-versions 9 ; newest versions to keep when a new numbered
2024-10-12 21:19:24 +03:00
; backup is made (default: 2)
2024-09-20 12:18:47 +03:00
auto-save-default t ; auto-save every buffer that visits a file
2024-10-12 21:19:24 +03:00
auto-save-timeout 3 ; number of seconds idle time before auto-save
; (default: 30)
auto-save-interval 200 ; number of keystrokes between auto-saves
; (default: 300)
x-select-enable-primary t
x-select-enable-clipboard t
mouse-drag-copy-region t
meow-cursor-type-default 'bar
meow-cursor-type-motion 'bar
meow-cursor-type-beacon 'bar
meow-cursor-type-insert '(hbar . 2)
)
;; Move global mode string to the tab-bar and hide tab close buttons
(setq tab-bar-close-button-show nil
tab-bar-separator " "
tab-bar-format '(tab-bar-format-menu-bar
tab-bar-format-tabs-groups
tab-bar-separator
tab-bar-format-align-right
tab-bar-format-global)
)
2024-09-20 12:18:47 +03:00
2024-10-12 21:19:24 +03:00
;; Turn on the tab-bar
(tab-bar-mode 1)
2024-09-20 12:18:47 +03:00
2024-10-12 21:19:24 +03:00
;; y/n for answering yes/no questions
(fset 'yes-or-no-p 'y-or-n-p)
2024-09-20 12:18:47 +03:00
2024-10-12 21:19:24 +03:00
;; No tabs
(setq-default indent-tabs-mode nil
;; Tab.space equivalence
tab-width 4)
;; Buffer encoding
(prefer-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-language-environment 'utf-8)
(set-default 'cursor-type '(hbar . 2))
(repeat-mode 1) ;; Enable repeating key maps
(menu-bar-mode 0) ;; Hide the menu bar
(tool-bar-mode 0) ;; Hide the tool bar
(savehist-mode 1) ;; Save minibuffer history
(scroll-bar-mode 0) ;; Hide the scroll bar
(xterm-mouse-mode 1) ;; Enable mouse events in terminal Emacs
(fido-vertical-mode 1) ;; Improved vertical minibuffer completions
(column-number-mode 1) ;; Show column number on mode line
(tab-bar-history-mode 1) ;; Remember previous tab window configurations
(tool-bar-mode -1)
(auto-save-visited-mode 1) ;; Auto-save files at an interval
(global-visual-line-mode 1) ;; Visually wrap long lines in all buffers
(global-auto-revert-mode 1) ;; Refresh buffers with changed local files
(blink-cursor-mode 0)
(show-paren-mode t)
(window-divider-mode)
2024-09-20 12:18:47 +03:00
(pixel-scroll-precision-mode)
2024-10-12 21:19:24 +03:00
;; Delete trailing whitespace before saving buffers
(add-hook 'before-save-hook 'delete-trailing-whitespace)
(setq display-buffer-alist
'(("\\*\\(shell\\|.*term\\|.*eshell\\|help\\|compilation\\|Async Shell Command\\|Occur\\|xref\\).*\\*"
(display-buffer-reuse-window display-buffer-in-side-window)
(side . bottom) ; Popups go at the bottom
(slot . 0) ; Use the first slot at the bottom
(post-command-select-window . t) ; Select the window upon display
(window-height . 0.3)))) ; 30% of the frame height