aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2020-08-19 17:22:20 +0100
committerYann Herklotz <git@yannherklotz.com>2020-08-19 17:22:20 +0100
commitb1673e899ec30f25b71cdc9d1ffd6c8246634191 (patch)
tree230fa6c7da9cfd47e2bdc9dad03ceaa6529e7f17
parent31d4d690b69b844f319fd0dcb15cb0e0f6511217 (diff)
parent2c6a2e578286509eed8c76487e43dbb9a7bf83ea (diff)
downloaddotfiles-b1673e899ec30f25b71cdc9d1ffd6c8246634191.tar.gz
dotfiles-b1673e899ec30f25b71cdc9d1ffd6c8246634191.zip
Merge branch 'master' of github.com:ymherklotz/dotfiles into master
-rw-r--r--doom/config.el252
-rw-r--r--doom/init.el43
-rw-r--r--doom/packages.el24
-rw-r--r--emacs/loader.org225
-rwxr-xr-xinstall.sh2
-rw-r--r--isync/.mbsyncrc6
-rw-r--r--macos/skhd/skhdrc189
-rwxr-xr-xmacos/yabai/yabairc17
-rw-r--r--zsh/.zsh/export.zsh63
-rw-r--r--zsh/.zsh/function.zsh8
-rw-r--r--zsh/.zsh/startup.zsh5
-rw-r--r--zsh/.zshrc24
12 files changed, 556 insertions, 302 deletions
diff --git a/doom/config.el b/doom/config.el
index b5ddb93..8f66eca 100644
--- a/doom/config.el
+++ b/doom/config.el
@@ -1,9 +1,5 @@
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
-;; Place your private configuration here! Remember, you do not need to run 'doom
-;; sync' after modifying this file!
-
-
;; Some functionality uses this to identify you, e.g. GPG configuration, email
;; clients, file templates and snippets.
(setq user-full-name "Yann Herklotz"
@@ -20,13 +16,13 @@
;; They all accept either a font-spec, font string ("Input Mono-12"), or xlfd
;; font string. You generally only need these two:
(setq doom-font (font-spec :family "Iosevka" :size 16)
- doom-variable-pitch-font (font-spec :family "Libre Baskerville")
- doom-serif-font (font-spec :family "Libre Baskerville"))
+ doom-variable-pitch-font (font-spec :family "Libre Baskerville" :size 12)
+ doom-serif-font (font-spec :family "Libre Baskerville" :size 12))
;; There are two ways to load a theme. Both assume the theme is installed and
;; available. You can either set `doom-theme' or manually load a theme with the
;; `load-theme' function. This is the default:
-(setq doom-theme 'sanityinc-tomorrow-night)
+(setq doom-theme 'modus-operandi)
;; If you use `org' and don't want your org files in the default location below,
;; change `org-directory'. It must be set before org loads!
@@ -49,7 +45,8 @@
(global-set-key (kbd "C-,") #'(lambda () (interactive) (other-window -1)))
(global-set-key (kbd "C-c l") #'org-store-link)
(global-set-key (kbd "C-c a") #'org-agenda)
-(global-set-key (kbd "C-c c") #'org-capture)
+(global-set-key (kbd "C-c /") #'avy-goto-word-1)
+(global-set-key (kbd "M-=") #'count-words)
;; Set undo-only correctly
(global-set-key (kbd "C-\\") 'undo-only)
@@ -76,19 +73,6 @@
(global-set-key (kbd "C-`") #'push-mark-no-activate)
(global-set-key (kbd "M-`") #'jump-to-mark)
-;; Delete an emacs client frame.
-(defun y/exit-emacs-client ()
- "consistent exit emacsclient. If not in emacs client, echo a
- message in minibuffer, don't exit emacs. If in server mode and
- editing file, do C-x # server-edit else do C-x 5 0
- delete-frame"
- (interactive)
- (if server-buffer-clients
- (server-edit)
- (delete-frame)))
-
-(global-set-key (kbd "C-c q") #'y/exit-emacs-client)
-
;; Swap two window positions.
(defun y/swap-windows ()
"Swaps two windows and leaves the cursor in the original one"
@@ -106,6 +90,16 @@
(define-key y-map (kbd "g") 'password-store-generate)
(define-key y-map (kbd "r") 'toggle-rot13-mode)
+(electric-indent-mode -1)
+
+;; Mac configuration
+(when (eq system-type 'darwin)
+ (setq mac-right-option-modifier 'none
+ mac-option-key-is-meta nil
+ mac-command-key-is-meta t
+ mac-command-modifier 'meta
+ mac-option-modifier nil))
+
(defun y/insert-date ()
"Insert a timestamp according to locale's date and time format."
(interactive)
@@ -114,15 +108,46 @@
(define-key y-map (kbd "d") 'y/insert-date)
;; Set backup directories into the tmp folder
-(setq backup-directory-alist
- `((".*" . ,temporary-file-directory)))
-(setq auto-save-file-name-transforms
- `((".*" ,temporary-file-directory t)))
+(defvar --backup-directory (concat user-emacs-directory "backups"))
+(if (not (file-exists-p --backup-directory))
+ (make-directory --backup-directory t))
+(setq backup-directory-alist `(("." . ,--backup-directory)))
+(setq make-backup-files t ; backup of a file the first time it is saved.
+ backup-by-copying t ; don't clobber symlinks
+ version-control t ; version numbers for backup files
+ delete-old-versions t ; delete excess backup files silently
+ delete-by-moving-to-trash t
+ kept-old-versions 6 ; oldest versions to keep when a new numbered backup is made (default: 2)
+ kept-new-versions 9 ; newest versions to keep when a new numbered backup is made (default: 2)
+ auto-save-default t ; auto-save every buffer that visits a file
+ auto-save-timeout 20 ; number of seconds idle time before auto-save (default: 30)
+ auto-save-interval 200 ; number of keystrokes between auto-saves (default: 300)
+ )
+
+;; Set sensitive data mode
+(setq auto-mode-alist
+ (append
+ (list '("\\.\\(vcf\\|gpg\\)\\'" . sensitive-minor-mode)
+ '("\\.sv\\'" . verilog-mode))
+ auto-mode-alist))
+
+;; Remove the ring for emacs
+(setq ring-bell-function 'ignore)
;; Automatically refresh files
(global-auto-revert-mode 1)
(setq auto-revert-verbose nil)
+;; Set sentence to end with double space
+(setq sentence-end-double-space t)
+
+;; Remove automatic `auto-fill-mode', and replace it by `visual-line-mode',
+;; which is a personal preference.
+(setq-default fill-column 100)
+(remove-hook 'text-mode-hook #'auto-fill-mode)
+(add-hook 'text-mode-hook #'+word-wrap-mode)
+(add-hook 'text-mode-hook #'visual-fill-column-mode)
+
;; Set up magit when C-c g is called
(use-package! magit
:bind (("C-x g" . magit-status)))
@@ -140,7 +165,7 @@
:config (global-hungry-delete-mode))
;; Org configuration
-(use-package org
+(use-package! org
:mode ("\\.org\\'" . org-mode)
:init
(map! :map org-mode-map
@@ -150,6 +175,9 @@
org-return-follows-link t
org-confirm-babel-evaluate nil
org-use-speed-commands t
+ org-hide-emphasis-markers t
+ org-adapt-indentation nil
+ org-cycle-separator-lines 1
org-structure-template-alist '(("a" . "export ascii")
("c" . "center")
("C" . "comment")
@@ -162,36 +190,75 @@
("v" . "verse")
("el" . "src emacs-lisp")
("d" . "definition")
- ("t" . "theorem"))))
+ ("t" . "theorem")))
+ (customize-set-variable 'org-blank-before-new-entry
+ '((heading . nil)
+ (plain-list-item . nil))))
-(use-package! org-id
- :after org)
+(use-package! org-contacts
+ :after org
+ :init
+ (setq org-contacts-files '("~/Dropbox/org/contacts.org")))
;; Disable org indent mode and remove C-, from the org-mode-map.
(after! org
- (setq org-startup-indented nil)
- (define-key org-mode-map (kbd "C-,") nil))
-
-;; Set agenda files, refile targets and todo keywords.
-(setq org-agenda-files (mapcar 'expand-file-name
- (list "~/Dropbox/org/inbox.org"
- "~/Dropbox/org/main.org"
- "~/Dropbox/org/tickler.org"
- (format-time-string "~/Dropbox/org/journals/%Y-%m.org")))
- org-refile-targets `(("~/Dropbox/org/main.org" :maxlevel . 2)
- ("~/Dropbox/org/someday.org" :level . 1)
- ("~/Dropbox/org/tickler.org" :maxlevel . 2)
- (,(format-time-string "~/Dropbox/org/journals/%Y-%m.org") :maxlevel . 2))
- org-todo-keywords '((sequence "TODO(t)" "WAITING(w)" "|" "DONE(d)" "CANCELLED(c)")))
-
-;; Set custom agenda commands which can be activated in the agenda viewer.
-(setq org-agenda-custom-commands
+ (define-key org-mode-map (kbd "C-,") nil)
+ ;; Set agenda files, refile targets and todo keywords.
+ (setq org-startup-indented nil
+ org-agenda-files (mapcar 'expand-file-name
+ (list "~/Dropbox/org/inbox.org"
+ "~/Dropbox/org/main.org"
+ "~/Dropbox/org/tickler.org"
+ "~/Dropbox/org/projects.org"
+ "~/Dropbox/org/pldi2020.org"
+ (format-time-string "~/Dropbox/org/journals/%Y-%m.org")))
+ org-refile-targets `(("~/Dropbox/org/main.org" :maxlevel . 2)
+ ("~/Dropbox/org/someday.org" :level . 1)
+ ("~/Dropbox/org/tickler.org" :maxlevel . 2)
+ ("~/Dropbox/org/projects.org" :level . 1)
+ (,(format-time-string "~/Dropbox/org/journals/%Y-%m.org") :maxlevel . 2))
+ ;; Set custom agenda commands which can be activated in the agenda viewer.
+ org-agenda-custom-commands
'(("w" "At work" tags-todo "@work"
((org-agenda-overriding-header "Work")))
("h" "At home" tags-todo "@home"
((org-agenda-overriding-header "Home")))
("u" "At uni" tags-todo "@uni"
- ((org-agenda-overriding-header "University")))))
+ ((org-agenda-overriding-header "University"))))
+ org-log-done 'time
+ org-capture-templates
+ `(("t" "Todo" entry (file+headline ,(format-time-string "~/Dropbox/org/journals/%Y-%m.org") "Today")
+ "* TODO %^{Title}\nCreated: %U\n\n%?\n")
+ ("c" "Contacts" entry (file "~/Dropbox/org/contacts.org")
+ "* %(org-contacts-template-name)
+ :PROPERTIES:
+ :EMAIL: %(org-contacts-template-email)
+ :END:"))))
+
+;; Set up org ref for PDFs
+(use-package! org-ref
+ :after org
+ :bind (("C-c r" . org-ref-cite-hydra/body)
+ ("C-c b" . org-ref-bibtex-hydra/body))
+ :config
+ (setq org-ref-bibliography-notes "~/Dropbox/bibliography/notes.org"
+ org-ref-default-bibliography '("~/Dropbox/bibliography/references.bib")
+ org-ref-pdf-directory "~/Dropbox/bibliography/papers/")
+ (setq org-ref-completion-library 'org-ref-ivy-cite))
+
+;; Set up org-noter
+(use-package! org-noter
+ :after org
+ :commands org-noter
+ :config (setq org-noter-default-notes-file-names '("notes.org")
+ org-noter-notes-search-path '("~/org/bibliography")
+ org-noter-separate-notes-from-heading t))
+
+(use-package! org-superstar
+ :hook (org-mode . org-superstar-mode)
+ :config
+ (setq org-superstar-headline-bullets-list '("♠" "♣" "♥" "♦")
+ org-superstar-special-todo-items t))
;; Set up org registers to quickly jump to files that I use often.
(set-register ?l (cons 'file "~/.emacs.d/loader.org"))
@@ -199,18 +266,84 @@
(set-register ?i (cons 'file "~/Dropbox/org/inbox.org"))
(set-register ?c (cons 'file (format-time-string "~/Dropbox/org/journals/%Y-%m.org")))
+;; Bibtex stuff
+(use-package! ebib
+ :bind (("C-c y b" . ebib))
+ :init
+ (setq ebib-preload-bib-files '("~/Dropbox/bibliography/references.bib")
+ ebib-notes-directory "~/Dropbox/bibliography/notes/")
+ (add-to-list 'ebib-file-search-dirs "~/Dropbox/bibliography/papers")
+ (add-to-list 'ebib-file-associations '("pdf" . "open"))
+ (advice-add 'bibtex-generate-autokey :around
+ #'(lambda (orig-func &rest args)
+ (replace-regexp-in-string ":" "" (apply orig-func args)))))
+
;; Set up dictionaries
(setq ispell-dictionary "en_GB")
(use-package! flyspell
+ :hook (text-mode . flyspell-mode)
:config
(define-key flyspell-mode-map (kbd "C-.") nil)
(define-key flyspell-mode-map (kbd "C-,") nil))
;; Set up zettelkasten mode
(use-package! zettelkasten
+ :bind-keymap
+ ("C-c k" . zettelkasten-mode-map))
+
+;; Proof general configuration
+(setq proof-splash-enable nil
+ proof-auto-action-when-deactivating-scripting 'retract
+ proof-delete-empty-windows nil
+ proof-auto-raise-buffers t
+ coq-compile-before-require t)
+
+(setq coq-may-use-prettify nil
+ company-coq-prettify-symbols nil)
+(global-prettify-symbols-mode -1)
+
+(use-package smartparens
+ :bind (("M-[" . sp-backward-unwrap-sexp)
+ ("M-]" . sp-unwrap-sexp)
+ ("C-M-f" . sp-forward-sexp)
+ ("C-M-b" . sp-backward-sexp)
+ ("C-M-d" . sp-down-sexp)
+ ("C-M-a" . sp-backward-down-sexp)
+ ("C-M-e" . sp-up-sexp)
+ ("C-M-u" . sp-backward-up-sexp)
+ ("C-M-t" . sp-transpose-sexp)
+ ("C-M-n" . sp-next-sexp)
+ ("C-M-p" . sp-previous-sexp)
+ ("C-M-k" . sp-kill-sexp)
+ ("C-M-w" . sp-copy-sexp)
+ ("C-)" . sp-forward-slurp-sexp)
+ ("C-}" . sp-forward-barf-sexp)
+ ("C-(" . sp-backward-slurp-sexp)
+ ("C-{" . sp-backward-barf-sexp)
+ ("M-D" . sp-splice-sexp)
+ ("C-]" . sp-select-next-thing-exchange)
+ ("C-<left_bracket>" . sp-select-previous-thing)
+ ("C-M-]" . sp-select-next-thing)
+ ("M-F" . sp-forward-symbol)
+ ("M-B" . sp-backward-symbol)
+ ("M-r" . sp-split-sexp))
:config
- (zettelkasten-mode t))
+ (require 'smartparens-config)
+ (show-smartparens-global-mode +1)
+ (smartparens-global-mode 1))
+
+(use-package! ormolu
+ :hook (haskell-mode . ormolu-format-on-save-mode)
+ :bind
+ (:map haskell-mode-map
+ ("C-c r" . ormolu-format-buffer)))
+
+(after! writeroom-mode (setq +zen-text-scale 1))
+
+(setq pdf-view-use-scaling t)
+
+(setq doc-view-resolution 300)
;; Here are some additional functions/macros that could help you configure Doom:
;;
@@ -228,3 +361,26 @@
;;
;; You can also try 'gd' (or 'C-c g d') to jump to their definition and see how
;; they are implemented.
+(custom-set-variables
+ ;; custom-set-variables was added by Custom.
+ ;; If you edit it by hand, you could mess it up, so be careful.
+ ;; Your init file should contain only one such instance.
+ ;; If there is more than one, they won't work right.
+ '(org-blank-before-new-entry (quote ((heading) (plain-list-item))))
+ '(package-selected-packages (quote (org-plus-contrib)))
+ '(safe-local-variable-values
+ (quote
+ ((eval add-to-list
+ (quote auto-mode-alist)
+ (quote
+ ("\\.v\\'" . verilog-mode)))
+ (eval setq org-ref-pdf-directory
+ (concat
+ (projectile-project-root)
+ "papers/"))))))
+(custom-set-faces
+ ;; custom-set-faces was added by Custom.
+ ;; If you edit it by hand, you could mess it up, so be careful.
+ ;; Your init file should contain only one such instance.
+ ;; If there is more than one, they won't work right.
+ )
diff --git a/doom/init.el b/doom/init.el
index d257bc2..682520c 100644
--- a/doom/init.el
+++ b/doom/init.el
@@ -32,11 +32,11 @@
;;fill-column ; a `fill-column' indicator
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
hydra
- ;;indent-guides ; highlighted indent columns
+ ;;indent-guides ; highlighted in dent columns
modeline ; snazzy, Atom-inspired modeline, plus API
;;nav-flash ; blink the current line after jumping
;;neotree ; a project drawer, like NERDTree for vim
- ophints ; highlight the region an operation acts on
+ ;;ophints ; highlight the region an operation acts on
(popup +defaults) ; tame sudden yet inevitable temporary windows
;;pretty-code ; replace bits of code with pretty symbols
;;tabs ; an tab bar for Emacs
@@ -50,7 +50,7 @@
:editor
;;(evil +everywhere); come to the dark side, we have cookies
- file-templates ; auto-snippets for empty files
+ ;;file-templates ; auto-snippets for empty files
fold ; (nigh) universal code folding
;;(format +onsave) ; automated prettiness
;;god ; run Emacs commands without modifier keys
@@ -59,7 +59,7 @@
;;objed ; text object editing for the innocent
;;parinfer ; turn lisp into python, sort of
;;rotate-text ; cycle region at point between text candidates
- snippets ; my elves. They type so I don't have to
+ ;;snippets ; my elves. They type so I don't have to
word-wrap ; soft wrapping with language-aware indent
:emacs
@@ -69,28 +69,28 @@
vc ; version-control and Emacs, sitting in a tree
:term
- ;;eshell ; a consistent, cross-platform shell (WIP)
+ eshell ; a consistent, cross-platform shell (WIP)
;;shell ; a terminal REPL for Emacs
;;term ; terminals in Emacs
;;vterm ; another terminals in Emacs
:checkers
syntax ; tasing you for every semicolon you forget
- (spell +hunspell) ; tasing you for misspelling mispelling
- grammar ; tasing grammar mistake every you make
+ (spell +aspell) ; tasing you for misspelling mispelling
+ ;;grammar ; tasing grammar mistake every you make
:tools
;;ansible
;;debugger ; FIXME stepping through code, to help you add bugs
direnv
;;docker
- editorconfig ; let someone else argue about tabs vs spaces
+ editorconfig ; let someone else argue about tabs vs spaces
;;ein ; tame Jupyter notebooks with emacs
(eval +overlay) ; run code, run (also, repls)
;;gist ; interacting with github gists
- lookup ; navigate your code and its documentation
+ ;;lookup ; navigate your code and its documentation
;;lsp
- ;;macos ; MacOS-specific commands
+ macos ; MacOS-specific commands
magit ; a git porcelain for Emacs
;;make ; run make tasks from Emacs
pass ; password manager for nerds
@@ -104,23 +104,23 @@
:lang
;;agda ; types of types of types of types...
;;assembly ; assembly for fun or debugging
- cc ; C/C++/Obj-C madness
- clojure ; java with a lisp
+ cc ; C/C++/Obj-C madness
+ clojure ; java with a lisp
;;common-lisp ; if you've seen one lisp, you've seen them all
- ;;coq ; proofs-as-programs
+ coq ; proofs-as-programs
;;crystal ; ruby at the speed of c
;;csharp ; unity, .NET, and mono shenanigans
- data ; config/data formats
+ data ; config/data formats
;;elixir ; erlang done right
;;elm ; care for a cup of TEA?
- emacs-lisp ; drown in parentheses
+ emacs-lisp ; drown in parentheses
;;erlang ; an elegant language for a more civilized age
;;ess ; emacs speaks statistics
;;faust ; dsp, but you get to keep your soul
;;fsharp ; ML stands for Microsoft's Language
;;fstar ; (dependent) types and (monadic) effects and Z3
;;go ; the hipster dialect
- (haskell +dante) ; a language that's lazier than I am
+ haskell ; a language that's lazier than I am
;;hy ; readability of scheme w/ speed of python
;;idris ;
;;(java +meghanada) ; the poster child for carpal tunnel syndrome
@@ -137,12 +137,13 @@
nix ; I hereby declare "nix geht mehr!"
ocaml ; an objective camel
(org ; organize your plain life in plain text
- +dragndrop ; drag & drop files/images into org buffers
+ ;;+dragndrop ; drag & drop files/images into org buffers
;;+hugo ; use Emacs for hugo blogging
;;+jupyter ; ipython/jupyter support for babel
;;+pandoc ; export-with-pandoc support
;;+pomodoro ; be fruitful with the tomato technique
- +present) ; using org-mode for presentations
+ ;;+present ; using org-mode for presentations
+ )
;;perl ; write code no one else can comprehend
;;php ; perl's insecure younger brother
;;plantuml ; diagrams for confusing people more
@@ -153,7 +154,7 @@
;;rest ; Emacs as a REST client
;;rst ; ReST in peace
;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
- ;;rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
+ rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
;;scala ; java, but good
;;scheme ; a fully conniving family of lisps
sh ; she sells {ba,z,fi}sh shells on the C xor
@@ -163,8 +164,8 @@
;;web ; the tubes
:email
- (mu4e +gmail)
- ;;notmuch
+ ;;(mu4e +gmail)
+ notmuch
;;(wanderlust +gmail)
:app
diff --git a/doom/packages.el b/doom/packages.el
index 8891894..26532fb 100644
--- a/doom/packages.el
+++ b/doom/packages.el
@@ -50,7 +50,29 @@
;; our package manager can't deal with; see raxod502/straight.el#279)
;(package! builtin-package :recipe (:branch "develop"))
+;; Disabling packages
+(disable-packages! undo-tree org-bullets helm pretty-code company-coq)
+
+;; `org-mode' dependencies
+(package! org-ref)
+(package! org-noter)
+;; `org-bullets' replacement
+(package! org-superstar)
+
+;; Bibtex stuff
+(package! ebib)
+
+;; Haskell stuff
+(package! ormolu)
+
+;; Misc dependencies
(package! hungry-delete)
-(package! color-theme-sanityinc-tomorrow)
+(package! vagrant-tramp)
(package! zettelkasten
:recipe (:host github :repo "ymherklotz/emacs-zettelkasten"))
+(package! pinentry)
+
+;; Themes
+(package! color-theme-sanityinc-tomorrow)
+(package! modus-operandi-theme)
+(package! modus-vivendi-theme)
diff --git a/emacs/loader.org b/emacs/loader.org
index 5d300ee..b885599 100644
--- a/emacs/loader.org
+++ b/emacs/loader.org
@@ -25,9 +25,6 @@ for that can be found in the [[#Writing][Writing]] section.
(setq user-mail-address "yann@yannherklotz.com")
#+END_SRC
-#+RESULTS:
-: yann@yannherklotz.com
-
* Setup
Set path so that it picks up some executables that I use. This is done because
@@ -40,20 +37,15 @@ be manually set inside emacs.
"/home/ymherklotz/.local/bin" ":"
"/home/ymherklotz/.yarn/bin" ":"
"/usr/bin/vendor_perl" ":"
- "/home/ymherklotz/.opam/ocaml-base-compiler.4.09.0/bin" ":"
"/home/ymherklotz/.nix-profile/bin" ":"
(getenv "PATH")))
(setq exec-path (append
- '("/home/ymherklotz/.opam/ocaml-base-compiler.4.09.0/bin"
- "/home/ymherklotz/.local/bin"
+ '("/home/ymherklotz/.local/bin"
"/home/ymherklotz/.yarn/bin"
"/home/ymherklotz/.nix-profile/bin")
exec-path))
#+END_SRC
-#+RESULTS:
-| /home/ymherklotz/.opam/ocaml-base-compiler.4.09.0/bin | /home/ymherklotz/.local/bin | /home/ymherklotz/.yarn/bin | /home/ymherklotz/.nix-profile/bin | /home/ymherklotz/.opam/ocaml-base-compiler.4.09.0/bin | /home/ymherklotz/.local/bin | /home/ymherklotz/.yarn/bin | /home/ymherklotz/.nix-profile/bin | /home/yannherklotz/.opam/4.09.0/bin | /home/yannherklotz/.local/bin | /home/yannherklotz/.yarn/bin | /home/ymherklotz/.cargo/bin | /home/ymherklotz/.local/bin | /home/ymherklotz/.yarn/bin | /usr/bin | /home/ymherklotz/.gem/ruby/2.6.0/bin | /usr/local/bin | /usr/local/sbin | /usr/local/bin | /usr/bin | /usr/bin/site_perl | /usr/bin/vendor_perl | /usr/bin/core_perl | /opt/Xilinx/Vivado/2019.1/bin | /opt/intelFPGA_lite/18.1/quartus/bin | /usr/lib/emacs/26.3/x86_64-pc-linux-gnu |
-
Define a function to load a user file whenever I want to add configurations that
are not pushed as part of this configuration file. This includes a private file
containing email configurations for [[https://www.emacswiki.org/emacs/mu4e][mu4e]]. In this case, ~user-init-dir~ is used
@@ -97,9 +89,6 @@ Use ~use-package~ to manage other packages, and improve load times.
(setq use-package-always-ensure t)
#+END_SRC
-#+RESULTS:
-: t
-
** GC Threshold
Threshold for faster startup. This should increase the garbage collector's
@@ -107,12 +96,9 @@ threshold at which it will start cleaning, so that it is not triggered during
startup.
#+BEGIN_SRC emacs-lisp
- (setq gc-cons-threshold 500000000)
+ (setq gc-cons-threshold (* 1024 1024 1024))
#+END_SRC
-#+RESULTS:
-: 500000000
-
** General Configuration
*** Editor settings
@@ -123,24 +109,32 @@ yes or no. Also stop the start up message from popping up and enter the scratch
buffer instead.
#+BEGIN_SRC emacs-lisp
+ (setq warning-minimum-level :emergency)
(setq inhibit-startup-message t
- confirm-nonexistent-file-or-buffer nil)
+ confirm-nonexistent-file-or-buffer nil
+ default-directory "~/")
(setq-default fill-column 80)
(setq-default truncate-lines t)
(tool-bar-mode 0)
- (menu-bar-mode 0)
+ (unless (string= system-type "darwin")
+ (menu-bar-mode 0))
(fset 'yes-or-no-p 'y-or-n-p)
(global-hl-line-mode 1)
(add-to-list 'custom-theme-load-path "~/.emacs.d/themes/")
(add-to-list 'load-path "~/.emacs.d/modes/")
(setq ring-bell-function 'ignore)
+ (when (eq system-type 'darwin)
+ (setq dired-use-ls-dired nil))
#+END_SRC
-#+RESULTS:
-: t
-
#+BEGIN_SRC emacs-lisp
(global-unset-key (kbd "C-z"))
+ (when (eq system-type 'darwin)
+ (setq mac-right-option-modifier 'none
+ mac-option-key-is-meta nil
+ mac-command-key-is-meta t
+ mac-command-modifier 'meta
+ mac-option-modifier nil))
(global-set-key (kbd "M-u") #'upcase-dwim)
(global-set-key (kbd "M-l") #'downcase-dwim)
@@ -163,10 +157,6 @@ buffer instead.
(global-visual-line-mode t)
#+end_src
-#+begin_src emacs-lisp
- (global-visual-line-mode t)
-#+end_src
-
*** Custom modeline
Editing the modeline. ~%c~ might be a bit slow though, so that could be removed
@@ -232,9 +222,6 @@ if that is ever a problem.
(quote (" " mode-line-misc-info))))))
#+END_SRC
-#+RESULTS:
-| :eval | (simple-mode-line-render (quote ( mode-line-modified mode-line-buffer-identification %l:%c mode-line-modes )) (quote ((:propertize (:eval (when vc-mode (cond ((string-match Git[:-] vc-mode) (-custom-modeline-github-vc)) ((string-match SVN- vc-mode) (-custom-modeline-svn-vc)) (t (format %s vc-mode))))) face mode-line-vc))) (quote ( mode-line-misc-info))) |
-
Move the backup files into the temporaty directory so that they are out of the
way.
@@ -245,9 +232,6 @@ way.
`((".*" ,temporary-file-directory t)))
#+END_SRC
-#+RESULTS:
-| .* | /tmp/ | t |
-
Make emacs follow symlinks every time, this means that it will open the actual
file and go to where the file is actually stored instead of editing it through
the symlink. This enables the use of git and other version control when editing
@@ -256,17 +240,11 @@ the file.
(setq vc-follow-symlinks t)
#+END_SRC
-#+RESULTS:
-: t
-
This stops paren mode with interfering with the modeline.
#+BEGIN_SRC emacs-lisp
(show-paren-mode 'expression)
#+END_SRC
-#+RESULTS:
-: t
-
Revert the buffer automatically when a file changes on disc. This is useful when
monitoring a file such as a log file. It will also do this silently.
#+BEGIN_SRC emacs-lisp
@@ -274,8 +252,6 @@ monitoring a file such as a log file. It will also do this silently.
(setq auto-revert-verbose nil)
#+END_SRC
-#+RESULTS:
-
Disable tabs, I want to move towards only using spaces everywhere as that is my
preferred style. This is just personal preference though.
#+BEGIN_SRC emacs-lisp
@@ -287,25 +263,16 @@ preferred style. This is just personal preference though.
(setq-default python-indent 4)
#+END_SRC
-#+RESULTS:
-: 4
-
Set the line number display very high so that it is always shown in the modeline.
#+BEGIN_SRC emacs-lisp
(setq line-number-display-limit 2000000)
#+END_SRC
-#+RESULTS:
-: 2000000
-
Set the undo correctly
#+BEGIN_SRC emacs-lisp
(define-key global-map (kbd "C-\\") 'undo-only)
#+END_SRC
-#+RESULTS:
-: undo-only
-
Setting up my keybindings
#+BEGIN_SRC emacs-lisp
@@ -348,9 +315,6 @@ Setting up my keybindings
(define-key y-map (kbd "r") 'toggle-rot13-mode)
#+END_SRC
-#+RESULTS:
-: password-store-generate
-
Set the font to Hack, which is an opensource monospace font designed for
programming and looking at source code.
@@ -360,13 +324,14 @@ programming and looking at source code.
#+END_SRC
#+BEGIN_SRC emacs-lisp
- (set-default-font "Iosevka Medium-12")
- (setq default-frame-alist '((font . "Iosevka Medium-12")))
+ (if (string= system-type "darwin")
+ (set-face-attribute 'default nil
+ :family "Iosevka" :height 145 :weight 'normal)
+ (progn
+ (set-default-font "Iosevka Medium-16")
+ (setq default-frame-alist '((font . "Iosevka Medium-16")))))
#+END_SRC
-#+RESULTS:
-: ((font . Iosevka Medium-14))
-
#+BEGIN_SRC emacs-lisp
(use-package eshell
:ensure nil
@@ -402,9 +367,6 @@ programming and looking at source code.
(eshell-send-input))))
#+END_SRC
-#+RESULTS:
-: eshell
-
*** Reload
#+BEGIN_SRC emacs-lisp
@@ -438,13 +400,10 @@ the ~-a~ flag.
Finally, remove buffers when an email has been sent.
-#+BEGIN_SRC emacs-lisp
+#+BEGIN_SRC text
(load-user-file "personal.el")
#+END_SRC
-#+RESULTS:
-: t
-
** Elfeed
#+BEGIN_SRC emacs-lisp
@@ -462,9 +421,6 @@ Finally, remove buffers when an email has been sent.
("q" . y/elfeed-save-db-and-bury)))
#+END_SRC
-#+RESULTS:
-: y/elfeed-save-db-and-bury
-
Define utility functions to make the reader work.
#+BEGIN_SRC emacs-lisp
@@ -500,9 +456,6 @@ Define utility functions to make the reader work.
(quit-window))
#+END_SRC
-#+RESULTS:
-: y/elfeed-save-db-and-bury
-
* Utility
** Zettelkasten
@@ -535,9 +488,6 @@ Set navigation commands in all the buffers
(set-mark-command 1))
#+END_SRC
-#+RESULTS:
-: jump-to-mark
-
Enable winner mode to save window state.
#+BEGIN_SRC emacs-lisp
(winner-mode 1)
@@ -566,9 +516,6 @@ Enable winner mode to save window state.
'((t . ivy--regex-fuzzy))))
#+END_SRC
-#+RESULTS:
-: counsel-unicode-char
-
#+begin_src emacs-lisp
(use-package avy
:bind
@@ -577,17 +524,12 @@ Enable winner mode to save window state.
(setq avy-keys '(?a ?r ?s ?t ?d ?h ?n ?e ?i ?o)))
#+end_src
-#+RESULTS:
-: avy-goto-char-2
-
** Visual
*** All the icons
#+BEGIN_SRC emacs-lisp
(use-package all-the-icons)
#+END_SRC
-#+RESULTS:
-
** Editing
*** Hungry Delete
#+BEGIN_SRC emacs-lisp
@@ -596,9 +538,6 @@ Enable winner mode to save window state.
(global-hungry-delete-mode))
#+END_SRC
-#+RESULTS:
-: t
-
*** SmartParens
#+BEGIN_SRC emacs-lisp
(use-package smartparens
@@ -660,9 +599,6 @@ incrementally selecting more and more of the text.
:bind ("M-o" . er/expand-region))
#+END_SRC
-#+RESULTS:
-: er/expand-region
-
*** Dired
#+BEGIN_SRC emacs-lisp
@@ -680,9 +616,6 @@ incrementally selecting more and more of the text.
:bind (("C-c d" . deadgrep)))
#+END_SRC
-#+RESULTS:
-: deadgrep
-
** Yasnippets
#+BEGIN_SRC emacs-lisp
@@ -690,11 +623,13 @@ incrementally selecting more and more of the text.
:config
(yas-global-mode))
#+END_SRC
-** Tramp
-#+begin_src emacs-lisp
- (setq tramp-default-method "ssh")
-#+end_src
+** Nix
+
+#+BEGIN_SRC emacs-lisp
+ (use-package direnv
+ :config (direnv-mode))
+#+END_SRC
* Writing
@@ -717,10 +652,10 @@ incrementally selecting more and more of the text.
** Latex
#+BEGIN_SRC emacs-lisp
- (use-package latex
+ (use-package tex-site
:ensure auctex
+ :mode (".tex'" . latex-mode)
:config
- (require 'tex-site)
;; to use pdfview with auctex
(setq TeX-view-program-selection '((output-pdf "PDF Tools"))
TeX-view-program-list '(("PDF Tools" TeX-pdf-tools-sync-view))
@@ -728,7 +663,7 @@ incrementally selecting more and more of the text.
;; to have the buffer refresh after compilation
(add-hook 'TeX-after-compilation-finished-functions
#'TeX-revert-document-buffer)
- (setq TeX-engine 'xetex)
+ (setq TeX-engine 'luatex)
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq-default TeX-command-extra-options "-shell-escape")
@@ -748,12 +683,10 @@ incrementally selecting more and more of the text.
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
(setq reftex-bibliography-commands '("bibliography" "nobibliography" "addbibresource"))
(setq org-latex-listings 'minted)
- (require 'ox-latex)
- (add-to-list 'org-latex-packages-alist '("" "minted"))) ; with Emacs latex mode
-#+END_SRC
+ (add-to-list 'org-latex-packages-alist '("" "minted")) ; with Emacs latex mode
-#+RESULTS:
-: t
+ (require 'ox-latex))
+#+END_SRC
** Markdown
Markdown is the standard for writing documentation. This snippet loads GFM
@@ -794,9 +727,6 @@ Markdown is the standard for writing documentation. This snippet loads GFM
(add-hook 'org-trigger-hook 'save-buffer))
#+END_SRC
-#+RESULTS:
-: t
-
Set up ob for executing code blocks
#+BEGIN_SRC emacs-lisp
@@ -819,9 +749,6 @@ Set up ob for executing code blocks
(shell . t))))
#+END_SRC
-#+RESULTS:
-: t
-
Exporting to html needs htmlize.
#+BEGIN_SRC emacs-lisp
@@ -862,9 +789,6 @@ Add org noter
(setq org-ref-completion-library 'org-ref-ivy-cite))
#+END_SRC
-#+RESULTS:
-: org-ref-bibtex-hydra/body
-
*** Org ID
#+begin_src emacs-lisp
@@ -895,7 +819,7 @@ Add org noter
(,(format-time-string "~/Dropbox/org/journals/%Y-%m.org") :maxlevel . 2))
org-todo-keywords '((sequence "TODO(t)" "WAITING(w)" "|" "DONE(d)" "CANCELLED(c)")))
- (setq org-agenda-custom-commands
+ (setq org-agenda-custom-commands
'(("w" "At work" tags-todo "@work"
((org-agenda-overriding-header "Work")))
("h" "At home" tags-todo "@home"
@@ -904,11 +828,6 @@ Add org noter
((org-agenda-overriding-header "University")))))
#+END_SRC
-#+RESULTS:
-| w | At work | tags-todo | @work | ((org-agenda-overriding-header Work)) |
-| h | At home | tags-todo | @home | ((org-agenda-overriding-header Home)) |
-| u | At uni | tags-todo | @uni | ((org-agenda-overriding-header University)) |
-
*** Contacts
#+BEGIN_SRC emacs-lisp
@@ -916,9 +835,6 @@ Add org noter
'("~/Dropbox/org/contacts.org")))
#+END_SRC
-#+RESULTS:
-| /home/yannherklotz/Dropbox/org/contacts.org |
-
*** Remove Binding
#+BEGIN_SRC emacs-lisp
(define-key org-mode-map (kbd "C-,") nil)
@@ -954,9 +870,6 @@ Add org noter
(define-key pdf-view-mode-map (kbd "C-s") 'isearch-forward))
#+END_SRC
-#+RESULTS:
-| pdf-view-mode |
-
** Writeroom
#+begin_src emacs-lisp
@@ -978,9 +891,6 @@ lot of different language support.
(setq server-switch-hook nil))
#+END_SRC
-#+RESULTS:
-: magit-status
-
*** Projectile
#+BEGIN_SRC emacs-lisp
(use-package projectile
@@ -1008,9 +918,6 @@ lot of different language support.
(setq-default ediff-forward-word-function 'forward-char)
#+END_SRC
-#+RESULTS:
-: forward-char
-
** Language Support
*** C++
@@ -1075,9 +982,6 @@ to install clang format script).
("C-c u" . 'clang-format-buffer)))
#+END_SRC
-#+RESULTS:
-: clang-format-buffer
-
*** Clojure
Using Cider for clojure environment.
@@ -1116,9 +1020,6 @@ Adding hook to clojure mode to enable strict parentheses mode.
(setq proof-splash-enable nil))
#+end_src
-#+RESULTS:
-: t
-
*** Elm
#+BEGIN_SRC emacs-lisp
@@ -1190,9 +1091,6 @@ Haskell mode with company mode completion.
:hook haskell-mode)
#+END_SRC
-#+RESULTS:
-| (lambda nil (set (make-local-variable (quote projectile-tags-command)) hasktags -Re -f "%s" %s "%s")) | (lambda nil (local-set-key (kbd C-c v) (quote haskell-add-import))) | (lambda nil (local-set-key (kbd C-c y a) (quote y/haskell-align-comment))) | haskell-decl-scan-mode | interactive-haskell-mode |
-
*** LLVM IR
#+begin_src emacs-lisp
@@ -1231,9 +1129,6 @@ Elpy package for python, which provides an IDE type environment for python.
nil "_"))))
#+END_SRC
-#+RESULTS:
-: python-shell-completion-native-try
-
*** JSON
JSON files should be opened in js-mode.
#+BEGIN_SRC emacs-lisp
@@ -1256,8 +1151,6 @@ JSON files should be opened in js-mode.
(use-package scala-mode)
#+end_src
-#+RESULTS:
-
*** Shell
#+BEGIN_SRC emacs-lisp
(setq sh-basic-offset 2)
@@ -1277,9 +1170,6 @@ JSON files should be opened in js-mode.
(setq flycheck-verilog-verilator-executable "verilator_bin")
#+end_src
-#+RESULTS:
-: verilator_bin
-
** Completion Support
*** Company
#+BEGIN_SRC emacs-lisp
@@ -1352,48 +1242,8 @@ Shamelessly taken from https://github.com/alphapapa/unpackaged.el#hydra.
(unpackaged/smerge-hydra/body)))))
#+END_SRC
-#+RESULTS:
-| lambda | nil | (when smerge-mode (unpackaged/smerge-hydra/body)) |
-
* Look and Feel
-Keybindings
-
-#+BEGIN_SRC emacs-lisp
- (defun y/set-theme (theme)
- (load-theme theme t)
- (toggle-scroll-bar -1))
-
- (defun y/sanityinc-tomorrow-bright ()
- (interactive)
- (y/set-theme 'sanityinc-tomorrow-bright))
-
- (defun y/inkpot ()
- (interactive)
- (y/set-theme 'inkpot))
-
- (defun y/zenburn ()
- (interactive)
- (y/set-theme 'zenburn))
-
- (defun y/solarized-light ()
- (interactive)
- (y/set-theme 'solarized-light))
-
- (defun y/gruvbox ()
- (interactive)
- (y/set-theme 'gruvbox))
-
- (define-key y-map (kbd "1") 'y/sanityinc-tomorrow-bright)
- (define-key y-map (kbd "2") 'y/zenburn)
- (define-key y-map (kbd "3") 'y/solarized-light)
- (define-key y-map (kbd "4") 'y/gruvbox)
- (define-key y-map (kbd "5") 'y/inkpot)
-#+END_SRC
-
-#+RESULTS:
-: y/inkpot
-
#+BEGIN_SRC emacs-lisp
(defadvice load-theme
(before theme-dont-propagate activate)
@@ -1409,13 +1259,10 @@ Keybindings
(toggle-scroll-bar -1)))
#+END_SRC
-#+RESULTS:
-| (lambda (frame) (select-frame frame) (load-theme (quote sanityinc-tomorrow-night) t) (toggle-scroll-bar -1)) | (lambda (frame) (select-frame frame) (load-theme (quote gruvbox-light-soft) t) (toggle-scroll-bar -1)) | x-dnd-init-frame |
-
* Conclusion
Setting the gc-cons threshold back to what it was at the beginning.
#+BEGIN_SRC emacs-lisp
(server-start)
- (setq gc-cons-threshold 10000000)
+ (setq gc-cons-threshold (* 1024 1024 10))
#+END_SRC
diff --git a/install.sh b/install.sh
index f7c0022..2bd7b26 100755
--- a/install.sh
+++ b/install.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
-SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
+SCRIPT_DIR=$(pwd)
function print_help {
echo "Install configuration options to the correct paths."
diff --git a/isync/.mbsyncrc b/isync/.mbsyncrc
index be64efd..189fd5e 100644
--- a/isync/.mbsyncrc
+++ b/isync/.mbsyncrc
@@ -2,17 +2,15 @@ IMAPAccount imperial
Host outlook.office365.com
Port 993
User ymh15@ic.ac.uk
-PassCmd "gpg -q --pinentry-mode loopback --for-your-eyes-only --no-tty --passphrase-file ~/.config/.yann --batch --yes -d ~/.authimperial.gpg"
+PassCmd "pass show imperial/ymh15"
SSLType IMAPS
-CertificateFile /etc/ssl/certs/ca-certificates.crt
IMAPAccount mailbox
Host imap.mailbox.org
Port 993
User ymherklotz@mailbox.org
-PassCmd "gpg -q --pinentry-mode loopback --for-your-eyes-only --no-tty --passphrase-file ~/.config/.yann --batch --yes -d ~/.authmail.gpg"
+PassCmd "pass show mailbox/ymherklotz@mailbox.org"
SSLType IMAPS
-CertificateFile /etc/ssl/certs/ca-certificates.crt
IMAPStore imperial-remote
Account imperial
diff --git a/macos/skhd/skhdrc b/macos/skhd/skhdrc
new file mode 100644
index 0000000..6a0d5c9
--- /dev/null
+++ b/macos/skhd/skhdrc
@@ -0,0 +1,189 @@
+# ################################################################ #
+# THE FOLLOWING IS AN EXPLANATION OF THE GRAMMAR THAT SKHD PARSES. #
+# FOR SIMPLE EXAMPLE MAPPINGS LOOK FURTHER DOWN THIS FILE.. #
+# ################################################################ #
+
+# A list of all built-in modifier and literal keywords can
+# be found at https://github.com/koekeishiya/skhd/issues/1
+#
+# A hotkey is written according to the following rules:
+#
+# hotkey = <mode> '<' <action> | <action>
+#
+# mode = 'name of mode' | <mode> ',' <mode>
+#
+# action = <keysym> '[' <proc_map_lst> ']' | <keysym> '->' '[' <proc_map_lst> ']'
+# <keysym> ':' <command> | <keysym> '->' ':' <command>
+# <keysym> ';' <mode> | <keysym> '->' ';' <mode>
+#
+# keysym = <mod> '-' <key> | <key>
+#
+# mod = 'modifier keyword' | <mod> '+' <mod>
+#
+# key = <literal> | <keycode>
+#
+# literal = 'single letter or built-in keyword'
+#
+# keycode = 'apple keyboard kVK_<Key> values (0x3C)'
+#
+# proc_map_lst = * <proc_map>
+#
+# proc_map = <string> ':' <command> | <string> '~' |
+# '*' ':' <command> | '*' '~'
+#
+# string = '"' 'sequence of characters' '"'
+#
+# command = command is executed through '$SHELL -c' and
+# follows valid shell syntax. if the $SHELL environment
+# variable is not set, it will default to '/bin/bash'.
+# when bash is used, the ';' delimeter can be specified
+# to chain commands.
+#
+# to allow a command to extend into multiple lines,
+# prepend '\' at the end of the previous line.
+#
+# an EOL character signifies the end of the bind.
+#
+# -> = keypress is not consumed by skhd
+#
+# * = matches every application not specified in <proc_map_lst>
+#
+# ~ = application is unbound and keypress is forwarded per usual, when specified in a <proc_map>
+#
+# A mode is declared according to the following rules:
+#
+# mode_decl = '::' <name> '@' ':' <command> | '::' <name> ':' <command> |
+# '::' <name> '@' | '::' <name>
+#
+# name = desired name for this mode,
+#
+# @ = capture keypresses regardless of being bound to an action
+#
+# command = command is executed through '$SHELL -c' and
+# follows valid shell syntax. if the $SHELL environment
+# variable is not set, it will default to '/bin/bash'.
+# when bash is used, the ';' delimeter can be specified
+# to chain commands.
+#
+# to allow a command to extend into multiple lines,
+# prepend '\' at the end of the previous line.
+#
+# an EOL character signifies the end of the bind.
+
+# Open a new terminal
+cmd - return : /Applications/Alacritty.app/Contents/MacOS/alacritty
+
+# focus window
+alt - u : yabai -m window --focus north
+alt - e : yabai -m window --focus south
+alt - n : yabai -m window --focus west
+alt - i : yabai -m window --focus east
+
+# swap managed window
+shift + alt - u : yabai -m window --swap north
+shift + alt - e : yabai -m window --swap south
+shift + alt - n : yabai -m window --swap west
+shift + alt - i : yabai -m window --swap east
+
+# move managed window
+shift + cmd - u : yabai -m window --warp north
+shift + cmd - e : yabai -m window --warp south
+shift + cmd - n : yabai -m window --warp west
+shift + cmd - h : yabai -m window --warp east
+
+# balance size of windows
+shift + alt - 0 : yabai -m space --balance
+
+# make floating window fill screen
+shift + alt - up : yabai -m window --grid 1:1:0:0:1:1
+
+# make floating window fill left-half of screen
+shift + alt - left : yabai -m window --grid 1:2:0:0:1:1
+
+# create desktop, move window and follow focus - uses jq for parsing json (brew install jq)
+shift + cmd - n : yabai -m space --create && \
+ index="$(yabai -m query --spaces --display | jq 'map(select(."native-fullscreen" == 0))[-1].index')" && \
+ yabai -m window --space "${index}" && \
+ yabai -m space --focus "${index}"
+
+# fast focus desktop
+alt - c : yabai -m space --focus recent
+alt - x : yabai -m space --focus next
+alt - z : yabai -m space --focus prev
+alt - 1 : yabai -m space --focus 1
+alt - 2 : yabai -m space --focus 2
+alt - 3 : yabai -m space --focus 3
+alt - 4 : yabai -m space --focus 4
+alt - 5 : yabai -m space --focus 5
+alt - 6 : yabai -m space --focus 6
+alt - 7 : yabai -m space --focus 7
+alt - 8 : yabai -m space --focus 8
+alt - 9 : yabai -m space --focus 9
+
+# send window to desktop and follow focus
+shift + alt - x : yabai -m window --space next; yabai -m space --focus next
+shift + alt - z : yabai -m window --space prev; yabai -m space --focus prev
+shift + alt - 1 : yabai -m window --space 1; yabai -m space --focus 1
+shift + alt - 2 : yabai -m window --space 2; yabai -m space --focus 2
+shift + alt - 3 : yabai -m window --space 3; yabai -m space --focus 3
+shift + alt - 4 : yabai -m window --space 4; yabai -m space --focus 4
+shift + alt - 5 : yabai -m window --space 5; yabai -m space --focus 5
+shift + alt - 6 : yabai -m window --space 6; yabai -m space --focus 6
+shift + alt - 7 : yabai -m window --space 7; yabai -m space --focus 7
+shift + alt - 8 : yabai -m window --space 8; yabai -m space --focus 8
+shift + alt - 9 : yabai -m window --space 9; yabai -m space --focus 9
+
+# focus monitor
+ctrl + alt - x : yabai -m display --focus prev
+ctrl + alt - z : yabai -m display --focus next
+ctrl + alt - 1 : yabai -m display --focus 1
+ctrl + alt - 2 : yabai -m display --focus 2
+ctrl + alt - 3 : yabai -m display --focus 3
+
+# send window to monitor and follow focus
+shift + ctrl - z : yabai -m window --display prev; yabai -m display --focus prev
+shift + ctrl - x : yabai -m window --display next; yabai -m display --focus next
+shift + ctrl - 1 : yabai -m window --display 1; yabai -m display --focus 1
+shift + ctrl - 2 : yabai -m window --display 2; yabai -m display --focus 2
+shift + ctrl - 3 : yabai -m window --display 3; yabai -m display --focus 3
+
+# move floating window
+shift + ctrl - a : yabai -m window --move rel:-20:0
+shift + ctrl - r : yabai -m window --move rel:0:20
+shift + ctrl - w : yabai -m window --move rel:0:-20
+shift + ctrl - s : yabai -m window --move rel:20:0
+
+# increase window size
+shift + alt - a : yabai -m window --resize left:-20:0
+shift + alt - w : yabai -m window --resize top:0:-20
+shift + alt - r : yabai -m window --resize bottom:0:20
+shift + alt - s : yabai -m window --resize right:20:0
+
+# decrease window size
+shift + cmd - r : yabai -m window --resize bottom:0:-20
+shift + cmd - w : yabai -m window --resize top:0:20
+shift + cmd - a : yabai -m window --resize left:20:0
+shift + cmd - s : yabai -m window --resize right:-20:0
+
+# set insertion point in focused container
+ctrl + alt - n : yabai -m window --insert west
+ctrl + alt - u : yabai -m window --insert north
+ctrl + alt - i : yabai -m window --insert east
+ctrl + alt - e : yabai -m window --insert south
+
+# toggle window zoom
+alt - d : yabai -m window --toggle zoom-parent
+alt - f : yabai -m window --toggle zoom-fullscreen
+
+# toggle window split type
+alt - m : yabai -m window --toggle split
+
+# float / unfloat window and center on screen
+alt - t : yabai -m window --toggle float;\
+ yabai -m window --grid 4:4:1:1:2:2
+
+# toggle sticky(+float), topmost, border and picture-in-picture
+alt - p : yabai -m window --toggle sticky;\
+ yabai -m window --toggle topmost;\
+ yabai -m window --toggle border;\
+ yabai -m window --toggle pip
diff --git a/macos/yabai/yabairc b/macos/yabai/yabairc
new file mode 100755
index 0000000..a509658
--- /dev/null
+++ b/macos/yabai/yabairc
@@ -0,0 +1,17 @@
+#!/bin/zsh
+
+yabai -m config mouse_follows_focus off
+yabai -m config focus_follows_mouse off
+
+yabai -m config window_shadow float
+yabai -m config window_topmost on
+
+yabai -m config layout bsp
+yabai -m config top_padding 5
+yabai -m config bottom_padding 5
+yabai -m config left_padding 5
+yabai -m config right_padding 5
+yabai -m config window_gap 5
+
+yabai -m rule --add app=Emacs manage=on
+yabai -m rule --add app="System Preferences" manage=off
diff --git a/zsh/.zsh/export.zsh b/zsh/.zsh/export.zsh
index 0793ae2..b6a400f 100644
--- a/zsh/.zsh/export.zsh
+++ b/zsh/.zsh/export.zsh
@@ -1,19 +1,43 @@
-export GITHUB_HOME=$HOME/Github
+os=$(uname -s)
+
+. $HOME/.nix-profile/etc/profile.d/nix.sh
+
+[ -n "$SSH_CLIENT" ] && export MINIMAL_USER_CHAR="$(hostname)"
+
+export GITHUB_HOME=$HOME/Projects
export FZF_DEFAULT_COMMAND='fd --type file --hidden --no-ignore'
export ALTERNATE_EDITOR="emacs -nw -Q"
export EDITOR='emacsclient -nw'
export VISUAL='emacsclient -c'
export TERM='xterm-256color'
+export CLICOLOR=1
+
+prepend_path() {
+ [ -d "$1" ] && PATH="$1:$PATH"
+}
+
+append_path() {
+ [ -d "$1" ] && PATH="$PATH:$1"
+}
+
+if [ $os = "Darwin" ]; then
+ prepend_path "/Library/TeX/texbin"
+ prepend_path "/usr/local/opt/bison/bin"
+
+ append_path "${HOME}/Library/Python/3.8/bin"
+fi
+
+prepend_path "/usr/local/bin"
+prepend_path "${HOME}/.gem/ruby/2.7.0/bin"
+prepend_path "${HOME}/.yarn/bin"
+prepend_path "${HOME}/.cargo/bin"
+prepend_path "${HOME}/.cabal/bin"
+prepend_path "${HOME}/.local/bin"
-export PATH="${HOME}/.gem/ruby/2.6.0/bin:/usr/local/bin:${PATH}"
-export PATH="/usr/bin:${PATH}"
-export PATH="${HOME}/.yarn/bin:${PATH}"
-export PATH="${PATH}:/opt/Xilinx/Vivado/2019.1/bin"
-export PATH="${PATH}:/opt/intelFPGA_lite/18.1/quartus/bin"
-export PATH="${HOME}/.local/bin:${PATH}"
-export PATH="${HOME}/.cargo/bin:${PATH}"
-export PATH="${HOME}/.cabal/bin:${PATH}"
-if [[ -d "${HOME}/.gem/ruby/2.7.0/bin" ]]; then export PATH="${HOME}/.gem/ruby/2.7.0/bin:${PATH}"; fi
+append_path "/opt/Xilinx/Vivado/2019.1/bin"
+append_path "/opt/intelFPGA_lite/18.1/quartus/bin"
+
+export PATH
if [[ -n $SSH_CLIENT ]]; then
export MINIMAL_USER_CHAR="$(hostname)"
@@ -23,6 +47,21 @@ fi
export DOTNET_CLI_TELEMETRY_OPTOUT=1
# Fix java windows for tiling window managers
-export _JAVA_AWT_WM_NONREPARENTING=1
+[ $os = "Linux" ] && export _JAVA_AWT_WM_NONREPARENTING=1
+
+# Direnv hook setup
+command -v direnv >/dev/null 2>&1
+[ "$?" -eq 0 ] && eval "$(direnv hook zsh)"
+
+# Opam hook setup and initialising it
+command -v opam >/dev/null 2>&1
+if [ "$?" -eq 0 ]; then
+ test -r /home/yannherklotz/.opam/opam-init/init.zsh && . /home/yannherklotz/.opam/opam-init/init.zsh > /dev/null 2> /dev/null || true
+ eval "$(opam env)";
+fi
+
+# Load rust environment
+[ -r "$HOME/.cargo/env" ] && source $HOME/.cargo/env
-eval "$(direnv hook zsh)"
+# Travis
+[ -r "$HOME/.travis/travis.sh" ] && source "$HOME/.travis/travis.sh"
diff --git a/zsh/.zsh/function.zsh b/zsh/.zsh/function.zsh
index b4cc40a..809471e 100644
--- a/zsh/.zsh/function.zsh
+++ b/zsh/.zsh/function.zsh
@@ -1,12 +1,8 @@
-alias fdisk='fdisk --color=always'
-alias grep='grep --color=always'
-alias ls='ls --color=always'
-alias l='ls -la --color=always'
-alias vi='nvim'
-alias vim='nvim'
alias emc='emacsclient -c -a ""'
alias em='emacsclient -nw -a ""'
+alias ls='exa'
alias ff='firefox'
+alias vim=nvim
# alias lspasscp='lpass show -c --password $(lpass ls | fzf | awk '{print $(NF)}' | sed 's/\\]//g')'
# fixing pdflatex
diff --git a/zsh/.zsh/startup.zsh b/zsh/.zsh/startup.zsh
index 2002337..67716ac 100644
--- a/zsh/.zsh/startup.zsh
+++ b/zsh/.zsh/startup.zsh
@@ -2,9 +2,4 @@
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
. '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
fi
-
-# direnv
-
# End Nix
-
-eval $(opam env)
diff --git a/zsh/.zshrc b/zsh/.zshrc
index f89ad19..ccf9080 100644
--- a/zsh/.zshrc
+++ b/zsh/.zshrc
@@ -25,24 +25,18 @@ setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_SPACE
setopt HIST_FIND_NO_DUPS
-(cat ~/.cache/wal/sequences &) >/dev/null 2>&1
+if [ -d ~/.cache/wal ]; then (cat ~/.cache/wal/sequences &) fi
# Sourcing everything
-source /usr/share/fzf/key-bindings.zsh
-source /usr/share/fzf/completion.zsh
-source $HOME/.zsh/export.zsh
-source $HOME/.zsh/minimal.zsh
-source $HOME/.zsh/function.zsh
-source $HOME/.zsh/startup.zsh
-source $HOME/.zsh/zsh-history-substring-search/zsh-history-substring-search.zsh
-source $HOME/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
+if [ -e /usr/share/fzf/key-bindings.zsh ]; then source /usr/share/fzf/key-bindings.zsh; fi
+if [ -e /usr/share/fzf/completion.zsh ]; then source /usr/share/fzf/completion.zsh; fi
+if [ -e $HOME/.zsh/export.zsh ]; then source $HOME/.zsh/export.zsh; fi
+if [ -e $HOME/.zsh/minimal.zsh ]; then source $HOME/.zsh/minimal.zsh; fi
+if [ -e $HOME/.zsh/function.zsh ]; then source $HOME/.zsh/function.zsh; fi
+if [ -e $HOME/.zsh/startup.zsh ]; then source $HOME/.zsh/startup.zsh; fi
+if [ -e $HOME/.zsh/zsh-history-substring-search/zsh-history-substring-search.zsh ]; then source $HOME/.zsh/zsh-history-substring-search/zsh-history-substring-search.zsh; fi
+if [ -e $HOME/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh ]; then source $HOME/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh; fi
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
bindkey -M emacs '^P' history-substring-search-up
bindkey -M emacs ^N history-substring-search-down
-
-# opam configuration
-test -r /home/yannherklotz/.opam/opam-init/init.zsh && . /home/yannherklotz/.opam/opam-init/init.zsh > /dev/null 2> /dev/null || true
-
-# added by travis gem
-[ -f /home/ymherklotz/.travis/travis.sh ] && source /home/ymherklotz/.travis/travis.sh