/.emacs.d

My Emacs configuration, in org-mode

Primary LanguageEmacs LispThe UnlicenseUnlicense

About

Emacs configuration in org-mode.

How does this work?

The following lines in my ~/.emacs.d/init.el generates another .el file, which is then loaded by the Emacs daemon on startup.

(require 'org)
(org-babel-load-file
  (expand-file-name "emacs.org"
                    user-emacs-directory))

Configuration

General

Personal information

(setq user-full-name "Berk Ozbalci"
      user-mail-address "berkozbalci@gmail.com")

Use y/n instead of yes/no

(fset 'yes-or-no-p 'y-or-n-p)

Discard customizations

(setq custom-file (make-temp-file ""))

Set explicit shell binary

(setq explicit-shell-file-name "/usr/bin/fish")

Evil mode

Enable evil-mode

(require 'evil)
(evil-mode 1)

evil-snipe

(require 'evil-snipe)
(evil-snipe-mode 1)

jj to evil-normal-state

(setq key-chord-two-keys-delay 0.5)
(key-chord-define evil-insert-state-map "jj" 'evil-normal-state)
(key-chord-mode 1)

Appearance and font

Set the font

(set-default-font "Inziu Iosevka J 13")

Load the font on graphical frame start

(add-to-list 'default-frame-alist '(font . "Inziu Iosevka J 13"))

Remove scroll bar on graphical frame start

(toggle-scroll-bar -1)

(defun my/disable-scroll-bars (frame)
  (modify-frame-parameters frame
                           '((vertical-scroll-bars . nil)
                             (horizonal-scroll-bars . nil))))
(add-hook 'after-make-frame-functions 'my/disable-scroll-bars)

Remove other bars

(tool-bar-mode -1)
(menu-bar-mode -1)

Theme

(load-theme 'leuven t)

Indentation and other enhancements

Indentation

(setq-default indent-tabs-mode nil)
(setq tab-width 4)

Automatically enter matching parens

(electric-pair-mode 1)

Language specific

C/C++

(setq-default c-default-style "python"
              c-basic-offset 4)
(add-hook 'c-mode-hook (lambda () (interactive) (column-marker-1 80)))

Org

Keybinds

(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cc" 'org-capture)
(global-set-key "\C-cb" 'org-iswitchb)

IPython Shell

Set Python shell interpreter

(require 'python)
(setq python-shell-interpreter "ipython")