From 009174919698505e35100f621b9015f779de5e96 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Sun, 8 Mar 2020 18:29:16 +0000 Subject: Add emacs support for mac --- emacs/loader.org | 89 +++++++++++++++++++------------------------------------- zsh/.zshrc | 20 +++++++------ 2 files changed, 41 insertions(+), 68 deletions(-) diff --git a/emacs/loader.org b/emacs/loader.org index bd14c7e..e879d2f 100644 --- a/emacs/loader.org +++ b/emacs/loader.org @@ -40,12 +40,10 @@ 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)) @@ -107,7 +105,7 @@ 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: @@ -123,15 +121,20 @@ 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/") + (when (string= system-type "darwin") + (setq dired-use-ls-dired nil)) #+END_SRC #+RESULTS: @@ -355,8 +358,12 @@ programming and looking at source code. #+END_SRC #+BEGIN_SRC emacs-lisp - (set-default-font "Iosevka Medium-14") - (setq default-frame-alist '((font . "Iosevka Medium-14"))) + (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: @@ -433,7 +440,7 @@ 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 @@ -708,10 +715,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)) @@ -719,10 +726,10 @@ 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 TeX-command-extra-options "-shell-escape") + ; (setq TeX-command-extra-options "-shell-escape") (setq TeX-save-query nil) (setq-default TeX-master nil) (setq TeX-PDF-mode t) @@ -739,12 +746,13 @@ 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 + (add-to-list 'org-latex-packages-alist '("" "minted")) ; with Emacs latex mode + + (require 'ox-latex)) #+END_SRC #+RESULTS: -: t +: ((\.json\' . js-mode) (\.flex\' . c-mode) (\.h\' . c++-mode) (\.odc\' . archive-mode) (\.odf\' . archive-mode) (\.odi\' . archive-mode) (\.otp\' . archive-mode) (\.odp\' . archive-mode) (\.otg\' . archive-mode) (\.odg\' . archive-mode) (\.ots\' . archive-mode) (\.ods\' . archive-mode) (\.odm\' . archive-mode) (\.ott\' . archive-mode) (\.odt\' . archive-mode) (README\.md\' . gfm-mode) (.tex' . latex-mode) (\.gpg\(~\|\.~[0-9]+~\)?\' nil epa-file) (\.hva\' . latex-mode) (\.drv\' . latex-mode) (\(?:build\|profile\)\.boot\' . clojure-mode) (\.cljs\' . clojurescript-mode) (\.cljc\' . clojurec-mode) (\.\(clj\|dtm\|edn\)\' . clojure-mode) (\.cmake\' . cmake-mode) (CMakeLists\.txt\' . cmake-mode) (\.envrc\' . direnv-envrc-mode) (\.elm\' . elm-mode) (\.fs[iylx]?\' . fsharp-mode) (\.hsc\' . haskell-mode) (\.l[gh]s\' . literate-haskell-mode) (\.hsig\' . haskell-mode) (\.[gh]s\' . haskell-mode) (\.cabal\'\|/cabal\.project\|/\.cabal/config\' . haskell-cabal-mode) (\.chs\' . haskell-c2hs-mode) (\.ghci\' . ghci-script-mode) (\.dump-simpl\' . ghc-core-mode) (\.hcr\' . ghc-core-mode) (/git-rebase-todo\' . git-rebase-mode) (\.md\' . markdown-mode) (\.markdown\' . markdown-mode) (\.nix\' . nix-mode) (\.pghci\' . pghaskell-mode) (\.pgml\' . pgocaml-mode) (\.pgsh\' . pgshell-mode) (\.phx\' . phox-mode) (\.eca?\' . easycrypt-mode) (\.v\' . coq-mode) (\.\(scala\|sbt\)\' . scala-mode) (\.elc\' . elisp-byte-code-mode) (\.zst\' nil jka-compr) (\.dz\' nil jka-compr) (\.xz\' nil jka-compr) (\.lzma\' nil jka-compr) (\.lz\' nil jka-compr) (\.g?z\' nil jka-compr) (\.bz2\' nil jka-compr) (\.Z\' nil jka-compr) (\.vr[hi]?\' . vera-mode) (\(?:\.\(?:rbw?\|ru\|rake\|thor\|jbuilder\|rabl\|gemspec\|podspec\)\|/\(?:Gem\|Rake\|Cap\|Thor\|Puppet\|Berks\|Vagrant\|Guard\|Pod\)file\)\' . ruby-mode) (\.re?st\' . rst-mode) (\.py[iw]?\' . python-mode) (\.m\' . octave-maybe-mode) (\.less\' . less-css-mode) (\.scss\' . scss-mode) (\.awk\' . awk-mode) (\.\(u?lpc\|pike\|pmod\(\.in\)?\)\' . pike-mode) (\.idl\' . idl-mode) (\.java\' . java-mode) (\.m\' . objc-mode) (\.ii\' . c++-mode) (\.i\' . c-mode) (\.lex\' . c-mode) (\.y\(acc\)?\' . c-mode) (\.h\' . c-or-c++-mode) (\.c\' . c-mode) (\.\(CC?\|HH?\)\' . c++-mode) (\.[ch]\(pp\|xx\|\+\+\)\' . c++-mode) (\.\(cc\|hh\)\' . c++-mode) (\.\(bat\|cmd\)\' . bat-mode) (\.[sx]?html?\(\.[a-zA-Z_]+\)?\' . mhtml-mode) (\.svgz?\' . image-mode) (\.svgz?\' . xml-mode) (\.x[bp]m\' . image-mode) (\.x[bp]m\' . c-mode) (\.p[bpgn]m\' . image-mode) (\.tiff?\' . image-mode) (\.gif\' . image-mode) (\.png\' . image-mode) (\.jpe?g\' . image-mode) (\.te?xt\' . text-mode) (\.[tT]e[xX]\' . tex-mode) (\.ins\' . tex-mode) (\.ltx\' . latex-mode) (\.dtx\' . doctex-mode) (\.org\' . org-mode) (\.el\' . emacs-lisp-mode) (Project\.ede\' . emacs-lisp-mode) (\.\(scm\|stk\|ss\|sch\)\' . scheme-mode) (\.l\' . lisp-mode) (\.li?sp\' . lisp-mode) (\.[fF]\' . fortran-mode) (\.for\' . fortran-mode) (\.p\' . pascal-mode) (\.pas\' . pascal-mode) (\.\(dpr\|DPR\)\' . delphi-mode) (\.ad[abs]\' . ada-mode) (\.ad[bs].dg\' . ada-mode) (\.\([pP]\([Llm]\|erl\|od\)\|al\)\' . perl-mode) (Imakefile\' . makefile-imake-mode) (Makeppfile\(?:\.mk\)?\' . makefile-makepp-mode) (\.makepp\' . makefile-makepp-mode) (\.mk\' . makefile-bsdmake-mode) (\.make\' . makefile-bsdmake-mode) (GNUmakefile\' . makefile-gmake-mode) ([Mm]akefile\' . makefile-bsdmake-mode) (\.am\' . makefile-automake-mode) (\.texinfo\' . texinfo-mode) (\.te?xi\' . texinfo-mode) (\.[sS]\' . asm-mode) (\.asm\' . asm-mode) (\.css\' . css-mode) (\.mixal\' . mixal-mode) (\.gcov\' . compilation-mode) (/\.[a-z0-9-]*gdbinit . gdb-script-mode) (-gdb\.gdb . gdb-script-mode) ([cC]hange\.?[lL]og?\' . change-log-mode) ([cC]hange[lL]og[-.][0-9]+\' . change-log-mode) (\$CHANGE_LOG\$\.TXT . change-log-mode) (\.scm\.[0-9]*\' . scheme-mode) (\.[ckz]?sh\'\|\.shar\'\|/\.z?profile\' . sh-mode) (\.bash\' . sh-mode) (\(/\|\`\)\.\(bash_\(profile\|history\|log\(in\|out\)\)\|z?log\(in\|out\)\)\' . sh-mode) (\(/\|\`\)\.\(shrc\|zshrc\|m?kshrc\|bashrc\|t?cshrc\|esrc\)\' . sh-mode) (\(/\|\`\)\.\([kz]shenv\|xinitrc\|startxrc\|xsession\)\' . sh-mode) (\.m?spec\' . sh-mode) (\.m[mes]\' . nroff-mode) (\.man\' . nroff-mode) (\.sty\' . latex-mode) (\.cl[so]\' . latex-mode) (\.bbl\' . latex-mode) (\.bib\' . bibtex-mode) (\.bst\' . bibtex-style-mode) (\.sql\' . sql-mode) (\(acinclude\|aclocal\|acsite\)\.m4\' . autoconf-mode) (\.m[4c]\' . m4-mode) (\.mf\' . metafont-mode) (\.mp\' . metapost-mode) (\.vhdl?\' . vhdl-mode) (\.article\' . text-mode) (\.letter\' . text-mode) (\.i?tcl\' . tcl-mode) (\.exp\' . tcl-mode) (\.itk\' . tcl-mode) (\.icn\' . icon-mode) (\.sim\' . simula-mode) (\.mss\' . scribe-mode) (\.f9[05]\' . f90-mode) (\.f0[38]\' . f90-mode) (\.indent\.pro\' . fundamental-mode) (\.\(pro\|PRO\)\' . idlwave-mode) (\.srt\' . srecode-template-mode) (\.prolog\' . prolog-mode) (\.tar\' . tar-mode) (\.\(arc\|zip\|lzh\|lha\|zoo\|[jew]ar\|xpi\|rar\|cbr\|7z\|ARC\|ZIP\|LZH\|LHA\|ZOO\|[JEW]AR\|XPI\|RAR\|CBR\|7Z\)\' . archive-mode) (\.oxt\' . archive-mode) (\.\(deb\|[oi]pk\)\' . archive-mode) (\`/tmp/Re . text-mode) (/Message[0-9]*\' . text-mode) (\`/tmp/fol/ . text-mode) (\.oak\' . scheme-mode) (\.sgml?\' . sgml-mode) (\.x[ms]l\' . xml-mode) (\.dbk\' . xml-mode) (\.dtd\' . sgml-mode) (\.ds\(ss\)?l\' . dsssl-mode) (\.js[mx]?\' . javascript-mode) (\.har\' . javascript-mode) (\.json\' . javascript-mode) (\.[ds]?va?h?\' . verilog-mode) (\.by\' . bovine-grammar-mode) (\.wy\' . wisent-grammar-mode) ([:/\]\..*\(emacs\|gnus\|viper\)\' . emacs-lisp-mode) (\`\..*emacs\' . emacs-lisp-mode) ([:/]_emacs\' . emacs-lisp-mode) (/crontab\.X*[0-9]+\' . shell-script-mode) (\.ml\' . lisp-mode) (\.ld[si]?\' . ld-script-mode) (ld\.?script\' . ld-script-mode) (\.xs\' . c-mode) (\.x[abdsru]?[cnw]?\' . ld-script-mode) (\.zone\' . dns-mode) (\.soa\' . dns-mode) (\.asd\' . lisp-mode) (\.\(asn\|mib\|smi\)\' . snmp-mode) (\.\(as\|mi\|sm\)2\' . snmpv2-mode) (\.\(diffs?\|patch\|rej\)\' . diff-mode) (\.\(dif\|pat\)\' . diff-mode) (\.[eE]?[pP][sS]\' . ps-mode) (\.\(?:PDF\|DVI\|OD[FGPST]\|DOCX\|XLSX?\|PPTX?\|pdf\|djvu\|dvi\|od[fgpst]\|docx\|xlsx?\|pptx?\)\' . doc-view-mode-maybe) (configure\.\(ac\|in\)\' . autoconf-mode) (\.s\(v\|iv\|ieve\)\' . sieve-mode) (BROWSE\' . ebrowse-tree-mode) (\.ebrowse\' . ebrowse-tree-mode) (#\*mail\* . mail-mode) (\.g\' . antlr-mode) (\.mod\' . m2-mode) (\.ses\' . ses-mode) (\.docbook\' . sgml-mode) (\.com\' . dcl-mode) (/config\.\(?:bat\|log\)\' . fundamental-mode) (/\.\(authinfo\|netrc\)\' . authinfo-mode) (\.\(?:[iI][nN][iI]\|[lL][sS][tT]\|[rR][eE][gG]\|[sS][yY][sS]\)\' . conf-mode) (\.la\' . conf-unix-mode) (\.ppd\' . conf-ppd-mode) (java.+\.conf\' . conf-javaprop-mode) (\.properties\(?:\.[a-zA-Z0-9._-]+\)?\' . conf-javaprop-mode) (\.toml\' . conf-toml-mode) (\.desktop\' . conf-desktop-mode) (/\.redshift.conf\' . conf-windows-mode) (\`/etc/\(?:DIR_COLORS\|ethers\|.?fstab\|.*hosts\|lesskey\|login\.?de\(?:fs\|vperm\)\|magic\|mtab\|pam\.d/.*\|permissions\(?:\.d/.+\)?\|protocols\|rpc\|services\)\' . conf-space-mode) (\`/etc/\(?:acpid?/.+\|aliases\(?:\.d/.+\)?\|default/.+\|group-?\|hosts\..+\|inittab\|ksysguarddrc\|opera6rc\|passwd-?\|shadow-?\|sysconfig/.+\)\' . conf-mode) ([cC]hange[lL]og[-.][-0-9a-z]+\' . change-log-mode) (/\.?\(?:gitconfig\|gnokiirc\|hgrc\|kde.*rc\|mime\.types\|wgetrc\)\' . conf-mode) (/\.\(?:asound\|enigma\|fetchmail\|gltron\|gtk\|hxplayer\|mairix\|mbsync\|msmtp\|net\|neverball\|nvidia-settings-\|offlineimap\|qt/.+\|realplayer\|reportbug\|rtorrent\.\|screen\|scummvm\|sversion\|sylpheed/.+\|xmp\)rc\' . conf-mode) (/\.\(?:gdbtkinit\|grip\|mpdconf\|notmuch-config\|orbital/.+txt\|rhosts\|tuxracer/options\)\' . conf-mode) (/\.?X\(?:default\|resource\|re\)s\> . conf-xdefaults-mode) (/X11.+app-defaults/\|\.ad\' . conf-xdefaults-mode) (/X11.+locale/.+/Compose\' . conf-colon-mode) (/X11.+locale/compose\.dir\' . conf-javaprop-mode) (\.~?[0-9]+\.[0-9][-.0-9]*~?\' nil t) (\.\(?:orig\|in\|[bB][aA][kK]\)\' nil t) ([/.]c\(?:on\)?f\(?:i?g\)?\(?:\.[a-zA-Z0-9._-]+\)?\' . conf-mode-maybe) (\.[1-9]\' . nroff-mode) (\.art\' . image-mode) (\.avs\' . image-mode) (\.bmp\' . image-mode) (\.cmyk\' . image-mode) (\.cmyka\' . image-mode) (\.crw\' . image-mode) (\.dcr\' . image-mode) (\.dcx\' . image-mode) (\.dng\' . image-mode) (\.dpx\' . image-mode) (\.fax\' . image-mode) (\.hrz\' . image-mode) (\.icb\' . image-mode) (\.icc\' . image-mode) (\.icm\' . image-mode) (\.ico\' . image-mode) (\.icon\' . image-mode) (\.jbg\' . image-mode) (\.jbig\' . image-mode) (\.jng\' . image-mode) (\.jnx\' . image-mode) (\.miff\' . image-mode) (\.mng\' . image-mode) (\.mvg\' . image-mode) (\.otb\' . image-mode) (\.p7\' . image-mode) (\.pcx\' . image-mode) (\.pdb\' . image-mode) (\.pfa\' . image-mode) (\.pfb\' . image-mode) (\.picon\' . image-mode) (\.pict\' . image-mode) (\.rgb\' . image-mode) (\.rgba\' . image-mode) (\.tga\' . image-mode) (\.wbmp\' . image-mode) (\.webp\' . image-mode) (\.wmf\' . image-mode) (\.wpg\' . image-mode) (\.xcf\' . image-mode) (\.xmp\' . image-mode) (\.xwd\' . image-mode) (\.yuv\' . image-mode) (\.tgz\' . tar-mode) (\.tbz2?\' . tar-mode) (\.txz\' . tar-mode) (\.tzst\' . tar-mode)) ** Markdown Markdown is the standard for writing documentation. This snippet loads GFM @@ -878,7 +886,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" @@ -1180,7 +1188,7 @@ Haskell mode with company mode completion. *** LLVM IR -#+begin_src emacs-lisp +#+begin_src text (require 'llvm-mode) #+end_src @@ -1329,43 +1337,6 @@ Shamelessly taken from https://github.com/alphapapa/unpackaged.el#hydra. * 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) @@ -1376,9 +1347,9 @@ Keybindings (select-frame frame) (toggle-scroll-bar -1))) - (unless (boundp 'server-process) - (progn (load-theme 'sanityinc-tomorrow-night t) - (toggle-scroll-bar -1))) + ;(unless (boundp 'server-process) + ; (progn (load-theme 'sanityinc-solarized-light t) + ; (toggle-scroll-bar -1))) #+END_SRC #+RESULTS: @@ -1389,5 +1360,5 @@ 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/zsh/.zshrc b/zsh/.zshrc index 9c02e6a..b854793 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -23,17 +23,19 @@ setopt HIST_IGNORE_DUPS setopt HIST_IGNORE_SPACE setopt HIST_FIND_NO_DUPS -(cat ~/.cache/wal/sequences &) +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 -- cgit