From 4be564490f566590fcb446c2b367c6ed8ec08c5a Mon Sep 17 00:00:00 2001 From: Sravan Balaji Date: Mon, 26 Apr 2021 09:09:20 -0400 Subject: [PATCH] Emacs From Scratch #1 - Getting Started with a Basic Usable Configuration - Added basic config with ivy, doom modeline, etc. --- init.el | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 init.el diff --git a/init.el b/init.el new file mode 100644 index 0000000..05a8c1d --- /dev/null +++ b/init.el @@ -0,0 +1,79 @@ +(setq inhibit-startup-message t) ; Disable startup message + +(scroll-bar-mode -1) ; Diable visible scrollbar +(tool-bar-mode -1) ; Disable the toolbar +(tooltip-mode -1) ; Disable tooltips +(set-fringe-mode 10) ; Give some breathing room + +(menu-bar-mode -1) ; Disable the menu bar + +(setq visible-bell t) ; Set up the visible bell + +; (set-face-attribute 'default nil :font "Fira Code" :height 280) + +;; Make ESC quit prompts +(global-set-key (kbd "") 'keyboard-escape-quit) + +;; Initialize package sources +(require 'package) + +(setq package-archives + '(("melpa" . "https://melpa.org/packages/") + ; ("melpa-stable" . "https://stable.melpa.org/packages/") + ("org" . "https://orgmode.org/elpa/") + ("elpa" . "https://elpa.gnu.org/packages/") + ) +) + +(package-initialize) +(unless package-archive-contents + (package-refresh-contents)) + +;; Initialize use-package on non-Linux platforms +(unless (package-installed-p 'use-package) + (package-install 'use-package)) + +(require 'use-package) +(setq use-package-always-ensure t) + +; (use-package command-log-mode) + +; Ivy Autocompletion +(use-package ivy + :diminish + :bind (("C-s" . swiper) + :map ivy-minibuffer-map + ("TAB" . ivy-alt-done) + ("C-l" . ivy-alt-done) + ("C-j" . ivy-next-line) + ("C-k" . ivy-previous-line) + :map ivy-switch-buffer-map + ("C-k" . ivy-previous-line) + ("C-l" . ivy-done) + ("C-d" . ivy-switch-buffer-kill) + :map ivy-reverse-i-search-map + ("C-k" . ivy-previous-line) + ("C-d" . ivy-reverse-i-search-kill)) + :config + (ivy-mode 1) +) + +; Doom Modeline +(use-package doom-modeline + :ensure t + :init (doom-modeline-mode 1) + :custom (doom-modeline-height 15)) +) + +(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 '(doom-modeline use-package ivy command-log-mode))) +(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. + )