-;; autorevert: enable automatic reloading of changed buffers and files
-(csetq auto-revert-verbose nil
- global-auto-revert-non-file-buffers nil)
-(require 'autorevert)
-(global-auto-revert-mode 1)
-
-;; time and battery in mode-line
-(csetq
- display-time-default-load-average nil
- display-time-format " %a %b %-e %-l:%M%P"
- display-time-mail-icon '(image :type xpm
- :file "gnus/gnus-pointer.xpm"
- :ascent center)
- display-time-use-mail-icon t)
-(require 'time)
-(display-time-mode)
-
-(csetq battery-mode-line-format " %p%% %t")
-(require 'battery)
-(display-battery-mode)
-
-(require 'fringe)
-;; smaller fringe
-;; (fringe-mode '(3 . 1))
-(fringe-mode nil)
-
-(require 'winner)
-;; enable winner-mode (C-h f winner-mode RET)
-(winner-mode 1)
+(with-eval-after-load 'minibuffer
+ (setq read-file-name-completion-ignore-case t))
+
+;; `startup'
+(setq auto-save-list-file-prefix (b/var "auto-save/sessions/"))
+
+(with-eval-after-load 'files
+ (setq
+ ;; backups (C-h v make-backup-files RET)
+ backup-by-copying t
+ backup-directory-alist (list (cons "." (b/var "backup/")))
+ version-control t
+ delete-old-versions t
+ ;; auto-save
+ auto-save-file-name-transforms `((".*" ,(b/var "auto-save/") t))
+ ;; insert newline at the end of files
+ ;; require-final-newline t
+ ;; open read-only file buffers in view-mode
+ ;; (enables niceties like `q' for quit)
+ view-read-only t))
+
+;; `novice'
+(setq disabled-command-function nil)
+
+;; `subr'
+;; (keyboard-translate ?\( ?\[)
+;; (keyboard-translate ?\) ?\])
+;; (keyboard-translate ?\[ ?\()
+;; (keyboard-translate ?\] ?\))
+
+(run-with-idle-timer 0.1 nil #'require 'autorevert)
+(with-eval-after-load 'autorevert
+ (setq
+ ;; auto-revert-verbose nil
+ global-auto-revert-non-file-buffers nil)
+ (global-auto-revert-mode 1))
+
+(run-with-idle-timer 0.1 nil #'require 'time)
+(with-eval-after-load 'time
+ (setq
+ display-time-default-load-average nil
+ display-time-format " %a %b %-e %-l:%M%P"
+ display-time-mail-icon '(image :type xpm
+ :file "gnus/gnus-pointer.xpm"
+ :ascent center)
+ display-time-use-mail-icon t
+ zoneinfo-style-world-list
+ `(,@zoneinfo-style-world-list
+ ("Etc/UTC" "UTC")
+ ("Asia/Tehran" "Tehran")
+ ("Australia/Melbourne" "Melbourne")))
+ (display-time-mode))
+
+(run-with-idle-timer 0.1 nil #'require 'battery)
+(with-eval-after-load 'battery
+ (setq battery-mode-line-format " %p%% %t")
+ (display-battery-mode))
+
+;; (with-eval-after-load 'fringe
+;; ;; smaller fringe
+;; (fringe-mode '(3 . 1)))
+
+(run-with-idle-timer 0.5 nil #'require 'winner)
+(with-eval-after-load 'winner
+ (winner-mode 1))
+
+(run-with-idle-timer 0.5 nil #'require 'windmove)
+(with-eval-after-load 'windmove
+ (setq windmove-wrap-around t)
+ (global-set-key (kbd "M-H") #'windmove-left)
+ (global-set-key (kbd "M-L") #'windmove-right)
+ (global-set-key (kbd "M-K") #'windmove-up)
+ (global-set-key (kbd "M-J") #'windmove-down))