-
-
Save g-gundam/06f54e13fc41ca50dc6ad5933d4d4f04 to your computer and use it in GitHub Desktop.
Setting up emacs from scratch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; melpa | |
(require 'package) | |
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) | |
(package-initialize) | |
;; package installation and configuration | |
(use-package olivetti | |
:ensure t) | |
(use-package exotica-theme | |
:ensure t) | |
;; the rest... | |
(defun my/initial-layout () | |
"Create my initial screen layout." | |
(interactive) | |
;; 1. to have exotica theme mode enabled, along with | |
(load-theme 'exotica t) | |
;; 2. having org-mode launch in scratch buffer from the beginning, and | |
(switch-to-buffer "*scratch*") | |
(org-mode) | |
(org-indent-mode) | |
;; 3. to have olivetti mode enabled too. | |
(olivetti-mode) | |
(delete-other-windows) | |
) | |
(my/initial-layout) | |
;; Everything below this was added by emacs. | |
(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. | |
'(inhibit-startup-screen t) | |
'(package-selected-packages '(exotica-theme use-package olivetti))) | |
(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. | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
MELPA and use-package
The first thing I did was create
~/.emacs.d/init.el
and setup MELPA which lets me install more packages.This let me use M-x package-install to install use-package. Once that's installed, I can install packages with
use-package
declarations.Configuration
With all the prerequisites installed, I was able to finish writing a config that would solve this question on emacs.stackexchange.org.
The end result looks like this: