merge with work

This commit is contained in:
finga 2018-06-02 23:42:05 +02:00
commit b6ec235b17
2 changed files with 57 additions and 65 deletions

View file

@ -2,6 +2,28 @@
;;;;;; -*- Mode: Emacs-Lisp -*- ;;;;;; -*- 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)
;; delete trailing whitespaces before saving
(add-hook 'before-save-hook 'delete-trailing-whitespace)
;; add newlines at eof
(setq require-final-newline t)
;; (setq mode-require-final-newline t)
;; theme ;; theme
(custom-set-variables (custom-set-variables
;; custom-set-variables was added by Custom. ;; custom-set-variables was added by Custom.
@ -10,95 +32,61 @@
;; If there is more than one, they won't work right. ;; If there is more than one, they won't work right.
'(column-number-mode t) '(column-number-mode t)
'(custom-enabled-themes (quote (tango-dark))) '(custom-enabled-themes (quote (tango-dark)))
'(org-agenda-files (file-expand-wildcards "~/org-mode/*.org")) '(menu-bar-mode nil)
'(package-selected-packages (quote (flycheck-yamllint yaml-mode magit pass pinentry)))
'(scroll-bar-mode nil) '(scroll-bar-mode nil)
'(show-paren-mode t) '(show-paren-mode t)
'(tool-bar-mode nil)) '(tool-bar-mode nil))
;; Use UTF-8 for file name encoding ;; yank at cursor not mouse pointer
(setq file-name-coding-system 'utf-8) (setq mouse-yank-at-point t)
(prefer-coding-system 'utf-8)
;; No fancy graphic stuff ;; make the screen go down with one line & mouse wheel support
(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
(setq scroll-step 1) (setq scroll-step 1)
(mouse-wheel-mode t) (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) (line-number-mode 1)
(column-number-mode 1) (column-number-mode 1)
;; Enhanced buffer switching ;; enhanced buffer switching
(windmove-default-keybindings) (windmove-default-keybindings)
;; Paren matching ;; display of current function (which-function-mode)
(show-paren-mode t)
;; Calender no Su at beginning
(setq european-calender-style t)
;; Run a shell with zsh
(shell)
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
;; Display of current function (which function mode)
(which-function-mode 1) (which-function-mode 1)
;; dont backup ;; no am/pm in timestamps
(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
(setq display-time-24hr-format t) (setq display-time-24hr-format t)
;; clipboard yanking is possible with middle mouse button now
(setq x-select-enable-clipboard t
x-select-enable-primary t)
;; enable some commands disabled by default ;; enable some commands disabled by default
(put 'narrow-to-region 'disabled nil) (put 'narrow-to-region 'disabled nil)
(put 'upcase-region 'disabled nil) (put 'upcase-region 'disabled nil)
(put 'downcase-region 'disabled nil) (put 'downcase-region 'disabled nil)
;; disable backups when using su or sudo ;; handle backups
(setq backup-enable-predicate (setq backup-directory-alist '(("." . "~/.emacs.d/backups/"))
(lambda (name) backup-by-copying t
(and (normal-backup-enable-predicate name) delete-old-versions t
(not kept-new-versions 6
(let ((method (file-remote-p name 'method))) kept-old-versions 2
(when (stringp method) version-control t
(member method '("su" "sudo")))))))) tramp-backup-directory-alist backup-directory-alist)
;; save autobackups to ~/.emacs.d/backups ;; tramp mode ssh (faster)
(add-to-list 'backup-directory-alist (setq tramp-default-method "ssh")
(cons "." "~/.emacs.d/backups/"))
(setq tramp-backup-directory-alist backup-directory-alist)
;; Include other configs ;; set pass default password length
(setq password-store-password-length 32)
;; include other configs
;; calendar-mode ;; calendar-mode
(if (file-exists-p "~/.emacs.d/calendar.el") (if (file-exists-p "~/.emacs.d/calendar.el")
(load-file "~/.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"))

4
.gitignore.d/emacs Normal file
View file

@ -0,0 +1,4 @@
*
!/.emacs.d
!/.emacs.d/calendar.el
!/.emacs.d/init.el