dotfiles/emacs/.emacs.d/config.org

5.7 KiB

Emacs Configuration from TuDatTr

Preface

Before installing and using emacs, emacs should be run as a daemon. This decreases the loading times of the editor enormously and enables you to return to your former emacs session at any time. To do this you first need to make sure emace --daemon is run during the start up. To access the daemonized emacs you can either run emacsclient -t to use it in the terminal or simply emacsclient if you want to use the GUI version.

Package installation

Preperation

Initialize Emacs builtin package system and add the melpa-package repository.

  (require 'package)
  (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
  (package-initialize)
  (package-refresh-contents)

Installation

use-package

A use-package declaration for simplifying your .emacs

  (unless (package-installed-p 'use-package)
(package-install 'use-package))

  (require 'use-package)
  (setq use-package-always-ensure t)

diminish

Diminished modes are minor modes with no modeline display

  (use-package diminish)

no-littering

Help keeping ~/.emacs.d clean

  (use-package no-littering)

evil/evil-collection

The extensible vi layer for Emacs. A set of keybindings for evil-mode

  (use-package evil
:init
(setq evil-want-keybinding nil)
:config
(evil-mode 1)
(setq evil-search-module 'evil-search))

  (use-package evil-collection
:config
(evil-collection-init))

Ivy/Counsil/Swiper

Ivy - a generic completion frontend for Emacs, Swiper - isearch with an overview, and more. Oh, man!

  (use-package prescient)

  (use-package ivy-prescient
:config
(ivy-prescient-mode 1))

  (use-package ivy)

  (use-package counsel  
:diminish counsel-mode
:config
(counsel-mode 1))

  (use-package swiper
:bind (("C-s" . 'swiper)))

Magit

A Git Porcelain inside Emacs.

  (use-package magit)

AUCTeX

an extensible package for writing and formatting TeX files.

  (use-package auctex
:defer t
:config
(setq TeX-parse-self t)
(setq-default TeX-master nil)
(setq TeX-PDF-mode t))

ox-reveal

Exports Org-mode contents to Reveal.js HTML presentation.

  (use-package ox-reveal)

ox-twbs

Export org-mode docs as HTML compatible with Twitter Bootstrap.

  (use-package ox-twbs)

org-bullets

utf-8 bullets for org-mode

  (use-package org-bullets)

rainbow-mode

Colorize color names in buffers

  (use-package rainbow-mode)

rainbow-delimiters

Emacs rainbow delimiters mode

  (use-package rainbow-delimiters)

yasnippet

A template system for Emacs

  (use-package yasnippet)

Appearance

This section is for appearance customization. Either via packages or manually.

moe-theme

A customizable colorful eye-candy theme for Emacser. Moe, moe, kyun!

  (use-package moe-theme
    :config
    (moe-dark))

Transparent Emacs

Makes the default color of the background of emacs the same as the terminals color. This is kind of a janky solution, but it works.

  (add-hook 'window-setup-hook
     '(lambda ()
 (set-face-background 'default "unspecified-bg")))

Menubar

Remove the menu-bar at the top of the screen for better immersion.

  (menu-bar-mode -1)

Emacs Configuration

Symbolic Links

Follow symlinks without asking for confirmation.

  (setq vc-follow-symlinks t)

Mode Configuration

Org-Mode

Enable org-bullets and hide leading stars.

  (add-hook 'org-mode-hook 
     (lambda () 
(org-bullets-mode 1)))

Enables specific languages for org-babel, so those languages can be used and compiled in code blocks and disable the compilation concirmation. The code afterwords enables proper indentation inside those source blocks.

  (org-babel-do-load-languages
   'org-babel-load-languages
   '((emacs-lisp . t)
(C . t)
(makefile . t)
(shell . t)
(latex . t)
(python . t)))

  (setq org-confirm-babel-evaluate nil)
  (setq org-src-tab-acts-natively t)