summaryrefslogtreecommitdiff
path: root/basic.el
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2021-01-09 14:22:00 +0800
committerJSDurand <mmemmew@gmail.com>2021-01-09 14:22:00 +0800
commitdc206ebe9397d656971ba7fc3a092009ef4e797a (patch)
treed963873011122fdf0eafeba89afd487115994bc5 /basic.el
parenta2f7f2bf9077ba8acfc550575b9e21aa9ffe7bae (diff)
temporary state
Diffstat (limited to 'basic.el')
-rw-r--r--basic.el75
1 files changed, 71 insertions, 4 deletions
diff --git a/basic.el b/basic.el
index 0398073..cfa606a 100644
--- a/basic.el
+++ b/basic.el
@@ -1,5 +1,9 @@
;;; -*- lexical-binding: t; -*-
+;;; Important in order to read passwords
+
+(setq epg-pinentry-mode 'loopback)
+
;;; disable some default modes
(tool-bar-mode -1)
@@ -7,9 +11,21 @@
(scroll-bar-mode -1)
(blink-cursor-mode -1)
+;;; I use one single space to end a sentence.
+
+(set 'sentence-end-double-space nil)
+
+;;; Say y instead of yes
+
+(fset 'yes-or-no-p 'y-or-n-p)
+
+;;; Recursive minibuffers is almost indispensable for me.
+
+(set 'enable-recursive-minibuffers t)
+
;;; Use spaces instead of tabs
-(set 'indent-tabs-mode nil)
+(set-default 'indent-tabs-mode nil)
;;; Don't make noise when saving files
@@ -32,9 +48,20 @@
(setq scroll-conservatively 30)
-;;; don't make backup files
+;;; remember my minibuffer
+
+(require 'savehist)
+
+(set 'savehist-file (expand-file-name "savehist" load-file-directory))
+(set 'history-length 1024)
+(set 'history-delete-duplicates t)
+(set 'savehist-save-minibuffer-history t)
+
+(savehist-mode)
+
+;;; a large file threshold
-(setq make-backup-files nil)
+(set 'large-file-warning-threshold (* 1024 1024 1024))
;;; don't use a GUI dialog box as that is distracting to me
@@ -77,7 +104,47 @@
(setq-default display-line-numbers-type nil)
(global-display-line-numbers-mode -1)
-;;; package management
+;;; display-buffer-alist
+
+(setq display-buffer-alist
+ `((,(rx (seq bos "*Help*" eos))
+ (display-buffer-in-side-window)
+ (side . bottom)
+ (slot . 1)
+ (window-height . 0.37))
+ (,(rx (seq bos "*Messages*" eos))
+ (display-buffer-in-side-window)
+ (side . bottom)
+ (slot . -1)
+ (window-height . 0.37))))
+
+;;; auto-fill for texts
+
+(set 'adaptive-fill-mode t)
+(add-hook 'text-mode-hook #'auto-fill-mode)
+
+;;; enable all commands
+
+(set 'disabled-command-function nil)
+
+;;; Comments relateed
+
+(require 'newcomment)
+
+(set 'comment-empty-lines nil)
+(set 'comment-fill-column nil)
+(set 'comment-multi-line t)
+(set 'comment-style 'multi-line)
+
+;;; Windows
+
+(define-key global-map (vector ?\s-o) #'other-window)
+(define-key global-map (vector ?\s-&) #'delete-other-windows)
+(define-key global-map (vector ?\s-à) #'delete-window)
+(define-key global-map (vector ?\s-f) #'find-file)
+(define-key global-map (vector ?\s-v) #'durand-focus-completion-or-minibuffer)
+
+;;; Package management
;;;###autoload
(defvar package-dir "/Users/durand/elisp_packages/"