From 3d856c7dbc400bfda6ef692d0153718b2b00a9f8 Mon Sep 17 00:00:00 2001 From: "Rachel Fae Fox (foxiepaws)" Date: Sun, 3 May 2020 12:19:57 -0400 Subject: [PATCH] Initial Commit --- .emacs.d/defaultcontent/defaultcontent.el | 366 ++++++++++++++++++ .emacs.d/defaultcontent/templates/c-insert.c | 14 + .../defaultcontent/templates/pl-insert.pl | 17 + .../defaultcontent/templates/pm-insert.pm | 36 ++ .../defaultcontent/templates/rkt-insert.rkt | 11 + .emacs.d/init.el | 56 +++ .emacs.d/loadins/autoinsert-options.el | 28 ++ .emacs.d/loadins/backups.el | 15 + .emacs.d/loadins/darwin.el | 17 + .emacs.d/loadins/evil-bindings.el | 22 ++ .emacs.d/loadins/graphical.el | 11 + .emacs.d/loadins/haskell-hooks.el | 25 ++ .emacs.d/loadins/hooks.el | 38 ++ .emacs.d/loadins/org-vars.el | 38 ++ .emacs.d/loadins/packages.el | 26 ++ .emacs.d/loadins/perl-hooks.el | 28 ++ .emacs.d/loadins/projectile.el | 6 + .gitignore | 2 + 18 files changed, 756 insertions(+) create mode 100644 .emacs.d/defaultcontent/defaultcontent.el create mode 100644 .emacs.d/defaultcontent/templates/c-insert.c create mode 100644 .emacs.d/defaultcontent/templates/pl-insert.pl create mode 100644 .emacs.d/defaultcontent/templates/pm-insert.pm create mode 100644 .emacs.d/defaultcontent/templates/rkt-insert.rkt create mode 100644 .emacs.d/init.el create mode 100644 .emacs.d/loadins/autoinsert-options.el create mode 100644 .emacs.d/loadins/backups.el create mode 100644 .emacs.d/loadins/darwin.el create mode 100644 .emacs.d/loadins/evil-bindings.el create mode 100644 .emacs.d/loadins/graphical.el create mode 100644 .emacs.d/loadins/haskell-hooks.el create mode 100644 .emacs.d/loadins/hooks.el create mode 100644 .emacs.d/loadins/org-vars.el create mode 100644 .emacs.d/loadins/packages.el create mode 100644 .emacs.d/loadins/perl-hooks.el create mode 100644 .emacs.d/loadins/projectile.el create mode 100644 .gitignore diff --git a/.emacs.d/defaultcontent/defaultcontent.el b/.emacs.d/defaultcontent/defaultcontent.el new file mode 100644 index 0000000..338ee2b --- /dev/null +++ b/.emacs.d/defaultcontent/defaultcontent.el @@ -0,0 +1,366 @@ +;;; defaultcontent.el --- a templating tool. Fill new files with default content. +;; +;; Author : Christian Queinnec (University Paris 6) (UPMC) +;; Modified by: Dino Chiesa +;; Created : September 12, 1993 +;; Version : 1.4 +;; Keywords : template +;; X-URL : http://www.emacswiki.org/emacs/defaultcontent.el +;; Last-saved : <2012-March-24 02:34:42> + +;; Copyright (C) 1993-2001 by Christian Queinnec (University Paris 6) +;; + +;; This file is not part of GNU Emacs and is licensed differently. + +;;; Commentary: + +;;; The purpose of this package is to provide a default content for +;;; files. It extends the autoinsert package from Charlie Martin and +;;; took the idea of expanding parameters as in auto-template from +;;; Kevin Broadey (as suggested by Cedric Beust). It also allows to +;;; specify the initial position of the dot. + +;;; Whenever an unexistent file is visited, its initial content can be +;;; specified by a parameterized template stored in the directory +;;; dc-auto-insert-directory or by explicit evaluation of some +;;; specified forms. A single undo removes all this initialization. + +;;; To use it, add to your .emacs (taking care of load-path) +;;; (require 'defaultcontent) +;;; and it is ready (try to open the empty foobar.el file for example). + +;;; Repository: +;;; older version: +;;; ftp://ftp.cse.ohio-state.edu/pub/emacs-lisp/old-archive/misc/defaultcontent.el.Z +;;; Newer versions will be sent to the LCD Archive but may appear earlier +;;; on http://youpou.lip6.fr/queinnec/Miscellaneous/ +;;; Other Emacs packages in: +;;; http://youpou.lip6.fr/queinnec/WWW/elisp.html + +;;; Code: + +;;; Indicate where you store the default content of files. + +(defvar dc-auto-insert-directory "~/.el/defaultcontent" + "*Directory from which template files are taken. On +Windows, use forward slashes like: c:/foo/bar/baz ") + + +;;; A list of actions. You can insert the name of a file (which will +;;; be extracted from dc-auto-insert-directory) or a list of filenames +;;; (you'll be prompted to choose one among them) or a list of forms +;;; to be evaluated that might fill the newly created file. These +;;; actions may use the variables of the mode, use the name of the +;;; buffer etc. + +(defvar dc-auto-insert-alist + '(("\\.tex$" . "tex-insert.tex") + ("\\.c$" . "c-insert.c") + ("\\.h$" . "h-insert.h") + ("[I]?[Mm]akefile" . "makefile-insert") + ("\\.scm$" (dc-fill-initial-content-of-file)) + ("\\.el$" (dc-fill-initial-content-of-file)) + ("\\.bib$" . "bib-insert.bib") ) + "An Alist specifying text to insert by default into a new file. +Elements look like (REGEXP . FILENAME) or (REGEXP LISP-CODE ...); +if the new file's name matches REGEXP, then the file FILENAME is +inserted into the buffer or LISP-CODE is evaluated with the same goal. +Only the first matching element is effective." ) + +;;; Courtesy of Frederic Lepied +;;; Fetch customization by major-mode if not yet specified in +;;; dc-auto-insert-alist. + +(defvar dc-auto-insert-mode-alist + '((sh-mode . "sh-insert.sh") ) + "An Alist specifying text to insert by default into a new file. +Elements look like (MODE . FILENAME) or (MODE LISP-CODE ...); +if the new file's major mode MODE, then the file FILENAME is +inserted into the buffer or LISP-CODE is evaluated with the same goal. +Only the first matching element is effective. This list is tried +after `dc-auto-insert-alist'." ) + +;;; This function fills an empty file with: +;;; +--------------------------------- +;;; |### $ Id $ +;;; | +;;; |### end of +;;; +------------------------------ +;;; Where # is supposed to be the comment-start character. You can +;;; use it instead of having multiple templates. + +(defun dc-fill-initial-content-of-file () + "Create the initial content of a RCS-kept file appropriately ended." + (goto-char 0) + (insert comment-start)(insert comment-start)(insert comment-start) + (insert " \$Id\$\n\n")(insert comment-end) + (goto-char (point-max)) + (insert comment-start)(insert comment-start)(insert comment-start) + (insert " end of ")(insert (file-name-nondirectory buffer-file-name)) + (insert comment-end)(insert "\n") + (goto-char 0)(goto-line 2) + (message "Nature dislikes emptyness!") ) + +(defvar dc-initial-dot-position nil + "This variable defines, if not nil, the initial position of the dot. +It can be set by the @DOT@ pseudo-variable in a template." ) + +;;; Two possibilities exist whether one wants to be fast or slow (but +;;; more powerful). This was suggested by Luc Moreau +;;; . + +(defvar dc-fast-variable-handling t + "A boolean telling if variables are slowly recognized with a regexp +or quickly handled with a delimiting character." ) + +;;; File template are processed and every thing surrounded with double +;;; @ is replaced by its value. The variables to recognize and to +;;; expand and their associated actions is kept in the following +;;; Alist. In fact, the character that delimit variables is a +;;; programmable regexp. + +(defvar dc-variable-delimiter "\@[^@]*\@" + "Regexp to recognize variables to expand." ) + +;;; Use a single character to delimit file templates. + +(defvar dc-variable-border "@" + "Delimiting character for variables to expand." ) + +;; This alist allows to replace various keywords, aka "expandos", with +;; some elaborated value. For example, the expando FILENAME will expand +;; to the full name of the file. The BASEFILENAME will expand to the file +;; name without the qualifying directory. And so on. + +(defvar dc-expandos-alist + '(( "@BASEFILENAME@" (file-name-nondirectory buffer-file-name) ) + ( "@BASEFILENAMELESSEXTENSION@" + (dc--filename-remove-extension + (file-name-nondirectory buffer-file-name) ) ) + ( "@FILENAME@" buffer-file-name ) + ( "@DATE@" (current-time-string) ) + ( "@HOST@" (or (getenv "HOST") (getenv "COMPUTERNAME"))) + ( "@AUTHOR@" (capitalize (or (getenv "USER") (getenv "USERNAME")))) + ( "@COMMENT-START@" (if comment-start comment-start "") ) + ( "@COMMENT-END@" (if comment-end comment-end "") ) + ( "@DOT@" (setq dc-initial-dot-position (match-beginning 0)) + "" ) + + + ( "@\\(INSERT\\|INSERTFILE\\)(\\(.+\\))@" + (let ((filename + (buffer-substring-no-properties + (match-beginning 2) + (match-end 2)))) + (if (file-readable-p filename) + (with-temp-buffer + (insert-file-contents filename) + (buffer-substring-no-properties (point-min) (point-max))) + (concat "The file '" filename "' is not readable")))) + + ( "@ENV(\\(.+\\))@" (let ((varname + (buffer-substring-no-properties + (match-beginning 1) + (match-end 1)))) + (or (getenv varname) varname))) + + ( "@@" "@") + + ;; This expands custom elisp code. + ;; Courtesy of Luc Moreau: + ( "@LISP(\\(.*\\))@" (let (sexp value (here (point))) + (goto-char (match-beginning 0)) + (setq sexp (dc--read-closest-sexp)) + (if sexp (setq value (eval sexp))) + (goto-char here) + (if value value "") ) ) + ) + "An Alist specifying the variables to recognize and how to replace them. +Elements look like (REGEXP LISP-CODE ...). When a variable is recognized, +using dc-variable-delimiter, it is compared to the REGEXPs (if dc-fast- +-variable-handling is false) and once one is found, the associated forms +are evaluated and the result replaces the occurrence of the variable." ) + +;;; A small utility to remove filename extensions. + +(require 'thingatpt) + +(defun dc--read-closest-sexp () + "utility to read sexp at pt" + (thing-at-point 'sexp)) + + +(defun dc--filename-remove-extension (name &optional extension) + "Return NAME less its EXTENSION. If the extension is given as second +argument then it is an error for the extension not to be present." + (let* ((extension (if extension (regexp-quote extension) "\\.[^.]*")) + (regexp (concat "\\(.*\\)" extension "$")) ) + ;(message regexp)(sleep-for 10) + (if (string-match regexp name) + (substring name (match-beginning 1) (match-end 1)) + (error "No extension" name) ) ) ) + +;;; For instance, here is my default template for Perl files. It is stored +;;; as a file in the dc-auto-insert-alist directory. +;;; +------------------------- +;;; |#! /usr/local/bin/perl +;;; |@DOT@ +;;; |# end of @BASEFILENAME@ +;;; +------------------------ + +(defvar dc-show-unexpanded-variables t + "This variable shows, if true, the variables that cannot be expanded +by dc-auto-insert-file. Nevertheless, it slows down expansion but gives +you a chance to see bad variables." ) + +;;; The real function that does the real work ie it looks for variables +;;; and expands them. It may also notiy erroneous variables with the +;;; previous dc-show-unexpanded-variables boolean flag. + +(defun dc-expand-internal-variables (start) + "Replace @ things @ by their expansion in a freshly filled file." + (interactive (list 0)) + (goto-char start) + (let ((number-of-expanded-variables 0)) + (if dc-fast-variable-handling + ;; courtesy of Luc Moreau: + (while (search-forward dc-variable-border nil t) + (backward-char 1) + (let ((l dc-expandos-alist)) + (while (consp l) + (let ((regexp (car (car l))) + (forms (cdr (car l))) ) + (setq l (cdr l)) + ;; Search if it is a known variable + (if (looking-at regexp) + (let* ((the-first-match (match-data)) + (new (eval (cons 'progn forms))) ) + ;; restore the old match + (store-match-data the-first-match) + (replace-match new t t) + (setq number-of-expanded-variables + (+ 1 number-of-expanded-variables) ) + (setq l nil) ) + (if (null l) + (forward-char 1) ) ) ) ))) + ;; use regexp to recognize variables + (while (re-search-forward dc-variable-delimiter nil t) + (let ((the-first-match (match-data)) + (beg (match-beginning 0)) + (end (match-end 0)) ) + (goto-char beg) + (let ((l dc-expandos-alist)) + (while (consp l) + (let ((regexp (car (car l))) + (forms (cdr (car l))) ) + (setq l (cdr l)) + ;; Search if it is a known variable + (if (looking-at regexp) + (let (new) + (goto-char end) + (setq new (eval (cons 'progn forms))) + (setq number-of-expanded-variables + (+ 1 number-of-expanded-variables) ) + ;; restore the old match + (store-match-data the-first-match) + (replace-match "" t t) + (insert new) + (setq l nil) ) + (if (and (null l) dc-show-unexpanded-variables) + (progn + (goto-char (+ beg 1)) + (message "Cannot expand \"%s\"." + (buffer-substring beg end) ) ) + (sleep-for 1) ) ) ) ) ) ) ) ) + (message "Note: %s variable(s) expanded." + number-of-expanded-variables ) ) ) + +;;; This local variable tells if a file is new. It will be used by the +;;; dc-insert-auto-insert-file function to determine if the file was +;;; new or not. It cannot be made buffer-local since the correct +;;; buffer is still not present. So use a global variable. Note that +;;; an empty file is not immediately filled, this hook only records +;;; that it is fresh. Only a fresh file is filled but not an existing +;;; and empty file!!! + +(defvar dc-file-appears-to-be-new nil + "Global variable set to T if find-file-not-found-hooks was run. +Used by dc-insert-auto-insert-file to detect if a file is new." ) + +;;; Just mark the file as new since this is run from find-file-not-found-hooks +;;; but return () to continue to process the remaining hooks. + +(defun dc-mark-file-as-new () + ;;(message "Hmm... this is a new file.")(sit-for 1) + (setq dc-file-appears-to-be-new t) + () ) + +;;; This hook sets a boolean flag if the file is new. + +(add-hook 'find-file-not-found-hooks 'dc-mark-file-as-new) + +;;; This function is the hook that triggers the initial filling of an +;;; empty file. It scans the dc-auto-insert-alist to find an appropriate +;;; action, otherwise it does nothing. + +(defun dc-insert-auto-insert-file () + "Matches the visited file name against the elements of `dc-auto-insert-alist' +to determine the initial content of the visited file." + (interactive) + (let ((mfan dc-file-appears-to-be-new)) + ;;(message "Is this file new? %s!" mfan)(sit-for 1) + (if (and (or current-prefix-arg mfan) (= 0 (buffer-size))) + ;; the file is new and empty, so try to fill it. + (let ((alist dc-auto-insert-alist) + ;; remove backup suffixes from file name + (name (file-name-sans-versions buffer-file-name)) + (data nil) ) + ;; find first matching alist entry + (while (and (not data) alist) + (if (string-match (car (car alist)) name) + (setq data (cdr (car alist))) + (setq alist (cdr alist)))) + ;; Courtesy of Frederic Lepied + ;; else match a major mode alist entry + (if (not data) + (let ((pair (assoc major-mode dc-auto-insert-mode-alist))) + (if pair + (setq data (cdr pair))))) + ;; Courtesy of Stefan Reichör + ;; select template from a list with completion + (when (and data (listp data) (stringp (caar data))) + (setq data (completing-read + "Select template to insert: " + (mapcar (lambda (elem) (cons elem elem)) (car data))))) + ;; analyze data + (cond ((not data) + (message "No initial content specified!") ) + ;; insert the specified file + ((stringp data) + (let ((file (concat (file-name-as-directory dc-auto-insert-directory) data))) + (if (file-readable-p file) + (progn + (insert-file-contents file) + (setq dc-initial-dot-position 0) + (dc-expand-internal-variables 0) + (goto-char dc-initial-dot-position) ) + (progn + (message "Auto-insert: Template file %s not found" file) + (sleep-for 1) ) ) ) ) + ;; evaluate the forms + (t (eval (cons 'progn data))) ) + ;;(message "Initialization done")(sit-for 1) + ;; reset this global variable in case the file is revisited. + (setq dc-file-appears-to-be-new nil) ) ) ) ) + +;;; Run after all other hooks to benefit from them and particularly of +;;; the correct settings for comment-start and comment-end variables. + +(add-hook 'find-file-hooks 'dc-insert-auto-insert-file t) + +;;; So it can be required. + +(provide 'defaultcontent) + +;;; end of defaultcontent.el diff --git a/.emacs.d/defaultcontent/templates/c-insert.c b/.emacs.d/defaultcontent/templates/c-insert.c new file mode 100644 index 0000000..6d6e54d --- /dev/null +++ b/.emacs.d/defaultcontent/templates/c-insert.c @@ -0,0 +1,14 @@ +/* + * Filename: @BASEFILENAME@ + * + * Description: + * + * + * Version: + * Created: @DATE@ + * Revision: None + * Author: @AUTHOR@ + * + */ + +@CURSOR@ diff --git a/.emacs.d/defaultcontent/templates/pl-insert.pl b/.emacs.d/defaultcontent/templates/pl-insert.pl new file mode 100644 index 0000000..58cf742 --- /dev/null +++ b/.emacs.d/defaultcontent/templates/pl-insert.pl @@ -0,0 +1,17 @@ +#!/usr/bin/env perl + +######################################################################## +# Filename: @BASEFILENAME@ +# Description: +# +# Version: +# Created: @DATE@ +# Revision: None +# Author: @AUTHOR@ +######################################################################## + +use strict; +use warnings; +use utf8; + +@CURSOR@ diff --git a/.emacs.d/defaultcontent/templates/pm-insert.pm b/.emacs.d/defaultcontent/templates/pm-insert.pm new file mode 100644 index 0000000..ffca440 --- /dev/null +++ b/.emacs.d/defaultcontent/templates/pm-insert.pm @@ -0,0 +1,36 @@ +package @CURSOR@; + +######################################################################## +# Filename: @BASEFILENAME@ +# Description: +# +# Version: +# Created: @DATE@ +# Revision: None +# Author: @AUTHOR@ +######################################################################## + +use strict; +use warnings; +use utf8; + + +our $VERSION = ''; + +=head1 + +=head1 DESCRIPTION + + + +=head2 FUNCTIONS + +=cut + + +=head1 AUTHOR + +@AUTHOR@ + +=cut +1; diff --git a/.emacs.d/defaultcontent/templates/rkt-insert.rkt b/.emacs.d/defaultcontent/templates/rkt-insert.rkt new file mode 100644 index 0000000..9b527ce --- /dev/null +++ b/.emacs.d/defaultcontent/templates/rkt-insert.rkt @@ -0,0 +1,11 @@ +#lang @CURSOR@racket +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Filename: @BASEFILENAME@ +; Description: +; +; Version: +; Created: @DATE@ +; Revision: None +; Author: @AUTHOR@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + diff --git a/.emacs.d/init.el b/.emacs.d/init.el new file mode 100644 index 0000000..cff2374 --- /dev/null +++ b/.emacs.d/init.el @@ -0,0 +1,56 @@ +(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. + '(calendar-column-width 3) + '(calendar-day-digit-width 2) + '(custom-safe-themes + (quote + ("4639288d273cbd3dc880992e6032f9c817f17c4a91f00f3872009a099f5b3f84" "e677cc0546b0c129fda0675354245513543a56671d9747c81d335505f699000b" "3f7b4c736ffe0a373b06ce3d97c26b9e559bbc4f9b2e50e4b53143f0b0d7eb2c" "d8dc153c58354d612b2576fea87fe676a3a5d43bcc71170c62ddde4a1ad9e1fb" "51277c9add74612c7624a276e1ee3c7d89b2f38b1609eed6759965f9d4254369" "b571f92c9bfaf4a28cb64ae4b4cdbda95241cd62cf07d942be44dc8f46c491f4" default))) + '(org-trello-current-prefix-keybinding "C-c o") + '(package-selected-packages + (quote + (powershell use-package flx flx-ido ac-c-headers ac-html ac-html-bootstrap auto-complete-exuberant-ctags brutal-theme python rainbow-delimiters racket-mode swift-helpful swift-mode swift-playground-mode swift3-mode project-shells projectile-codesearch projectile-rails projectile-variable purple-haze-theme org-journal org-journal-list org-kindle org-multi-wiki org-projectile org-wc 0blayout ego org-analyzer org-board org-d20 org-ac org-beautify-theme org-brain org-clock-today org-gcal org-static-blog org-sync org-sync-snippets org-timeline org-trello org powerline-evil yaml-mode yasnippet-classic-snippets yasnippet-snippets snippet smex qt-pro-mode qml-mode paradox osx-trash osx-plist osx-org-clock-menubar osx-lib osx-dictionary osx-clipboard osx-browse nixpkgs-fmt nix-mode neotree magit haskell-mode flycheck evil-surround evil-smartparens evil-org evil-leader elscreen elpa-mirror elixir-yasnippets elixir-mode editorconfig-custom-majormode diminish-buffer diminish auto-complete-distel auto-complete-c-headers arduino-mode airline-themes ac-clang abyss-theme))) + '(paradox-automatically-star nil)) + + +(setq inhibit-splash-screen t) + +(add-to-list 'load-path "~/.emacs.d/loadins") +(when (eq system-type 'darwin) + (load "darwin.el")) +(load "packages.el") +(load "evil-bindings.el") +(when (file-readable-p "~/.emacs.d/loadins/private.el") + (load "private.el")) +(load "org-vars.el") +(load "backups.el") +(load "autoinsert-options.el") +(load "haskell-hooks.el") +(load "perl-hooks.el") +(load "hooks.el") +(load "projectile.el") + +(setq text-width 4 + standard-indent 4 + indent-tabs-mode t + c-basic-style "k&r" + c-basic-offset 4 + ) + +(load-theme 'abyss) +(powerline-default-theme) +(load-theme 'airline-molokai) +(elscreen-start) +(evil-mode 1) +(editorconfig-mode 1) +(projectile-mode +1) +(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. + '(default ((t (:inherit nil :stipple nil :background "#050000" :foreground "#bbe0f0" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 181 :width normal :foundry "nil" :family "Source Code Pro")))) + '(bold ((t (:weight bold)))) + '(variable-pitch ((t (:inherit nil :stipple nil :background "#050000" :foreground "#bbe0f0" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 181 :width normal :foundry "nil" :family "Source Sans Pro"))))) diff --git a/.emacs.d/loadins/autoinsert-options.el b/.emacs.d/loadins/autoinsert-options.el new file mode 100644 index 0000000..d964355 --- /dev/null +++ b/.emacs.d/loadins/autoinsert-options.el @@ -0,0 +1,28 @@ +;;; autoinsert-options.el - auto expansions and template path for init.el + +;; Author: Rachel Fae Fox +;; URL: https://git.foxiepa.ws/foxiepaws/dotfiles/ + +(setq dc-expandos-alist + '(( "@BASEFILENAME@" (file-name-nondirectory buffer-file-name) ) + ( "@BASEFILENAMELESSEXTENSION@" + (dc--filename-remove-extension + (file-name-nondirectory buffer-file-name) ) ) + ( "@FILENAME@" buffer-file-name ) + ( "@DATE@" (current-time-string) ) + ( "@HOST@" (or (getenv "HOST") (getenv "COMPUTERNAME"))) + ( "@AUTHOR@" "Rachel Fae Fox (foxiepaws),fox@foxiepa.ws") + ( "@COMMENT-START@" (if comment-start comment-start "") ) + ( "@COMMENT-END@" (if comment-end comment-end "") ) + ( "@CURSOR@" (setq dc-initial-dot-position (match-beginning 0)) + "" )) + dc-auto-insert-alist + '( + ("\\.c$" . "c-insert.c") + ("\\.h$" . "c-insert.c") + ("\\.cpp$". "c-insert.c") + ("\\.hpp$". "c-insert.c") + ("\\.pl$" . "pl-insert.pl") + ("\\.pm$" . "pm-insert.pm") + ("\\.rkt" . "rkt-insert.rkt")) + dc-auto-insert-directory "~/.emacs.d/defaultcontent/templates/") diff --git a/.emacs.d/loadins/backups.el b/.emacs.d/loadins/backups.el new file mode 100644 index 0000000..76633ed --- /dev/null +++ b/.emacs.d/loadins/backups.el @@ -0,0 +1,15 @@ +;;; backups.el -- backup settings for init.el + +;; Author: Rachel Fae Fox +;; URL: https://git.foxiepa.ws/foxiepaws/dotfiles/ + +(setq + backup-by-copying t + delete-old-versions t + kept-new-versions 6 + kept-old-versions 2 + version-control t) +(setq backup-directory-alist + `((".*" . ,temporary-file-directory))) +(setq auto-save-file-name-transforms + `((".*" ,temporary-file-directory t))) diff --git a/.emacs.d/loadins/darwin.el b/.emacs.d/loadins/darwin.el new file mode 100644 index 0000000..df0d429 --- /dev/null +++ b/.emacs.d/loadins/darwin.el @@ -0,0 +1,17 @@ + +(when (eq system-type 'darwin) + (setenv "PATH" "/Users/rachel/.nix-profile/bin:/usr/local/bin:/bin:/usr/bin/:/sbin:/usr/sbin" t) + (setq mac-right-option-modifier 'none) + (setq mac-option-modifier 'meta) + (setq mac-command-modifier 'super) + (setq ns-use-native-fullscreen t) + (setq frame-resize-pixelwise t) + (menu-bar-mode -1) + (tool-bar-mode -1) + (scroll-bar-mode -1) + (toggle-frame-fullscreen) + (defun transparency (value) + "Sets the transparency of the frame window. 0=transparent/100=opaque" + (interactive "nTransparency Value 0 - 100 opaque:") + (set-frame-parameter (selected-frame) 'alpha value)) + ) diff --git a/.emacs.d/loadins/evil-bindings.el b/.emacs.d/loadins/evil-bindings.el new file mode 100644 index 0000000..4528852 --- /dev/null +++ b/.emacs.d/loadins/evil-bindings.el @@ -0,0 +1,22 @@ +;; evil mode related config +(setq evil-shift-width 4) +(global-evil-surround-mode 1) +(global-evil-leader-mode) + +;; evil keys +;(define-key evil-normal-state-map [tab] 'indent-for-tab-command) +;(define-key evil-visual-state-map [tab] 'align) +(define-key evil-normal-state-map (kbd "C-w t") 'elscreen-create) ;creat tab +(define-key evil-normal-state-map (kbd "C-w x") 'elscreen-kill) ;kill tab +(define-key evil-normal-state-map "gT" 'elscreen-previous) ;previous tab +(define-key evil-normal-state-map "gt" 'elscreen-next) ;next tab + +(global-set-key (kbd "C-x C-b") 'ibuffer) +(define-key ibuffer-mode-map (kbd "j") 'next-line) +(define-key ibuffer-mode-map (kbd "k") 'previous-line) +(global-set-key (kbd "") 'neotree-toggle) + +(global-set-key (kbd "M-x") 'smex) + +(define-key projectile-mode-map (kbd "s-p") 'projectile-command-map) +(define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map) diff --git a/.emacs.d/loadins/graphical.el b/.emacs.d/loadins/graphical.el new file mode 100644 index 0000000..8933e04 --- /dev/null +++ b/.emacs.d/loadins/graphical.el @@ -0,0 +1,11 @@ +(when (display-graphic-p) + (require 'powerline) ; pretty <3 + (require 'airline-themes) ; pretty pretty <3 + (powerline-default-theme) + (load-theme 'airline-molokai) + +; (add-to-list 'default-frame-alist +; '(font . "OpenDyslexicMono-18")) +; ) + +; test diff --git a/.emacs.d/loadins/haskell-hooks.el b/.emacs.d/loadins/haskell-hooks.el new file mode 100644 index 0000000..f2f625d --- /dev/null +++ b/.emacs.d/loadins/haskell-hooks.el @@ -0,0 +1,25 @@ +;; haskell is kinda a lot of stuff +(add-hook 'haskell-mode-hook 'turn-on-haskell-indent) +(add-hook 'haskell-mode-hook + (lambda () + (flycheck-mode))) +(eval-after-load "align" + '(add-to-list 'align-rules-list + '(haskell-types + (regexp . "\\(\\s-+\\)\\(::\\|∷\\)\\s-+") + (modes quote (haskell-mode literate-haskell-mode))))) +(eval-after-load "align" + '(add-to-list 'align-rules-list + '(haskell-assignment + (regexp . "\\(\\s-+\\)=\\s-+") + (modes quote (haskell-mode literate-haskell-mode))))) +(eval-after-load "align" + '(add-to-list 'align-rules-list + '(haskell-arrows + (regexp . "\\(\\s-+\\)\\(->\\|→\\)\\s-+") + (modes quote (haskell-mode literate-haskell-mode))))) +(eval-after-load "align" + '(add-to-list 'align-rules-list + '(haskell-left-arrows + (regexp . "\\(\\s-+\\)\\(<-\\|←\\)\\s-+") + (modes quote (haskell-mode literate-haskell-mode))))) diff --git a/.emacs.d/loadins/hooks.el b/.emacs.d/loadins/hooks.el new file mode 100644 index 0000000..cd47440 --- /dev/null +++ b/.emacs.d/loadins/hooks.el @@ -0,0 +1,38 @@ +;;; hooks.el -- misc hooks for init.el + +;; Author: Rachel Fae Fox +;; URL: https://git.foxiepa.ws/foxiepaws/dotfiles/ + + +(add-hook 'racket-mode-hook + (lambda () + (linum-mode) + (flycheck-mode))) + +(add-hook 'c-mode-hook + (lambda () + (linum-mode) + (flycheck-mode))) + + +;; we don't need to see /every/ minor mode. +(add-hook 'auto-fill-mode-hook + (lambda () + (diminish 'auto-fill-function))) ; it is function not mode + +(add-hook 'paredit-mode-hook + (lambda () + (diminish 'paredit-mode))) + +(diminish 'undo-tree-mode) + +(add-hook 'editorconfig-custom-hooks + 'editorconfig-custom-majormode) + +; fix fixed pitch font things. +(add-hook 'calendar-mode-hook + (lambda () + (buffer-face-set 'fixed-pitch))) +(add-hook 'ibuffer-mode-hook + (lambda () + (buffer-face-set 'fixed-pitch))) diff --git a/.emacs.d/loadins/org-vars.el b/.emacs.d/loadins/org-vars.el new file mode 100644 index 0000000..75a8a98 --- /dev/null +++ b/.emacs.d/loadins/org-vars.el @@ -0,0 +1,38 @@ + +;;; org-vars.el - org mode settings and hooks for init.el + +;; Author: Rachel Fae Fox +;; URL: https://git.foxiepa.ws/foxiepaws/dotfiles/ + +(setq org-log-done t + org-agenda-files(list "~/Documents/org/tasks.org" "~/Projects/Home/shared-org/shared.org" "~/Projects/CRITR/tasks/critr.org") + org-enforce-todo-dependencies t + org-enforce-todo-checkbox-dependencies t + org-element-use-cache nil) + + +(setq org-static-blog-publish-title "Rachel's Blog") +(setq org-static-blog-publish-url "https://foxiepa.ws/~rachel/blog/") +(setq org-static-blog-publish-directory "~/Projects/blog/pub/") +(setq org-static-blog-posts-directory "~/Projects/blog/posts/") +(setq org-static-blog-drafts-directory "~/Projects/blog/drafts/") +(setq org-static-blog-enable-tags t) +(setq org-static-blog-page-header +" + + +") +(setq org-static-blog-page-preamble +"") +(setq org-static-blog-page-postamble +"") + +(add-hook 'org-mode-hook + (lambda () + (auto-fill-function) + (flyspell-mode) + (buffer-face-set 'variable-pitch))) diff --git a/.emacs.d/loadins/packages.el b/.emacs.d/loadins/packages.el new file mode 100644 index 0000000..a23151b --- /dev/null +++ b/.emacs.d/loadins/packages.el @@ -0,0 +1,26 @@ +(add-to-list 'load-path (expand-file-name "~/.emacs.d/defaultcontent/")) +(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3" + ) +(require 'package) +(add-to-list 'package-archives + '("melpa" . "https://melpa.org/packages/") t) +(package-initialize) + +(require 'diminish) +(require 'evil) ; because otherwise emacs is unusable :V +(require 'evil-leader) +(require 'evil-surround) ; <33 buttsaver! +(require 'evil-smartparens) ; we want smartparens to work under evil +(require 'evil-org) ; we want org mode to be usable under evil +(require 'ibuffer) ; +(require 'smex) ; we still use M-x, lets make it a little nicer +(require 'elscreen) ; tabs are really nice +(require 'org) +(require 'flycheck) ; syntax checking and linting +(require 'defaultcontent) +(require 'neotree) +(require 'editorconfig) +(require 'editorconfig-custom-majormode) +(require 'powerline) ; pretty <3 +(require 'airline-themes) ; pretty pretty <3 +(require 'projectile) diff --git a/.emacs.d/loadins/perl-hooks.el b/.emacs.d/loadins/perl-hooks.el new file mode 100644 index 0000000..d2a0a81 --- /dev/null +++ b/.emacs.d/loadins/perl-hooks.el @@ -0,0 +1,28 @@ +;; perl-mode is rubbish (imo) +(defalias 'perl-mode 'cperl-mode) + +; tell Flycheck to actually use our local perl. +; TODO: Improve this so that it can take in a perl version. +(defun do-flycheck-perlbrew () + (let ((userdir (expand-file-name "~/"))) + (setq + flycheck-perl-executable (concat userdir "perl5/perlbrew/perls/perl-5.26.1/bin/perl")) + (setq + flycheck-perl-include-path + (list + (concat userdir "perl5/perlbrew/perls/perl-5.26.1/lib/5.26.1") + (concat userdir "perl5/perlbrew/perls/perl-5.26.1/lib/site_perl/5.26.1") + (when (eq system-type 'darwin) + (concat userdir "perl5/perlbrew/perls/perl-5.26.1/lib/5.26.1/darwin-2level") + (concat userdir "perl5/perlbrew/perls/perl-5.26.1/lib/site_perl/5.26.1/darwin-2level")) + )))) + +;; hooks per major-mode +;; perl file hooks +(add-hook 'cperl-mode-hook + (lambda () + (linum-mode) + (cperl-set-style "PerlStyle") + (flycheck-mode) + (do-flycheck-perlbrew) + )) diff --git a/.emacs.d/loadins/projectile.el b/.emacs.d/loadins/projectile.el new file mode 100644 index 0000000..52173dc --- /dev/null +++ b/.emacs.d/loadins/projectile.el @@ -0,0 +1,6 @@ +;;; projectile.el -- projectile settings and hooks for init.el + +;; Author: Rachel Fae Fox +;; URL: https://git.foxiepa.ws/foxiepaws/dotfiles/ + +(setq projectile-switch-project-action 'neotree-projectile-action) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6b56c70 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.DS_STORE +*~