dotfiles

My opinionated dotfiles
git clone git://git.erethon.com/dotfiles
Log | Files | Refs

configuration.org (5971B)


      1 * Appearance
      2 ** Hide the menu bar on top
      3 #+BEGIN_SRC emacs-lisp
      4   (menu-bar-mode -1)
      5 #+END_SRC
      6 
      7 ** Set theme directory and use monokai
      8 
      9 #+BEGIN_SRC emacs-lisp
     10   (load-theme 'monokai t)
     11 #+END_SRC
     12 
     13 ** Use pretty icon for org-ellipsis
     14 #+BEGIN_SRC emacs-lisp
     15   (setq org-ellipsis " ↷")
     16 #+END_SRC
     17 
     18 ** Add a whitespace in linum-mode
     19 #+BEGIN_SRC emacs-lisp
     20   (setq linum-format "%d ")
     21 #+END_SRC
     22 
     23 ** Highlight matching parentheses
     24 #+BEGIN_SRC emacs-lisp
     25   (show-paren-mode 1)
     26   (setq show-paren-delay 0)
     27 #+END_SRC
     28 
     29 * Packages
     30 ** Initialize packages
     31 #+BEGIN_SRC emacs-lisp
     32   (setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")
     33   (require 'package)
     34   (setq package-archives
     35      '(("melpa" . "https://melpa.org/packages/")
     36        ("gnu" . "https://elpa.gnu.org/packages/")))
     37   (package-initialize)
     38   (setq tls-checktrust t)
     39   (setq gnutls-verify-error t)
     40 #+END_SRC
     41 
     42 * evil mode
     43 ** Use evil mode
     44 #+BEGIN_SRC emacs-lisp
     45   (require 'evil)
     46   (evil-mode 1)
     47 #+END_SRC
     48 
     49 ** Keybinds
     50 #+BEGIN_SRC emacs-lisp
     51   (define-key evil-normal-state-map (kbd "RET") 'org-return)
     52   (define-key evil-normal-state-map (kbd "C-l") 'evil-window-next)
     53   (define-key evil-normal-state-map (kbd "C-k") 'evil-window-up)
     54   (define-key evil-normal-state-map (kbd "SPC") 'scroll-up-command)
     55   (define-key evil-normal-state-map (kbd "0") 'back-to-indentation)
     56 #+END_SRC
     57 
     58 ** Evil-Leader
     59 #+BEGIN_SRC emacs-lisp
     60   (require 'evil-leader)
     61   (global-evil-leader-mode)
     62   (evil-leader/set-leader ";")
     63   (evil-leader/set-key
     64     "a" 'org-agenda
     65     "b" 'switch-to-buffer
     66     "c" 'org-capture
     67     "k" 'kill-buffer
     68     "l" 'org-insert-link
     69     "p" 'projectile-command-map
     70     "0" 'delete-window
     71     "'" 'split-window-horizontally
     72     "\"" 'split-window-vertically
     73     "#" 'linum-mode)
     74 #+END_SRC
     75 
     76 * org-mode
     77 ** List of files to parse for org-agenda
     78 #+BEGIN_SRC emacs-lisp
     79   (setq org-agenda-files (list "~/Documents/org/index.org"
     80                                "~/Documents/org/personal.org"
     81                                "~/Documents/org/work/work.org"
     82                                "~/Documents/org/Capture/capture.org"))
     83 #+END_SRC
     84 
     85 ** Org-Capture
     86 *** Templates
     87 #+BEGIN_SRC emacs-lisp
     88   (setq org-capture-templates '(("b" "Blog" entry (file+headline "~/Documents/org/Blog/ideas.org" "Blog Topics")
     89                                  "* %?")
     90                                 ("t" "To Do items" entry (file+headline "~/Documents/org/Capture/capture.org" "Tasks")
     91                                  "* TODO %?\n  %T")
     92                                 ("l" "Links" entry (file+headline "~/Documents/org/Capture/links.org" "Read me later")
     93                                  "* %?")
     94                                 ("r" "Rambling while working" entry (file+headline "~/Documents/org/Capture/transcribe.org" "Transcribe")
     95                                  "* Transcribe %T %?\n")
     96                                 ("a" "Archive" entry (file+headline "~/Documents/org/Capture/archive.org" "Archive me")
     97                                  "* %?")))
     98 #+END_SRC
     99 
    100 ** Follow links with return
    101 #+BEGIN_SRC emacs-lisp
    102   (setq org-return-follows-link t)
    103 #+END_SRC
    104 
    105 ** Set default programs to open files with
    106 #+BEGIN_SRC emacs-lisp
    107   (add-to-list 'org-file-apps '("pdf" . "xpdf %s"))
    108 #+END_SRC
    109 
    110 ** Keybinds
    111 *** Cycle task states with 't'
    112 #+BEGIN_SRC emacs-lisp
    113   (define-key evil-normal-state-map "t" 'org-todo)
    114 #+END_SRC
    115 
    116 *** Use TAB to expand/collapse sections
    117 #+BEGIN_SRC emacs-lisp
    118   (define-key evil-normal-state-map (kbd "TAB") 'org-cycle)
    119 #+END_SRC
    120 
    121 ** Highlight code in source blocks
    122 #+BEGIN_SRC emacs-lisp
    123   (setq org-src-fontify-natively t)
    124   (setq org-src-tab-acts-natively t)
    125 #+END_SRC
    126 
    127 ** Don't add footer in exported HTML files
    128 #+BEGIN_SRC emacs-lisp
    129   (setq org-html-postamble nil)
    130 #+END_SRC
    131 
    132 * org-journal
    133 ** Set journal directory
    134 #+BEGIN_SRC emacs-lisp
    135   (setq org-journal-dir "~/Documents/org/journal")
    136 #+END_SRC
    137 
    138 ** Load org-journal
    139 #+BEGIN_SRC emacs-lisp
    140   (require 'org-journal)
    141 #+END_SRC
    142 
    143 * projectile
    144 ** Enable projectile
    145 #+BEGIN_SRC emacs-lisp
    146   (projectile-mode +1)
    147 #+END_SRC
    148 
    149 ** Set code and docs directories
    150 #+BEGIN_SRC emacs-lisp
    151   (setq projectile-project-search-path '("~/Code/Erethon/" "~/Documents/org/"))
    152 #+END_SRC
    153 
    154 * Settings
    155 ** General settings
    156 *** Set tab to two spaces
    157 #+BEGIN_SRC emacs-lisp
    158   (setq-default indent-tabs-mode nil)
    159   (setq-default tab-width 2)
    160 #+END_SRC
    161 
    162 *** Remove trailing whitespace on save
    163 #+BEGIN_SRC emacs-lisp
    164   (add-hook 'before-save-hook 'delete-trailing-whitespace)
    165 #+END_SRC
    166 
    167 *** Open a debug console on errors
    168 #+BEGIN_SRC emacs-lisp
    169   (setq debug-on-error t)
    170 #+END_SRC
    171 
    172 *** Backup file location
    173 #+BEGIN_SRC emacs-lisp
    174   (setq backup-directory-alist
    175         `((".*" . ,"~/tmp/emacs")))
    176   (setq auto-save-file-name-transforms
    177         `((".*" ,"~/tmp/emacs" t)))
    178 #+END_SRC
    179 
    180 *** Recent files
    181 #+BEGIN_SRC emacs-lisp
    182   (recentf-mode 1)
    183   (setq recentf-max-menu-items 25)
    184   (global-set-key "\C-x\C-r" 'recentf-open-files)
    185 #+END_SRC
    186 
    187 *** Prompt for y/n instead of yes/no
    188 #+BEGIN_SRC emacs-lisp
    189   (fset 'yes-or-no-p 'y-or-n-p)
    190 #+END_SRC
    191 
    192 *** [[https://www.emacswiki.org/emacs/SmoothScrolling][Scroll one line at a time when at the end of the screen]]
    193 #+BEGIN_SRC emacs-lisp
    194   (setq scroll-step            1
    195         scroll-conservatively  10000)
    196 #+END_SRC
    197 
    198 *** Enable babel
    199 #+BEGIN_SRC emacs-lisp
    200   (org-babel-do-load-languages
    201     'org-babel-load-languages
    202     '((shell . t)
    203       (python . t)
    204       (dot . t)
    205      )
    206   )
    207 #+END_SRC
    208 
    209 *** Set ssh as the default mode for Tramp
    210 #+BEGIN_SRC emacs-lisp
    211   (setq tramp-default-method "ssh")
    212 #+END_SRC
    213 
    214 *** Hide most stuff from the init screen
    215 #+BEGIN_SRC emacs-lisp
    216   (setq inhibit-startup-message t)
    217   (setq inhibit-splash-screen t)
    218   (setq initial-scratch-message nil)
    219   (setq initial-buffer-choice "~/Documents/org")
    220 #+END_SRC
    221 
    222 *** Auto-close parentheses/double quotes/brackets/etc
    223 #+BEGIN_SRC emacs-lisp
    224   (electric-pair-mode 1)
    225 #+END_SRC
    226 
    227 ** Language specific
    228 *** Python
    229 **** Tab width
    230 #+BEGIN_SRC emacs-lisp
    231   (setq python-indent 4)
    232 #+END_SRC