69
modules/init-editing-utils.el
Normal file
69
modules/init-editing-utils.el
Normal file
@@ -0,0 +1,69 @@
|
||||
;;; init-editing-utils.el --- .Emacs Configuration -*- lexical-binding: t -*-
|
||||
;;; Commentary:
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
|
||||
;;----------------------------------------------------------------------------
|
||||
;; Remove whitespaces
|
||||
;;----------------------------------------------------------------------------
|
||||
;; Delete trailing whitespace before saving fil → all modes
|
||||
;; (add-hook 'before-save-hook 'delete-trailing-whitespace)
|
||||
|
||||
;; Delete-trailing-whitespace-when-saving-except-certain-modes
|
||||
(add-hook 'before-save-hook
|
||||
(lambda ()
|
||||
(unless (eq major-mode 'diff-mode)
|
||||
(delete-trailing-whitespace))))
|
||||
;;----------------------------------------------------------------------------
|
||||
;; Automatic pairs open symbols (, {, [...
|
||||
;; Disable for default.
|
||||
;; Uncomment the next 4 lines if you want to enable the pairs-mode
|
||||
;;(when (fboundp 'electric-pair-mode)
|
||||
;; (electric-pair-mode))
|
||||
;;(when (eval-when-compile (version< "24.4" emacs-version))
|
||||
;; (electric-indent-mode 1))
|
||||
|
||||
;; Active auto-revert-mode that automatically reloads modified files out of Emacs.
|
||||
;; It is very useful to see logs (like auto-revert-tail-mode) among many other cases.
|
||||
(global-auto-revert-mode)
|
||||
(setq global-auto-revert-non-file-buffers t
|
||||
auto-revert-verbose nil)
|
||||
|
||||
;;----------------------------------------------------------------------------
|
||||
;; Show matching parens
|
||||
;;----------------------------------------------------------------------------
|
||||
(show-paren-mode 1)
|
||||
|
||||
;;----------------------------------------------------------------------------
|
||||
;; More useful things - only one line
|
||||
;;----------------------------------------------------------------------------
|
||||
(set-default 'truncate-lines t)
|
||||
(setq show-trailing-whitespace nil)
|
||||
|
||||
;;----------------------------------------------------------------------------
|
||||
;; Some basic preferences
|
||||
;;----------------------------------------------------------------------------
|
||||
(setq-default
|
||||
indent-tabs-mode nil)
|
||||
|
||||
;;----------------------------------------------------------------------------
|
||||
;; Undo-tree
|
||||
;;----------------------------------------------------------------------------
|
||||
(use-package undo-tree
|
||||
:diminish undo-tree-mode
|
||||
:config
|
||||
(progn
|
||||
(global-undo-tree-mode)
|
||||
(setq undo-tree-visualizer-timestamps nil)
|
||||
(setq undo-tree-visualizer-diff nil)))
|
||||
|
||||
;;----------------------------------------------------------------------------
|
||||
(load-file "~/.emacs.d/modules/lib/myemacs.el")
|
||||
|
||||
(provide 'init-editing-utils)
|
||||
|
||||
;; Local Variables:
|
||||
;; byte-compile-warnings: (not free-vars)
|
||||
;; End:
|
||||
;;; init-editing-utils.el ends here
|
||||
Reference in New Issue
Block a user