Add files module
This commit is contained in:
parent
bc604bfdf3
commit
17d7f56487
1
init.el
1
init.el
@ -99,6 +99,7 @@
|
||||
(init-packages/init '(
|
||||
editing
|
||||
emacs
|
||||
files
|
||||
helm
|
||||
parentheses
|
||||
programming
|
||||
|
116
modules/files.el
Normal file
116
modules/files.el
Normal file
@ -0,0 +1,116 @@
|
||||
;;; files.el --- Module file for configuring file management.
|
||||
;;
|
||||
;; Copyright (C) 2017 Wojciech Kozlowski
|
||||
;;
|
||||
;; Author: Wojciech Kozlowski <wojciech.kozlowski@vivaldi.net>
|
||||
;; Created: 25 Aug 2017
|
||||
;;
|
||||
;; This file is not part of GNU Emacs.
|
||||
;;
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; This module is used for configuring file management within Emacs.
|
||||
;;
|
||||
;;; License: GPLv3
|
||||
|
||||
;;; Required packages:
|
||||
|
||||
(setq init-packages/files-packages
|
||||
|
||||
'(vlf)
|
||||
|
||||
)
|
||||
|
||||
;;; Configuration:
|
||||
|
||||
(defun init-packages/init-files ()
|
||||
|
||||
;; --------------------------------------------------------------------------
|
||||
;; Large file threshold.
|
||||
;; --------------------------------------------------------------------------
|
||||
|
||||
(setq large-file-warning-threshold 10485760) ;; 10 MB
|
||||
|
||||
;; --------------------------------------------------------------------------
|
||||
;; Back up settings.
|
||||
;; --------------------------------------------------------------------------
|
||||
|
||||
(defvar backup-directory "~/.emacs.d/.backups")
|
||||
(if (not (file-exists-p backup-directory))
|
||||
(make-directory backup-directory t))
|
||||
|
||||
(setq-default
|
||||
;; Backup a file the first time it is saved
|
||||
make-backup-files t
|
||||
;; Save backup files in ~/.emacs.d/.backups.
|
||||
backup-directory-alist `((".*" . ,backup-directory))
|
||||
;; Copy the current file into backup directory.
|
||||
backup-by-copying t
|
||||
;; Version numbers for backup files.
|
||||
version-control t
|
||||
;; Delete unnecessary versions.
|
||||
delete-old-versions t
|
||||
;; Oldest versions to keep when a new numbered backup is made.
|
||||
kept-old-versions 2
|
||||
;; Newest versions to keep when a new numbered backup is made.
|
||||
kept-new-versions 3
|
||||
;; Auto-save every buffer that visits a file.
|
||||
auto-save-default t
|
||||
;; Number of seconds idle time before auto-save.
|
||||
auto-save-timeout 30
|
||||
;; Number of keystrokes between auto-saves.
|
||||
auto-save-interval 300)
|
||||
|
||||
;; --------------------------------------------------------------------------
|
||||
;; Dired.
|
||||
;; --------------------------------------------------------------------------
|
||||
|
||||
(setq
|
||||
;; If another Dired buffer is visible, use it as target for Rename/Copy.
|
||||
dired-dwim-target t
|
||||
;; "always" means no asking.
|
||||
dired-recursive-copies 'always
|
||||
;; "top" means ask once for top level directory.
|
||||
dired-recursive-deletes 'top
|
||||
;; Human-readable listing
|
||||
dired-listing-switches "-lha --group-directories-first"
|
||||
)
|
||||
|
||||
;; Automatically refresh dired buffer on changes.
|
||||
(add-hook 'dired-mode-hook 'auto-revert-mode)
|
||||
|
||||
(use-package dired-x
|
||||
:init
|
||||
(add-hook 'dired-mode-hook 'dired-omit-mode)
|
||||
:config
|
||||
(setq-default dired-omit-files "^\\.\\|^\\#"))
|
||||
|
||||
(use-package wdired
|
||||
:config
|
||||
(setq-default wdired-allow-to-change-permissions t
|
||||
wdired-allow-to-redirect-links t))
|
||||
|
||||
;; --------------------------------------------------------------------------
|
||||
;; Recentf.
|
||||
;; --------------------------------------------------------------------------
|
||||
|
||||
(recentf-mode 1)
|
||||
(use-package recentf-ext)
|
||||
|
||||
;; --------------------------------------------------------------------------
|
||||
;; View large files.
|
||||
;; --------------------------------------------------------------------------
|
||||
|
||||
(use-package vlf-integrate
|
||||
:config
|
||||
(setq-default vlf-application 'dont-ask))
|
||||
|
||||
;; --------------------------------------------------------------------------
|
||||
;; Remember location in file.
|
||||
;; --------------------------------------------------------------------------
|
||||
|
||||
(use-package save-place
|
||||
:init
|
||||
(save-place-mode 1))
|
||||
|
||||
)
|
Reference in New Issue
Block a user