From d16363ffbab5dd8866a8510e943f0af0248b8ed3 Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Fri, 19 Aug 2022 17:00:10 -0400 Subject: [PATCH] Switch from Cask to package.el + use-package I also removed some packages that were causing a lot of warnings and that I don't think I will need anytime soon. --- .gitignore | 3 ++ Cask | 47 ------------------------------- early-init.el | 25 +++++++++++++++++ init.el | 77 +++++++++++++++++++++++++++++++++++++++------------ 4 files changed, 88 insertions(+), 64 deletions(-) delete mode 100644 Cask create mode 100644 early-init.el diff --git a/.gitignore b/.gitignore index 2d1277c..e08365e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ auto-save-list *.elc elpa/ games/ +transient/ +url/ +eln-cache/ diff --git a/Cask b/Cask deleted file mode 100644 index 1d228bf..0000000 --- a/Cask +++ /dev/null @@ -1,47 +0,0 @@ -(source gnu) -(source melpa) - -(depends-on "bind-key") -(depends-on "cask") -(depends-on "dash") -(depends-on "drag-stuff") -(depends-on "drupal-mode") -(depends-on "editorconfig") -(depends-on "exec-path-from-shell") -(depends-on "expand-region") -(depends-on "f") -(depends-on "flycheck") -(depends-on "flycheck-cask") -(depends-on "flycheck-pyflakes") -(depends-on "flycheck-rust") -(depends-on "flycheck-yamllint") -(depends-on "flymd") -(depends-on "htmlize") -(depends-on "git") -(depends-on "git-commit") -(depends-on "go-mode") -(depends-on "groovy-mode") -(depends-on "idle-highlight-mode") -(depends-on "js2-mode") -(depends-on "kivy-mode") -(depends-on "magit") -(depends-on "markdown-mode") -(depends-on "multiple-cursors") -(depends-on "nyan-mode") -(depends-on "pallet") -(depends-on "php-mode") -(depends-on "popwin") -(depends-on "prodigy") -(depends-on "projectile") -(depends-on "puppet-mode") -(depends-on "rust-mode") -(depends-on "s") -(depends-on "scss-mode") -(depends-on "smartparens") -(depends-on "smex") -(depends-on "twig-mode") -(depends-on "use-package") -(depends-on "web-mode") -(depends-on "yasnippet") -(depends-on "yaml-mode") -(depends-on "zig-mode") diff --git a/early-init.el b/early-init.el new file mode 100644 index 0000000..6e77b12 --- /dev/null +++ b/early-init.el @@ -0,0 +1,25 @@ + +;;; early-init.el --- Spacemacs Early Init File +;; +;; Copyright (c) 2018 Sylvain Benner & Contributors +;; +;; Author: Miciah Dashiel Butler Masters +;; URL: https://github.com/syl20bnr/spacemacs +;; +;; This file is not part of GNU Emacs. +;; +;;; License: GPLv3 + +;; Before Emacs 27, the init file was responsible for initializing the package +;; manager by calling `package-initialize'. Emacs 27 changed the default +;; behavior: It now calls `package-initialize' before loading the init file. +;; This behavior would prevent Spacemacs's own package initialization from +;; running. However, Emacs 27 also loads the "early init" file (this file) +;; before it initializes the package manager, and Spacemacs can use this early +;; init file to prevent Emacs from initializing the package manager. (See +;; .) +;; +;; Earlier Emacs versions do not load the early init file and do not initialize +;; the package manager before loading the init file, so this file is neither +;; needed nor loaded on those versions. +(setq package-enable-at-startup nil) diff --git a/init.el b/init.el index 428e5e3..0d04429 100644 --- a/init.el +++ b/init.el @@ -3,32 +3,62 @@ ;; Always load newest byte code ;; (setq load-prefer-newer t) -;; Load cask info - ;; Added by Package.el. This must come before configurations of ;; installed packages. Don't delete this line. If you don't want it, ;; just comment it out by adding a semicolon to the start of the line. ;; You may delete these explanatory comments. +(require 'package) +(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) +(package-initialize) -;; this suppresses warnings about initialization -;; @see https://github.com/cask/cask/issues/463 -(setq warning-suppress-log-types '((package reinitialization))) -(require 'cask "~/local/share/cask/cask.el") -(cask-initialize) +(eval-when-compile + (require 'use-package)) -;; Enable flycheck -;;(use-package flycheck -;; :ensure t -;; :init (global-flycheck-mode)) +(require 'use-package-ensure) +(setq use-package-always-ensure t) + +(use-package bind-key) +(use-package dash) +(use-package drag-stuff) +(use-package editorconfig) +(use-package exec-path-from-shell) +(use-package expand-region) +(use-package f) +(use-package flycheck + :init (global-flycheck-mode)) (add-hook 'after-init-hook #'global-flycheck-mode) +(use-package flycheck-pyflakes) +(use-package flycheck-rust) +(use-package flycheck-yamllint) +(use-package flymd) +(use-package htmlize) +(use-package git) +(use-package git-commit) +(use-package go-mode) +(use-package groovy-mode) +(use-package idle-highlight-mode) +(use-package kivy-mode) +(use-package magit) +(use-package markdown-mode) +(use-package multiple-cursors) +(use-package nyan-mode) +(use-package php-mode) +(use-package popwin) +(use-package prodigy) +(use-package projectile) +(use-package puppet-mode) +(use-package rust-mode) +(use-package s) +(use-package smartparens) +(use-package smex) +(use-package yaml-mode) +(use-package zig-mode) ;; Generic Emacs stuff (add-to-list 'load-path "~/.emacs.d/modes/") (add-to-list 'load-path "~/.emacs.d/misc/") (show-paren-mode 1) -;; CSS Mode needs to be applied to scss files. -(add-to-list 'auto-mode-alist '("\\.scss" . css-mode)) (setq-default css-indent-offset 2) ;; Always use spaces instead of tabs, a tab is 4 spaces by default @@ -51,10 +81,10 @@ (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode)) ; Flymd's flyit doesn't work well with chrome/chromeium -(defun my-flymd-browser-function (url) - (let ((browse-url-browser-function 'browse-url-firefox)) - (browse-url url))) -(setq flymd-browser-open-function 'my-flymd-browser-function) +;(defun my-flymd-browser-function (url) +; (let ((browse-url-browser-function 'browse-url-firefox)) +; (browse-url url))) +;(setq flymd-browser-open-function 'my-flymd-browser-function) ; Magit configuration. (global-set-key (kbd "C-x g") 'magit-status) @@ -64,3 +94,16 @@ (require 'beancount nil 'noerror) (add-to-list 'auto-mode-alist '("\\.beancount\\'" . beancount-mode)) +(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. + '(package-selected-packages + '(zig-mode yaml-mode yanshippet smex smartparens rust-mode puppet-mode projectile prodigy popwin php-mode nyan-mode multiple-cursors markdown-mode magit kivy-mode idle-highlight-mode groovy-mode go-mode git-commit git htmlize flymd flycheck-yamllint flycheck-rust flycheck-pyflakes flycheck f expand-region exec-path-from-shell editorconfig drag-stuff dash cmake-mode use-package))) +(custom-set-faces + ;; custom-set-faces 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. + )