update config

This commit is contained in:
finga 2018-05-08 15:50:25 +02:00
parent 65d3e72658
commit a5bf7e5a2d

View file

@ -2,65 +2,49 @@
;;;;;; -*- Mode: Emacs-Lisp -*-
;;;;
;; melpa and elpa
(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
(not (gnutls-available-p))))
(proto (if no-ssl "http" "https")))
(add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t)
(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t)
(when (< emacs-major-version 24)
;; for important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . (concat proto "://elpa.gnu.org/packages/")))))
(package-initialize)
;; use space instead of tabs
(setq-default indent-tabs-mode nil)
;; theme
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(column-number-mode t)
'(custom-enabled-themes (quote (tango-dark)))
'(org-agenda-files (file-expand-wildcards "~/org-mode/*.org"))
'(scroll-bar-mode nil)
'(show-paren-mode t)
'(tool-bar-mode nil))
'(scroll-bar-mode nil)
'(tool-bar-mode nil)
'(menu-bar-mode nil))
;; Use UTF-8 for file name encoding
(setq file-name-coding-system 'utf-8)
(prefer-coding-system 'utf-8)
;; No fancy graphic stuff
(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
(if (fboundp 'menu-bar-mode) (menu-bar-mode -1))
;; Make the screen go down with one line & Mouse wheel support
;; make the screen go down with one line & mouse wheel support
(setq scroll-step 1)
(mouse-wheel-mode t)
;; Enable line, linum and column numbering
;; use UTF-8 for file name encoding
(setq file-name-coding-system 'utf-8)
(prefer-coding-system 'utf-8)
;; enable line, linum and column numbering
(line-number-mode 1)
(column-number-mode 1)
;; Enhanced buffer switching
;; enhanced buffer switching
(windmove-default-keybindings)
;; Paren matching
(show-paren-mode t)
;; Calender no Su at beginning
(setq european-calender-style t)
;; Display of current function (which function mode)
;; display of current function (which-function-mode)
(which-function-mode 1)
;; dont backup
(setq make-backup-files nil)
;; woman
(setq woman-use-own-frame nil)
;; X11 clipboard interaction (http://www.emacswiki.org/emacs/CopyAndPaste)
(global-set-key [(shift delete)] 'clipboard-kill-region)
(global-set-key [(control insert)] 'clipboard-kill-ring-save)
(global-set-key [(shift insert)] 'primary-yank) ;; like an an X terminal
(setq select-active-regions t)
(global-set-key [mouse-2] 'mouse-yank-primary)
;; No, please, no tabs in my programs!
(setq indent-tabs-mode nil)
;; No am/pm here
;; no am/pm in timestamps
(setq display-time-24hr-format t)
;; enable some commands disabled by default
@ -68,54 +52,22 @@
(put 'upcase-region 'disabled nil)
(put 'downcase-region 'disabled nil)
;; disable backups when using su or sudo
(setq backup-enable-predicate
(lambda (name)
(and (normal-backup-enable-predicate name)
(not
(let ((method (file-remote-p name 'method)))
(when (stringp method)
(member method '("su" "sudo"))))))))
;; save autobackups to ~/.emacs.d/backups
(add-to-list 'backup-directory-alist
(cons "." "~/.emacs.d/backups/"))
(setq tramp-backup-directory-alist backup-directory-alist)
;; stretch cursor to correct width
(setq-default x-stretch-cursor t)
;; Include other configs
;; calendar-mode
(if (file-exists-p "~/.emacs.d/calendar.el")
(load-file "~/.emacs.d/calendar.el"))
;; custom
(if (file-exists-p "~/.emacs.d/custom.el")
(load-file "~/.emacs.d/custom.el"))
;; org-mode
(if (file-exists-p "~/.emacs.d/org-mode.el")
(load-file "~/.emacs.d/org-mode.el"))
;; rust-mode
(if (file-exists-p "~/.emacs.d/rust-mode.el")
(load-file "~/.emacs.d/rust-mode.el"))
;; ;; puppet-mode
;; (if (file-exists-p "~/.emacs.d/puppet-syntax-emacs/puppet-mode-init.el")
;; (load-file "~/.emacs.d/puppet-syntax-emacs/puppet-mode-init.el"))
;; (if (file-exists-p "~/.emacs.d/puppet-syntax-emacs/puppet-mode.el")
;; (load-file "~/.emacs.d/puppet-syntax-emacs/puppet-mode.el"))
;; ;; puppet flymake via puppet-lint
;; (if (file-exists-p "~/.emacs.d/puppet-flymake/flymake-puppet.el")
;; (load-file "~/.emacs.d/puppet-flymake/flymake-puppet.el"))
;; (require 'flymake-puppet)
;; (add-hook 'puppet-mode-hook (lambda () (flymake-puppet-load)))
;; handle backups
(setq backup-directory-alist '(("." . "~/.emacs.d/backups/"))
backup-by-copying t
delete-old-versions t
kept-new-versions 6
kept-old-versions 2
version-control t
tramp-backup-directory-alist backup-directory-alist)
;; tramp mode ssh (faster)
(setq tramp-default-method "ssh")
;; gpg gui fix
(setenv GPG_AGENT_INFO nil)
;; include other configs
;; calendar-mode
(if (file-exists-p "~/.emacs.d/calendar.el")
(load-file "~/.emacs.d/calendar.el"))