dotfiles/.myemacs
Tanguy MAZE 2e9686bf89 plop
2019-06-22 18:16:41 +02:00

68 lines
2.7 KiB
Plaintext

;******************************************************************************;
; ;
; ::: :::::::: ;
; .myemacs :+: :+: :+: ;
; +:+ +:+ +:+ ;
; By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ ;
; +#+#+#+#+#+ +#+ ;
; Created: 2018/07/09 18:59:05 by tmaze #+# #+# ;
; Updated: 2019/05/08 10:15:23 by tmaze ### ########.fr ;
; ;
;******************************************************************************;
(load "package")
(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
(not (gnutls-available-p))))
(proto (if no-ssl "http" "https")))
(when no-ssl
(warn "\
Your version of Emacs does not support SSL connections,
which is unsafe because it allows man-in-the-middle attacks.
There are two things you can do about this warning:
1. Install an Emacs version that does support SSL and be safe.
2. Remove this warning from your init file so you won't see it again."))
;; Comment/uncomment these two lines to enable/disable MELPA and MELPA Stable as desired
(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 (cons "gnu" (concat proto "://elpa.gnu.org/packages/")))))
(package-initialize)
(setq package-initialize-at-startup nil)
(defvar tmaze/packages '(evil
magit
treemacs
treemacs-magit
jinja2-mode
ox-twbs
dakrone-theme)
"Default packages")
(defun tmaze/packages-installed-p ()
(cl-loop for pkg in tmaze/packages
when (not (package-installed-p pkg)) do (cl-return nil)
finally (cl-return t)))
(unless (tmaze/packages-installed-p)
(message "%s" "Refreshing package database...")
(package-refresh-contents)
(dolist (pkg tmaze/packages)
(when (not (package-installed-p pkg))
(package-install pkg))))
(load-theme 'dakrone t)
(global-set-key (kbd "C-x g") 'magit-status)
(global-git-commit-mode)
(global-undo-tree-mode)
(global-column-enforce-mode)
(line-number-mode 1)
(column-number-mode 1)
(setenv "ESHELL" (expand-file-name "~/.emacs.d/eshell"))