Emacs finally works!

This commit is contained in:
Anthony Cicchetti 2020-12-13 14:27:12 -05:00
parent be864cb978
commit e944d3a7e9

View file

@ -1,44 +1,37 @@
(setq gc-cons-threshold (* 100 1024 1024))
(require 'package)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/") t)
'(
("melpa" . "https://melpa.org/packages/")
("org" . "https://orgmode.org/elpa/"))
t)
(package-initialize)
(unless package-archive-contents
(package-refresh-contents))
(defvar my-packages '(
use-package
lispy
smartparens
which-key
git-gutter
rainbow-delimiters
auto-complete-distel
auto-complete
evil
evil-collection
evil-surround
base16-theme
magit
undo-tree
which-key
))
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
(dolist (p my-packages)
(when (not (package-installed-p p))
(package-install p)))
(eval-when-compile
(require 'use-package))
(require 'use-package)
(load-theme 'base16-oceanicnext t)
(which-key-mode)
(require 'use-package-ensure)
(setq use-package-always-ensure t)
(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.
'(async-bytecomp-package-mode t)
'(package-archives
'(("gnu" . "https://elpa.gnu.org/packages/")
("melpa" . "https://melpa.org/packages/")
("org" . "https://orgmode.org/elpa/")))
'(package-selected-packages
'(evil-goggles evil-expat evil-commentary auto-package-update lispy smartparens which-key git-gutter rainbow-delimiters auto-complete-distel auto-complete evil magit evil-magit))
'(evil-org org-plus-contrib evil-goggles evil-expat evil-commentary auto-package-update lispy smartparens which-key git-gutter rainbow-delimiters auto-complete-distel auto-complete evil magit evil-magit))
'(undo-tree-auto-save-history t)
'(undo-tree-history-directory-alist '(("." . "~/.undohist-emacs")))
'(undo-tree-visualizer-diff t)
@ -63,12 +56,21 @@
(setq auto-package-update-delete-old-versions t)
(auto-package-update-maybe))
;; Undo-tree
(global-undo-tree-mode)
;; Autocomplete
(require 'auto-complete)
(global-auto-complete-mode t)
(use-package auto-complete
:config (global-auto-complete-mode t))
;; Theme
(use-package base16-theme
:config (load-theme 'base16-oceanicnext t))
;; Undo-tree
(use-package undo-tree
:config
(global-undo-tree-mode))
;; Magit
(use-package magit)
;; EVIL
(use-package evil
@ -105,7 +107,15 @@
:after evil
:ensure t
:config
(global-evil-surround-mode 1))
(global-evil-surround-mode 1))
(use-package evil-org
:after (evil org)
:config
(add-hook 'org-mode-hook 'evil-org-mode)
(add-hook 'evil-org-mode-hook (lambda () (evil-org-set-key-theme)))
(require 'evil-org-agenda)
(evil-org-agenda-set-keys))
(evil-set-leader 'normal (kbd "SPC"))
(evil-define-key 'normal 'global (kbd "C-k") 'evil-scroll-up)
@ -116,16 +126,37 @@
(evil-define-key 'normal 'global (kbd "<leader>k") 'evil-window-up)
(evil-define-key 'normal 'global (kbd "<leader>i") 'help)
(evil-define-key 'normal 'global (kbd "gc") 'evil-commentary)
(evil-define-key 'normal 'global (kbd "<leader>u") 'undo-tree-visualize)
;; Rainbow Delims
(add-hook 'prog-mode-hook #'rainbow-delimiters-mode)
;; Git gutter
(global-git-gutter-mode +1)
;; Lispy
(use-package lispy)
(add-hook 'emacs-lisp-mode-hook (lambda () (lispy-mode 1)))
;; smartparens
(require 'smartparens-config)
(add-hook 'prog-mode-hook #'smartparens-mode )
(use-package smartparens
:config (smartparens-global-mode t))
;; which-key
(use-package which-key
:config (which-key-mode))
;; Git gutter
(use-package git-gutter
:config (global-git-gutter-mode +1))
;; Rainbow Delims
(use-package rainbow-delimiters
:config (add-hook 'prog-mode-hook 'rainbow-delimiters-mode))
;; Org Mode
(use-package org
:mode (("\\.org$" . org-mode))
:ensure org-plus-contrib
:config
(evil-define-key 'normal 'global (kbd "<leader> SPC l") 'org-store-link)
(evil-define-key 'normal 'global (kbd "<leader> SPC a") 'org-agenda)
(evil-define-key 'normal 'global (kbd "<leader> SPC c") 'org-capture)
)
(setq cider-font-lock-dynamically '(macro core function var))