commit e6471f3cd4a9b213cd9a90719f1af50d7d170d52
parent 751e6d31fc6ec3ff6096d510c05e9e39e4b5cbb8
Author: Cem Keylan <cem@ckyln.com>
Date: Sat, 28 Mar 2020 22:45:30 +0300
switch to straight.el
Diffstat:
M | init.org | | | 90 | ++++++++++++++++++++++++++++++++++++++++++------------------------------------- |
1 file changed, 48 insertions(+), 42 deletions(-)
diff --git a/init.org b/init.org
@@ -12,7 +12,7 @@
- [[Attribution][Attribution]]
- [[Startup Settings][Startup Settings]]
- [[Declutter][Declutter]]
- - [[use-package][use-package]]
+ - [[Package management][Package management]]
- [[Custom-file][Custom-file]]
- [[Private file][Private file]]
- [[Diary file][Diary file]]
@@ -136,26 +136,33 @@ defined, and, if they are, will set them to 0.
(when (fboundp 'scroll-bar-mode) (scroll-bar-mode 0))
#+END_SRC
-** use-package
+** Package management
-Override any existing dumb package archive configuration
-usually found on Ubuntu based distros.
-
-#+BEGIN_SRC emacs-lisp
-(require 'package)
-(setq package-archives '(
- ("elpa" . "https://elpa.gnu.org/packages/")
- ("melpa" . "https://melpa.org/packages/")
-))
-(package-initialize)
+I have switched to straight.el for package management.
+It is overall faster than package.el, and I don't want
+to use every package that I have tried out. The following
+is the one time bootstrapping script that straight.el uses
+to install itself.
+
+#+BEGIN_SRC emacs-lisp
+(defvar bootstrap-version)
+(let ((bootstrap-file
+ (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
+ (bootstrap-version 5))
+ (unless (file-exists-p bootstrap-file)
+ (with-current-buffer
+ (url-retrieve-synchronously
+ "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
+ 'silent 'inhibit-cookies)
+ (goto-char (point-max))
+ (eval-print-last-sexp)))
+ (load bootstrap-file nil 'nomessage))
#+END_SRC
We need use-package for maintaining other packages.
#+BEGIN_SRC emacs-lisp
-(unless (package-installed-p 'use-package)
- (package-refresh-contents)
- (package-install 'use-package))
+(straight-use-package 'use-package)
#+END_SRC
** Custom-file
@@ -221,7 +228,7 @@ while I am using Emacs. Let's begin with the evil-mode itself.
#+BEGIN_SRC emacs-lisp
(use-package evil
- :ensure t
+ :straight t
:init
(setq
evil-want-keybinding nil
@@ -238,7 +245,7 @@ We didn't ask for the keybindings yet, because we are going to get the
(use-package evil-collection
:requires evil
:after evil
- :ensure t
+ :straight t
:config
(evil-collection-init))
#+END_SRC
@@ -252,7 +259,7 @@ do the job well for me.
(use-package evil-surround
:requires evil
:after evil
- :ensure t
+ :straight t
:config
(global-evil-surround-mode 1))
#+END_SRC
@@ -266,7 +273,7 @@ the [[Attribution]] section.
#+BEGIN_SRC emacs-lisp
(use-package org
-:ensure t
+:straight t
:functions org-babel-tangle
:init
'(require 'ox-md nil t)
@@ -282,7 +289,7 @@ I am quite serious on this vim stuff now. I want it everywhere.
#+BEGIN_SRC emacs-lisp
(use-package evil-org
- :ensure t
+ :straight t
:requires (evil org)
:after (evil org)
:functions evil-org-agenda-set-keys
@@ -373,7 +380,7 @@ along with it.
#+BEGIN_SRC emacs-lisp
(use-package magit
- :ensure t
+ :straight t
:config
(global-set-key (kbd "C-x g") 'magit-status))
#+END_SRC
@@ -382,7 +389,7 @@ along with it.
#+BEGIN_SRC emacs-lisp
(use-package evil-magit
- :ensure t
+ :straight t
:requires (evil magit)
:config (evil-magit-init))
#+END_SRC
@@ -395,7 +402,7 @@ hacky and buggy on Vim.
#+BEGIN_SRC emacs-lisp
(use-package flycheck
- :ensure t
+ :straight t
:config
(setq-default flycheck-disabled-checkers '(emacs-lisp-checkdoc))
:init (global-flycheck-mode))
@@ -405,7 +412,7 @@ hacky and buggy on Vim.
I don't use it as often as I thought I would be using it. But here it is.
#+BEGIN_SRC emacs-lisp
(use-package yasnippet
- :ensure t
+ :straight t
:config (yas-global-mode 1))
#+END_SRC
** Company Mode
@@ -416,7 +423,7 @@ much yet. Pretty simple config.
#+BEGIN_SRC emacs-lisp
(use-package company
- :ensure t
+ :straight t
:config (global-company-mode 1)
(setq company-idle-delay 0)
(setq company-minimum-prefix-length 1))
@@ -429,7 +436,7 @@ far as I can wrap my head-around.
#+BEGIN_SRC emacs-lisp
(use-package company-lsp
- :ensure t
+ :straight t
:after company
:init
(push 'company-lsp company-backends))
@@ -444,44 +451,44 @@ I want yasnippet to be added as a company backend.
Mingus is an [[https://musicpd.org][MPD]] client for the Emacs operating system. It has a rather
simple, straightforward interface.
#+BEGIN_SRC emacs-lisp
-(use-package mingus :ensure t)
+(use-package mingus :straight t)
(global-set-key (kbd "C-c m") 'mingus)
#+END_SRC
** Projectile
#+BEGIN_SRC emacs-lisp
(use-package projectile
- :ensure t
+ :straight t
:init (projectile-mode +1)
(define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map))
#+END_SRC
** Treemacs
#+BEGIN_SRC emacs-lisp
(use-package treemacs
- :ensure t
+ :straight t
:defines treemacs-no-png-images
:init
(global-set-key (kbd "C-c t") 'treemacs)
(setq treemacs-no-png-images t))
(use-package treemacs-evil
- :ensure t
+ :straight t
:requires treemacs
:after (treemacs evil))
(use-package treemacs-magit
- :ensure t
+ :straight t
:requires treemacs
:after (treemacs magit))
(use-package treemacs-projectile
- :ensure t
+ :straight t
:requires treemacs
:after (treemacs projectile))
#+END_SRC
** emacs-dashboard
#+BEGIN_SRC emacs-lisp
(use-package dashboard
- :ensure t
+ :straight t
:defines show-week-agenda-p
:init
(setq dashboard-center-content t)
@@ -503,7 +510,7 @@ These don't really deserve their own sections, but I prefer to use them.
This is a package for re-initiating a file as root.
#+BEGIN_SRC emacs-lisp
-(use-package sudo-edit :ensure t)
+(use-package sudo-edit :straight t)
#+END_SRC
*** linum-relative
@@ -512,7 +519,7 @@ the other lines.
#+BEGIN_SRC emacs-lisp
(use-package linum-relative
- :ensure t
+ :straight t
:init
(setq linum-relative-current-symbol "")
(global-set-key (kbd "C-C r") 'linum-relative-mode)
@@ -525,7 +532,7 @@ I have elfeed which I have connected to my Nextcloud account, it
is nice to have something synced.
#+BEGIN_SRC emacs-lisp
-(use-package elfeed :ensure t)
+(use-package elfeed :straight t)
#+END_SRC
*** markdown-mode
@@ -535,7 +542,7 @@ that I write.
#+BEGIN_SRC emacs-lisp
(use-package markdown-mode
- :ensure t
+ :straight t
:config (setq markdown-command "/usr/bin/markdown"))
#+END_SRC
@@ -545,7 +552,7 @@ I sometimes output html from org-mode as it comes handy. We use htmlize for
that.
#+BEGIN_SRC emacs-lisp
-(use-package htmlize :ensure t)
+(use-package htmlize :straight t)
#+END_SRC
*** toc-org
@@ -556,10 +563,9 @@ Github README.
#+BEGIN_SRC emacs-lisp
(use-package toc-org
- :ensure t
+ :straight t
:config
- (if (require 'toc-org nil t)
- (add-hook 'org-mode-hook 'toc-org-mode)))
+ (add-hook 'org-mode-hook 'toc-org-mode))
#+END_SRC
* Filetype Configurations
@@ -614,7 +620,7 @@ is the use-package
#+BEGIN_SRC emacs-lisp
(use-package company-jedi
- :ensure t
+ :straight t
:after company
:config
(add-to-list 'company-backends 'company-jedi))