dotfiles

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

configuration.org (6553B)


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