| | |
| | | #+TITLE: My Emacs configuration
|
| | | # LocalWords: poppler mingw emacs eq nt gnuplot setenv mapconcat el cond minibuffer pdf color Smartparens smartparens yas aindent whitespace eldoc ielm ibuffer hippie pscp pos Spaceline spaceline powerline spacemacs seperator dir Yasnippet yasnippet flycheck magit fullscreen CEDET askifnotset semanticdb EDE ede gdb srefactor analyzer eval cdb autosetup ghostscript math unicode reftex bibtex TeXcount texcount str latin rkt PlantUML plantuml autoload alist matlab verilog ds vh src fontify natively fortran dvipng plist xcolor EXWM Zenburn setq zenburn defun dolist init config DejaVu ispell aspell flyspell kbd recentf sexp ov bg listp defadvice progn prog keyfreq autosave dabbrev hl gc linum linux utf RET ARG arg configs backends contribs AucTex tex auctex LaTeX url htmlize
|
| | | # LocalWords: poppler mingw emacs eq nt gnuplot setenv mapconcat el cond minibuffer pdf color Smartparens smartparens yas aindent whitespace eldoc ielm ibuffer hippie pscp pos Spaceline spaceline powerline spacemacs seperator dir Yasnippet yasnippet flycheck magit fullscreen CEDET askifnotset semanticdb EDE ede gdb srefactor analyzer eval cdb autosetup ghostscript math unicode reftex bibtex TeXcount texcount str latin rkt PlantUML plantuml autoload alist matlab verilog ds vh src fontify natively fortran dvipng plist xcolor EXWM Zenburn setq zenburn defun dolist init config DejaVu ispell aspell flyspell kbd recentf sexp ov bg listp defadvice progn prog keyfreq autosave dabbrev hl gc linum linux utf RET ARG arg configs backends contribs AucTex tex auctex LaTeX url htmlize linter backend writegood ggtags gtags dired eshell asm cd dwim VHDL defvar ctags vhdl concat sp html awk defalias cedet mips IPython ein contrib pandoc dokuwiki EMMS MPD emms toc favicon href css stylesheet async dataLayer gtag js UA sitelinks br Github postamble isso center disqus onclick Disqus javascript dsq createElement getElementsByTagName xml urlset xmlns curr loc
|
| | |
|
| | | * COMMENT Windows dependencies
|
| | | Dependencies needed for Aspell, poppler PDF-tools, compilers and ghost-script provided by mingw64
|
| | |
| | | Zenburn theme is the default
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (setq emacs-theme 'zenburn)
|
| | |
|
| | | (defun disable-all-themes ()
|
| | | (dolist (i custom-enabled-themes)
|
| | | (disable-theme i)))
|
| | |
|
| | | (cond ((eq emacs-theme 'zenburn)
|
| | | (use-package zenburn-theme
|
| | |
| | | (doom-themes-visual-bell-config)
|
| | | (doom-themes-org-config)))
|
| | | ((eq emacs-theme 'none)
|
| | | (disable-all-themes)))
|
| | | (dolist (i custom-enabled-themes)
|
| | | (disable-theme i))))
|
| | | #+END_SRC
|
| | |
|
| | | ** Default font
|
| | |
| | | (setq-default ispell-program-name "aspell")
|
| | | (setq-default ispell-local-dictionary "en_AU")
|
| | | (add-hook 'latex-mode-hook 'flyspell-mode)
|
| | | (add-hook 'latex-mode-hook 'flyspell-buffer)
|
| | | ;; (add-hook 'latex-mode-hook 'flyspell-buffer)
|
| | | (add-hook 'org-mode-hook 'flyspell-mode)
|
| | | (add-hook 'org-mode-hook 'flyspell-buffer)
|
| | | ;; (add-hook 'org-mode-hook 'flyspell-buffer)
|
| | | #+END_SRC
|
| | |
|
| | | ** Switch-window
|
| | |
| | | #+END_SRC
|
| | |
|
| | | ** COMMENT ggtags
|
| | | Use GNU Global Tags. Can be useful for large projects.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package ggtags
|
| | | :ensure t
|
| | |
| | | #+END_SRC
|
| | |
|
| | | ** COMMENT Ctags
|
| | | Ctags is an older tagging program that supports more languages.
|
| | | Currently setup for VHDL as I had to work with a large existing VHDL code-base.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (defvar ctags-command "ctags -e -R --languages=vhdl")
|
| | |
|
| | |
| | |
|
| | | * Small tweaks
|
| | | ** Remove startup screen
|
| | | Start on scratch buffer instead.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (setq inhibit-startup-message t)
|
| | | #+END_SRC
|
| | |
|
| | | ** Disable bell
|
| | | Bloody bell dings every time you hit a key too much
|
| | | Bloody bell dings every time you hit a key too much.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (setq ring-bell-function 'ignore)
|
| | | #+END_SRC
|
| | |
|
| | | ** Pretty symbols
|
| | | Why not? They make it look nice
|
| | | Why not? They make it look nice.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (when window-system
|
| | | (use-package pretty-mode
|
| | |
| | | (global-pretty-mode)))
|
| | | #+END_SRC
|
| | |
|
| | | ** find file other window
|
| | | ** COMMENT Find file other window
|
| | | Lets it accept more than one file. Works recursively.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (defadvice find-file-other-window (around find-files activate)
|
| | |
| | | #+END_SRC
|
| | |
|
| | | ** Which key
|
| | | Helps to explain keybindings if you get lost
|
| | | Helps to explain keybindings if you get lost.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package which-key
|
| | | :ensure t
|
| | |
| | | #+END_SRC
|
| | |
|
| | | ** Smartparens
|
| | | Matches brackets automatically
|
| | | Matches brackets automatically. Added "$" for latex in org mode.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package smartparens
|
| | | :ensure t
|
| | |
| | | :config
|
| | | (progn
|
| | | (require 'smartparens-config)
|
| | | (smartparens-global-mode 1)))
|
| | | (smartparens-global-mode 1))
|
| | | (sp-with-modes 'org-mode
|
| | | (sp-local-pair "$" "$")))
|
| | | #+END_SRC
|
| | |
|
| | | ** Rainbow
|
| | | Its a little gimmicky but its still cool
|
| | | ** COMMENT Rainbow
|
| | | Its a little gimmicky but its still cool.
|
| | | Colours according to code after a "#", works with 3 and 6 character hex codes.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package rainbow-mode
|
| | | :ensure t
|
| | |
| | | (add-hook 'prog-mode-hook #'rainbow-delimiters-mode))
|
| | | #+END_SRC
|
| | |
|
| | | ** clean-aindent-mode
|
| | | ** Following whitespace
|
| | | Removes unnecessary white space
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package clean-aindent-mode
|
| | |
| | | (add-hook 'prog-mode-hook (lambda () (interactive) (setq show-trailing-whitespace 1)))
|
| | | #+END_SRC
|
| | |
|
| | | ** whitespace mode
|
| | | ** Whitespace mode
|
| | | Reveals whitespace characters
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (global-set-key (kbd "C-c w") 'whitespace-mode)
|
| | |
| | | #+END_SRC
|
| | |
|
| | | ** eldoc
|
| | | Shows function arguments in echo area below mode line.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (diminish eldoc-mode)
|
| | | (add-hook 'emacs-lisp-mode-hook 'eldoc-mode)
|
| | | (add-hook 'lisp-interaction-mode-hook 'eldoc-mode)
|
| | | (add-hook 'ielm-mode-hook 'eldoc-mode)
|
| | | #+END_SRC
|
| | |
|
| | | ** key-freq
|
| | | collects interesting statistics
|
| | | ** Key frequency statistics
|
| | | Collects interesting statistics about key presses.
|
| | | Use M-x keyfreq-show to show in emacs or M-x keyfreq-html to output
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package keyfreq
|
| | | :ensure t
|
| | |
| | | (keyfreq-autosave-mode 1))
|
| | | #+END_SRC
|
| | |
|
| | | ** undo-tree
|
| | | A more advanced undo mechanism
|
| | | ** Undo tree
|
| | | A more advanced undo mechanism.
|
| | | Supports branched undo history (thus the tree).
|
| | | Pretty neat, if seldom used.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package undo-tree
|
| | | :ensure t
|
| | |
| | | (global-undo-tree-mode))
|
| | | #+END_SRC
|
| | |
|
| | | ** volatile highlights
|
| | | ** Volatile highlights
|
| | | Colour the material just copied
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package volatile-highlights
|
| | |
| | | #+END_SRC
|
| | |
|
| | | ** ibuffer
|
| | | View all open buffers in their own buffer rather in the temporary mini buffer.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (global-set-key (kbd "C-x C-b") 'ibuffer)
|
| | | (setq ibuffer-use-other-window t)
|
| | | #+END_SRC
|
| | |
|
| | | ** hippie expand
|
| | | ** Hippie expand
|
| | | Seems cool, but I don't think I ever use this.
|
| | | Meant to suggest completions to beginning of a word.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (global-set-key (kbd "M-/") 'hippie-expand) ;; replace dabbrev-expand
|
| | | (setq
|
| | |
| | | #+END_SRC
|
| | |
|
| | | ** Highlight line
|
| | | Very useful for finding where you are.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (global-hl-line-mode)
|
| | | #+END_SRC
|
| | |
|
| | | ** Line numbers
|
| | | Everyone needs line numbers when programming.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (add-hook 'prog-mode-hook 'linum-mode)
|
| | | #+END_SRC
|
| | |
|
| | | ** Garbage collection
|
| | | starts garbage collection every 100MB
|
| | | Starts garbage collection every 100MB.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (setq gc-cons-threshold 100000000)
|
| | | #+END_SRC
|
| | |
| | | #+END_SRC
|
| | |
|
| | | ** Coding style
|
| | | Use java for java, awk for awk and K&R for everything else.
|
| | | K&R uses 4 space tabs.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (setq c-default-style '((java-mode . "java")
|
| | | (awk-mode . "awk")
|
| | |
| | | #+END_SRC
|
| | |
|
| | | ** Coding system
|
| | | Cause we all love UTF8
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (set-terminal-coding-system 'utf-8)
|
| | | (set-keyboard-coding-system 'utf-8)
|
| | |
| | |
|
| | | ** Move to beginning of line ignoring whitespace
|
| | | Move point back to indentation of beginning of line.
|
| | | Pretty good for getting to the start of what you actually wanted.
|
| | |
|
| | | Move point to the first non-whitespace character on this line.
|
| | | If point is already there, move to the beginning of the line.
|
| | |
| | | #+END_SRC
|
| | |
|
| | | ** Indent region or buffer
|
| | | Indent, slightly different to standard tab or C-M-\.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (defun indent-region-or-buffer ()
|
| | | "Indent a region if selected, otherwise the whole buffer."
|
| | |
| | | #+END_SRC
|
| | |
|
| | | ** Tramp
|
| | | Remote editing mode.
|
| | | Hate having to re-input passwords.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (when (eq system-type 'windows-nt)
|
| | | (setq tramp-default-method "pscp"))
|
| | | (setq password-cache-expiry nil)
|
| | | #+END_SRC
|
| | |
|
| | | ** COMMENT Y or N instead of yes or no
|
| | | Need not type out whole word.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (defalias 'yes-or-no-p 'y-or-n-p)
|
| | | #+END_SRC
|
| | |
|
| | | * Mode line tweaks
|
| | | Diminish is used but is included in init.el such that it can be used throughout this document
|
| | | ** Spaceline
|
| | | A little easier to read than the default emacs mode line
|
| | | A little easier to read than the default emacs mode line.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package spaceline
|
| | | :ensure t
|
| | |
| | | (spaceline-helm-mode))
|
| | | #+END_SRC
|
| | |
|
| | | ** No separator
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (setq powerline-default-seperator nil)
|
| | | #+END_SRC
|
| | |
|
| | | * Programming tweaks
|
| | | ** Yasnippet
|
| | | Add snippets, pretty useful.
|
| | | Manually added snippets are in ~/.emacs.d/snippets/{mode}.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package yasnippet
|
| | | :ensure t
|
| | |
| | | (yas-global-mode 1))
|
| | | #+END_SRC
|
| | |
|
| | | ** flycheck
|
| | | ** Flycheck
|
| | | Basic linter. Works pretty well.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package flycheck
|
| | | :ensure t
|
| | |
| | | :config
|
| | | (global-flycheck-mode))
|
| | | #+END_SRC
|
| | | *** flycheck-pos-tipe
|
| | | *** flycheck-pos-tip
|
| | | Add suggestions at the cursor.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package flycheck-pos-tip
|
| | | :ensure t
|
| | |
| | | #+END_SRC
|
| | |
|
| | | ** Company
|
| | | Company is auto-complete for Emacs
|
| | | Company is auto-complete for Emacs.
|
| | | Uses various backends, more of which are added later.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package company
|
| | | :ensure t
|
| | |
| | | #+END_SRC
|
| | |
|
| | | ** Magit
|
| | | Emacs git client.
|
| | | Pretty good and offers fairly decent features.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package magit
|
| | | :ensure t
|
| | |
| | | #+END_SRC
|
| | |
|
| | | ** CEDET
|
| | | *** semantic
|
| | | *** Semantic
|
| | | Parser library for code, supports many other packages.
|
| | | Allows emacs to be mode aware of what is being written.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package semantic
|
| | | :config
|
| | |
| | | #+END_SRC
|
| | |
|
| | | *** EDE
|
| | | Emacs Development Environment.
|
| | | Can be used to manage and create build files for a project.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package ede
|
| | | :config
|
| | |
| | | #+END_SRC
|
| | |
|
| | | *** gdb-many-windows
|
| | | Enhances the use of GDB in emacs.
|
| | | Shows register contents, variable contents and others in addition to GDB shell.
|
| | | Also shows source code while debugging.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (setq
|
| | | ;; use gdb-many-windows by default
|
| | | gdb-many-windows t
|
| | |
|
| | | ;; Non-nil means display source file containing the main routine at startup
|
| | | gdb-show-main t)
|
| | | #+END_SRC
|
| | |
|
| | | *** Semantic refactor
|
| | | *** COMMENT Semantic refactor
|
| | | Trying to get this to work.
|
| | | Should help to refactor file.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package srefactor
|
| | | :ensure t
|
| | |
| | |
|
| | | ** Language specific configs
|
| | | *** C/C++
|
| | | **** yasnippet
|
| | | **** COMMENT yasnippet
|
| | | Enable yasnippet for C/C++.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (add-hook 'c++-mode-hook 'yas-minor-mode)
|
| | | (add-hook 'c-mode-hook 'yas-minor-mode)
|
| | | #+END_SRC
|
| | |
|
| | | **** flycheck clang
|
| | | **** Flycheck clang
|
| | | Add the clang backend for linting.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package flycheck-clang-analyzer
|
| | | :ensure t
|
| | |
| | | (flycheck-clang-analyzer-setup)))
|
| | | #+END_SRC
|
| | |
|
| | | **** company
|
| | | **** Company
|
| | | Add header completion as well as Irony, which uses clang for suggestions.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package company-c-headers
|
| | | :ensure t
|
| | |
| | | :config
|
| | | (add-hook 'c++-mode-hook 'company-mode)
|
| | | (add-hook 'c-mode-hook 'company-mode))
|
| | |
|
| | | (use-package company-irony
|
| | | :ensure t
|
| | | :config
|
| | | (add-to-list 'company-backends '(company-c-headers
|
| | | company-dabbrev-code
|
| | | company-irony)))
|
| | |
|
| | | (use-package irony
|
| | | :ensure t
|
| | |
| | | (add-hook 'c-mode-hook 'irony-mode)
|
| | | (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)
|
| | | (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options))
|
| | |
|
| | | (use-package company-irony
|
| | | :ensure t
|
| | | :config
|
| | | (add-to-list 'company-backends '(company-c-headers
|
| | | company-dabbrev-code
|
| | | company-irony)))
|
| | | #+END_SRC
|
| | |
|
| | | *** emacs-lisp
|
| | | **** eldoc
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (add-hook 'emacs-lisp-mode-hook 'eldoc-mode)
|
| | | #+END_SRC
|
| | |
|
| | | **** yasnippet
|
| | | **** COMMENT yasnippet
|
| | | Enable yasnippet.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (add-hook 'emacs-lisp-mode-hook 'yas-minor-mode)
|
| | | #+END_SRC
|
| | |
|
| | | **** company
|
| | | **** COMMENT company
|
| | | Add slime backend.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (add-hook 'emacs-lisp-mode-hook 'company-mode)
|
| | |
|
| | |
| | |
|
| | | *** COMMENT x86
|
| | | **** x86-lookup
|
| | | Look up reference PDF. Use Intel manual.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package x86-lookup
|
| | | :ensure t
|
| | |
| | |
|
| | | *** Latex
|
| | | **** AucTex
|
| | | AucTex contains many additions to make tex editing good.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package tex
|
| | | :ensure auctex
|
| | |
| | | #+END_SRC
|
| | |
|
| | | **** Company
|
| | | Help company complete tex math and references.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package company-math
|
| | | :ensure t
|
| | |
| | | #+END_SRC
|
| | |
|
| | | **** TeXcount
|
| | | Word counts in latex
|
| | | Word counts in latex.
|
| | | Uses a Perl script.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (defun get-texcount-latest()
|
| | | (if (not(file-directory-p "~/.texcount"))
|
| | |
| | | #+END_SRC
|
| | |
|
| | | *** PlantUML
|
| | | Sets the PlantUML path for the mode to generate models.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package plantuml-mode
|
| | | :ensure t
|
| | |
| | |
|
| | | *** COMMENT Racket
|
| | | **** Major mode
|
| | | Set racket path in windows and enable racket mode.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (when (eq system-type 'windows-nt)
|
| | | (add-to-list 'exec-path "c:/Program Files/Racket")
|
| | |
| | | (setq matlab-indent-function t))
|
| | | #+END_SRC
|
| | |
|
| | | *** Verilog
|
| | | *** COMMENT Verilog
|
| | | **** Get latest version
|
| | | Pull the latest version from the web
|
| | | Pull the latest version from the web.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (defun get-verilog-latest()
|
| | | (if (not(file-directory-p "~/.emacs.d/elpa/verilog-mode"))
|
| | |
| | | #+END_SRC
|
| | |
|
| | | **** Integrate into emacs
|
| | | Add updated version and integrate it with Emacs.
|
| | | Add updated version (based off auto-package-update) and integrate it with Emacs.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (defun verilog-read-file-as-string (file)
|
| | | "Read FILE contents."
|
| | |
| | | (add-to-list 'auto-mode-alist '("\\.[ds]?vh?\\'" . verilog-mode)))
|
| | | #+END_SRC
|
| | |
|
| | | *** MATLAB
|
| | | *** COMMENT MATLAB
|
| | | Mode for editing MATLAB m-files.
|
| | | Have to manually install matlab-mode
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package matlab
|
| | | :ensure matlab-mode
|
| | | :config
|
| | | (autoload 'matlab-mode "matlab" "Matlab Editing Mode" t)
|
| | | (add-to-list
|
| | | 'auto-mode-alist
|
| | | '("\\.m$" . matlab-mode))
|
| | | (setq matlab-indent-function t)
|
| | | (setq matlab-shell-command "matlab")
|
| | | (matlab-cedet-setup)
|
| | | (matlab-cedet-setup))
|
| | | #+END_SRC
|
| | |
|
| | | *** MIPS
|
| | | *** COMMENT MIPS
|
| | | For editing MIPS assembly.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package mips-mode
|
| | | :ensure t
|
| | | :mode "\\.mips$")
|
| | | #+END_SRC
|
| | |
|
| | | *** IPython notebooks
|
| | | *** COMMENT IPython notebooks
|
| | | Allow emacs to view and use IPython notebooks
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package ein
|
| | |
| | |
|
| | | * Org mode
|
| | | ** Up to date org
|
| | | Pull the latest org mode from the repository, rather than the org which comes with emacs.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package org
|
| | | :ensure t
|
| | | :ensure org-plus-contrib
|
| | | :pin org)
|
| | | #+END_SRC
|
| | |
|
| | | ** Small tweaks
|
| | | Small quality of life changes to org-mode.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (setq org-src-fontify-natively t)
|
| | | (setq org-src-tab-acts-natively t)
|
| | |
| | | #+END_SRC
|
| | |
|
| | | ** Line wrapping
|
| | | Enable line wrapping for long lines.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (add-hook 'org-mode-hook
|
| | | '(lambda ()
|
| | |
| | | #+END_SRC
|
| | |
|
| | | ** org-bullets
|
| | | Use bullets of different colours and styles instead of the "\*\*\*" to denote indentation levels.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package org-bullets
|
| | | :ensure t
|
| | |
| | | #+END_SRC
|
| | |
|
| | | ** Org Babel
|
| | | Allows the execution of code from within an org buffer.
|
| | | Code output can also be input to the buffer.
|
| | | *** Languages
|
| | | Add C to org babel supported languages
|
| | | Add a bunch of languages to org babel supported languages
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (org-babel-do-load-languages 'org-babel-load-languages '((emacs-lisp . t)
|
| | | (C . t)
|
| | |
| | | (plantuml . t)))
|
| | | #+END_SRC
|
| | |
|
| | | **** Plantuml path
|
| | | **** PlantUML path
|
| | | Org uses its own path for some reason.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (setq org-plantuml-jar-path plantuml-jar-path)
|
| | | #+END_SRC
|
| | |
|
| | | ** Latex preview fragments match colour
|
| | | Make the previews match theme colour of Emacs.
|
| | | Gets very annoying very quickly without it.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (let ((dvipng--plist (alist-get 'dvipng org-preview-latex-process-alist)))
|
| | | (plist-put dvipng--plist :use-xcolor t)
|
| | | (plist-put dvipng--plist :image-converter '("dvipng -D %D -T tight -o %O %f")))
|
| | | #+END_SRC
|
| | |
|
| | | * EMMS
|
| | | ** Org export additions
|
| | | *** Pandoc
|
| | | Call pandoc on org buffer from org export.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package ox-pandoc
|
| | | :ensure t)
|
| | | #+END_SRC
|
| | |
|
| | | *** COMMENT Dokuwiki Wiki
|
| | | Allow export to dokuwiki markup from org.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package ox-wk
|
| | | :ensure t)
|
| | | #+END_SRC
|
| | |
|
| | | * COMMENT EMMS
|
| | | Emacs media manager.
|
| | | I come back to it every now and again as an MPD front-end, but haven't quite gotten the hang of it.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package emms-setup
|
| | | :ensure emms
|
| | |
| | | #+END_SRC
|
| | |
|
| | | * Org Blog
|
| | | I use org to write my blog and use org-static-blog to generate the HTML.
|
| | | ** Org static blog config
|
| | | Boiler plate template code for site.
|
| | | Basic configuration for site.
|
| | | Copied and modified from the example configuration.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package org-static-blog
|
| | | :ensure t
|
| | |
| | | <a href=\"https://blog.joelg.cf/archive.html\">Other posts</a>
|
| | | </div>
|
| | | <br>
|
| | | <div id=\"commento\"></div>
|
| | | <script src=\"https://cdn.commento.io/js/commento.js\"></script>")
|
| | | <script data-isso=\"//commento.joelg.cf/\"
|
| | | src=\"//commento.joelg.cf/js/embed.min.js\"></script>
|
| | | <section id=\"isso-thread\"></section>")
|
| | | ;; <center><button id=\"disqus_button\" onclick=\"load_disqus()\">Load Disqus Comments</button></center>
|
| | | ;; <div id=\"disqus_thread\"></div>
|
| | | ;; <script type=\"text/javascript\">
|
| | |
| | | ;; document.getElementById('disqus_button').style.visibility = 'hidden';
|
| | | ;; };
|
| | | ;; </script>")
|
| | | )
|
| | | #+END_SRC
|
| | |
|
| | | ;; generate blog files and create sitemap for files
|
| | | ** Sitemap addition
|
| | | Creates a sitemap.xml for the blog based on the generated HTML files output in the final directory.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (defun blog-publish()
|
| | | (interactive)
|
| | | (org-static-blog-publish)
|
| | |
| | | (with-current-buffer "sitemap.xml.gen" (insert "</urlset>"))
|
| | | (with-current-buffer "sitemap.xml.gen" (write-region (point-min) (point-max) (concat org-static-blog-publish-directory "sitemap.xml")) t)
|
| | | (kill-buffer "sitemap.xml.gen"))
|
| | | )
|
| | | #+END_SRC
|
| | |
|
| | | ** Emacs-htmlize
|
| | | Allow org features to be exported to HTML for site
|
| | | Allow org features to be exported to HTML for site.
|
| | | #+BEGIN_SRC emacs-lisp
|
| | | (use-package htmlize
|
| | | :ensure t)
|
| | | #+END_SRC
|
| | |
|