diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 0a097a5..2321d0d 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -2,6 +2,28 @@ ;;;;;; -*- 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 (custom-set-variables ;; custom-set-variables was added by Custom. @@ -10,95 +32,61 @@ ;; 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")) + '(menu-bar-mode nil) + '(package-selected-packages (quote (flycheck-yamllint yaml-mode magit pass pinentry))) '(scroll-bar-mode nil) '(show-paren-mode t) '(tool-bar-mode nil)) -;; Use UTF-8 for file name encoding -(setq file-name-coding-system 'utf-8) -(prefer-coding-system 'utf-8) +;; yank at cursor not mouse pointer +(setq mouse-yank-at-point t) -;; 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) - -;; Run a shell with zsh -(shell) -(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on) - -;; 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) +;; 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 (put 'narrow-to-region 'disabled nil) (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")))))))) +;; 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) -;; save autobackups to ~/.emacs.d/backups -(add-to-list 'backup-directory-alist - (cons "." "~/.emacs.d/backups/")) -(setq tramp-backup-directory-alist backup-directory-alist) +;; tramp mode ssh (faster) +(setq tramp-default-method "ssh") -;; Include other configs +;; set pass default password length +(setq password-store-password-length 32) + +;; 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")) diff --git a/.gitignore.d/emacs b/.gitignore.d/emacs new file mode 100644 index 0000000..dea08b0 --- /dev/null +++ b/.gitignore.d/emacs @@ -0,0 +1,4 @@ +* +!/.emacs.d +!/.emacs.d/calendar.el +!/.emacs.d/init.el