emacs changes

master
Rachel Fae Fox 2022-11-15 16:40:46 -05:00
parent 9c6c248436
commit 7f5fa583d2
21 changed files with 342 additions and 799 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "emacs.d/snippets"]
path = emacs.d/snippets
url = https://git.foxiepa.ws/foxiepaws/emacs-snippets

View File

@ -1,366 +0,0 @@
;;; defaultcontent.el --- a templating tool. Fill new files with default content.
;;
;; Author : Christian Queinnec (University Paris 6) (UPMC)
;; Modified by: Dino Chiesa <dpchiesa@hotmail.com>
;; 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 <Frederic.Lepied@sugix.frmug.fr.net>
;;; 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 <filename>
;;; +------------------------------
;;; 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
;;; <moreau@montefiore.ulg.ac.be>.
(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 <Frederic.Lepied@sugix.frmug.fr.net>
;; 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 <xsteve@riic.at>
;; 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

View File

@ -1,14 +0,0 @@
/*
* Filename: @BASEFILENAME@
*
* Description:
*
*
* Version:
* Created: @DATE@
* Revision: None
* Author: @AUTHOR@
*
*/
@CURSOR@

View File

@ -1,17 +0,0 @@
#!/usr/bin/env perl
########################################################################
# Filename: @BASEFILENAME@
# Description:
#
# Version:
# Created: @DATE@
# Revision: None
# Author: @AUTHOR@
########################################################################
use strict;
use warnings;
use utf8;
@CURSOR@

View File

@ -1,36 +0,0 @@
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;

View File

@ -1,11 +0,0 @@
#lang @CURSOR@racket
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Filename: @BASEFILENAME@
; Description:
;
; Version:
; Created: @DATE@
; Revision: None
; Author: @AUTHOR@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View File

@ -1,51 +1,350 @@
:;; -*- origami-fold-style: triple-braces -*-
; customise {{{
(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
("3f7b4c736ffe0a373b06ce3d97c26b9e559bbc4f9b2e50e4b53143f0b0d7eb2c" "45aa5096f5844cc95ecb8cb144b0597baaccfa56f6b44a32f9a12b2431a1d409" 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)
(menu-bar-mode -1)
(tool-bar-mode -1)
(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"))
(when (file-readable-p "~/.emacs.d/local.el")
(load "local.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")
(load "text-vars.el")
(load "graphical.el")
(load "themeing.el")
(elscreen-start)
(evil-mode 1)
(editorconfig-mode 1)
(projectile-mode +1)
'("9e22d3e0196f248120d200012f4983bfb68ed322e294199a30d16c45b2dee99b" "3f7b4c736ffe0a373b06ce3d97c26b9e559bbc4f9b2e50e4b53143f0b0d7eb2c" default))
'(safe-local-variable-values '((origami-fold-style . triple-braces)))
'(tool-bar-mode nil)
'(warning-suppress-log-types '(((unlock-file)) ((unlock-file)) ((unlock-file))))
'(warning-suppress-types '(((unlock-file)) ((unlock-file)))))
(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 "#000000" :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 "#000000" :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")))))
'(default ((t (:family "Source Code Pro" :foundry "ADBO" :slant normal :weight normal :height 203 :width normal)))))
;}}}
; bootstrap straight.el {{{
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 5))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
;;}}}
; packages {{{
(straight-use-package 'use-package)
(setq straight-use-package-by-default t)
; org needs to be immidiately after bootstrap or it errors.
(use-package org
:config
(setq org-log-done t
org-enforce-todo-dependencies t
org-enforce-todo-checkbox-dependencies t
org-element-use-cache nil))
; convenience {{{
(use-package diminish)
(use-package smex
:bind
(("M-x" . 'smex)))
(use-package rainbow-delimiters)
(use-package ibuffer
:bind
(("C-x C-b" . 'ibuffer)
:map ibuffer-mode-map
("j" . 'next-line)
("k" . 'previous-line)))
(use-package undo-tree
:diminish 'undo-tree-mode
:init
(global-undo-tree-mode 1))
(use-package origami
:config
(global-origami-mode))
(use-package neotree
:disabled
:bind (("<f11>" . 'neotree-toggle)))
(use-package elscreen
:after evil
:config
(elscreen-start)
:bind
(
:map evil-normal-state-map
("C-w t" . 'elscreen-create)
("C-w x" . 'elscreen-kill)
("gT" . 'elscreen-previous)
("gt" . 'elscreen-next)))
(use-package treemacs
:bind
(("<f11>" . 'treemacs)))
(use-package avy)
; }}}
; evil {{{
(use-package evil
:init
(progn
(setq evil-undo-system 'undo-tree)
(setq evil-want-keybinding nil)
)
:config
(progn
(evil-mode 1)
(setq evil-shift-width 4)))
(use-package evil-leader
:after evil
:config
(progn
(global-evil-leader-mode)
))
(use-package evil-surround
:after evil
:config
(progn
(global-evil-surround-mode 1)))
(use-package evil-smartparens
:after evil)
(use-package evil-org)
(use-package evil-collection
:straight t
:after evil
:ensure t
:config
(evil-collection-init))
(use-package treemacs-evil
:after (treemacs evil)
:ensure t)
; }}}
; project management {{{
(use-package magit)
(use-package treemacs-magit
:after (treemacs magit)
:ensure t)
(use-package editorconfig)
(use-package projectile
:config
(progn (projectile-mode +1))
:bind
(
:map projectile-mode-map
("s-p" . 'projectile-command-map)
("C-c p" . 'projectile-command-map)))
(use-package treemacs-projectile
:after (treemacs projectile)
:ensure t)
; }}}
; emacs lisp {{{
(use-package el-patch)
; }}}
; Theming {{{
(use-package molokai-theme
:config
(load-theme 'molokai t))
(use-package abyss-theme
:disabled
:config
(load-theme 'abyss t))
(use-package uwu-theme
:disabled
:config
(load-theme 'uwu t)
:straight (uwu-theme
:host github
:repo "kborling/uwu-theme"))
(use-package powerline
:config
(powerline-default-theme))
(use-package airline-themes
:after powerline
:config
(progn
(load-theme 'airline-molokai)))
; }}}
; LSP {{{
(use-package lsp-mode)
(use-package lsp-ui)
(use-package ccls
:disabled
:after lsp
:hook ((c-mode c++-mode objc-mode cuda-mode) .
(lambda () (require 'ccls) (lsp))))
(use-package company-lsp)
(use-package lsp-treemacs)
; }}}
; Editing {{{
(use-package flycheck)
(use-package company)
(use-package company-quickhelp)
(use-package yasnippet)
; }}}
; languages {{{
(use-package elixir-mode)
(use-package racket-mode)
(use-package rust-mode)
(use-package nix-mode)
(use-package dap-mode)
; }}}
(use-package dashboard
:init
(setq dashboard-set-footer nil)
:custom
(dashboard-startup-banner 'logo)
(dashboard-items '((recents . 5)
(projects . 5)
(agenda . 5)))
(initial-buffer-choice (lambda () (get-buffer-create "*dashboard*")))
:config
(dashboard-setup-startup-hook))
(use-package which-key
:config (which-key-mode))
(use-package easy-jekyll
:init
(setq easy-jekyll-basedir "~/Projects/blog/")
(setq easy-jekyll-url "https://foxiepa.ws")
(setq easy-jekyll-sshdomain "foxiepa.ws")
(setq easy-jekyll-root "/srv/www/foxiepa.ws/htdocs/")
(setq easy-jekyll-previewtime "300"))
;;}}}
; graphical mode {{{
(when (display-graphic-p)
(tool-bar-mode -1)
(scroll-bar-mode -1)
(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)))
; }}}
; mac settings {{{
(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) ; we have a global menu so this is uneeded
(toggle-frame-fullscreen))
;;}}}
; programming {{{
; emacs lisp {{{
(add-hook 'emacs-lisp-mode-hook
(lambda ()
(linum-mode)
(setq comment-column 0)))
;;}}}
; perl {{{
(defalias 'perl-mode 'cperl-mode)
; tell Flycheck to actually use our local perl. {{{
(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"))
))))
;}}}
;; perl file hooks
(add-hook 'cperl-mode-hook
(lambda ()
(linum-mode)
(cperl-set-style "PerlStyle")
(flycheck-mode)
(do-flycheck-perlbrew)
))
;}}}
; haskell {{{
(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)))))
;}}}
; racket {{{
(add-hook 'racket-mode-hook
(lambda ()
(linum-mode)
(flycheck-mode)))
;}}}
; c / c++ {{{
(setq c-basic-style "k&r"
c-basic-offset 4)
(add-hook 'c-mode-hook
(lambda ()
(linum-mode)
(flycheck-mode)))
(add-hook 'c++-mode-hook
(lambda ()
(linum-mode)
(flycheck-mode)))
(add-hook 'c-mode-hook #'lsp)
(add-hook 'c++-mode-hook #'lsp)
; QT {{{
;}}}
;}}}
; nix {{{
;(add-to-list 'lsp-language-id-configuration '(nix-mode . "nix"))
;(lsp-register-client
;(make-lsp-client :new-connection (lsp-stdio-connection '("rnix-lsp"))
; :major-modes '(nix-mode)
; :server-id 'nix))
; }}}
;}}}
; org mode {{{
(add-hook 'org-mode-hook
(lambda ()
(auto-fill-function)
(flyspell-mode)))
;}}}
; basic editing {{{
(setq text-width 4
standard-indent 4
indent-tabs-mode t
enable-local-variables t
)
;}}}
; Backups and undotree {{{
(setq backup-directory-alist
`(("." . "~/.emacs.d/saves")))
(setq undo-tree-history-directory-alist
`(("." . "~/.emacs.d/undo-tree")))
(setq auto-save-file-name-transforms
`((".*" "~/.emacs.d/auto-saves/" t)))
(setq backup-by-copying t)
(setq delete-old-versions t
kept-new-versions 3
kept-old-versions 2
version-control t)
;}}}

View File

@ -1,28 +0,0 @@
;;; autoinsert-options.el - auto expansions and template path for init.el
;; Author: Rachel Fae Fox <fox@foxiepa.ws>
;; 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/")

View File

@ -1,15 +0,0 @@
;;; backups.el -- backup settings for init.el
;; Author: Rachel Fae Fox <fox@foxiepa.ws>
;; 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)))

View File

@ -1,13 +0,0 @@
(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)
)

View File

@ -1,22 +0,0 @@
;; 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 "<f11>") '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)

View File

@ -1,15 +0,0 @@
(when (display-graphic-p)
(require 'powerline) ; pretty <3
(require 'airline-themes) ; pretty pretty <3
(powerline-default-theme)
(load-theme 'airline-molokai)
(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))
)
; (add-to-list 'default-frame-alist
; '(font . "OpenDyslexicMono-18"))
; )
; test

View File

@ -1,25 +0,0 @@
;; 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)))))

View File

@ -1,38 +0,0 @@
;;; hooks.el -- misc hooks for init.el
;; Author: Rachel Fae Fox <fox@foxiepa.ws>
;; 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)))

View File

@ -1,38 +0,0 @@
;;; org-vars.el - org mode settings and hooks for init.el
;; Author: Rachel Fae Fox <fox@foxiepa.ws>
;; 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
"<meta name=\"author\" content=\"Rachel Fae Fox\">
<meta name=\"referrer\" content=\"no-referrer\">
<link href= \"static/style.css\" rel=\"stylesheet\" type=\"text/css\" />
<link rel=\"icon\" href=\"static/favicon.ico\">")
(setq org-static-blog-page-preamble
"<div class=\"header\">
<a href=\"https://foxiepa.ws/~rachel/bloog/\">Rachel's Blog</a>
</div>")
(setq org-static-blog-page-postamble
"<div id=\"archive\">
<a href=\"https://foxipa.ws/~rachel/archive.html\">Other posts</a>
</div>")
(add-hook 'org-mode-hook
(lambda ()
(auto-fill-function)
(flyspell-mode)
(buffer-face-set 'variable-pitch)))

View File

@ -1,26 +0,0 @@
(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)

View File

@ -1,28 +0,0 @@
;; 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)
))

View File

@ -1,6 +0,0 @@
;;; projectile.el -- projectile settings and hooks for init.el
;; Author: Rachel Fae Fox <fox@foxiepa.ws>
;; URL: https://git.foxiepa.ws/foxiepaws/dotfiles/
(setq projectile-switch-project-action 'neotree-projectile-action)

View File

@ -1,6 +0,0 @@
(setq text-width 4
standard-indent 4
indent-tabs-mode t
c-basic-style "k&r"
c-basic-offset 4
)

View File

@ -1,11 +0,0 @@
(powerline-default-theme)
(load-theme 'airline-molokai)
(load-theme 'abyss)
;(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")))))

View File

@ -1,44 +0,0 @@
;;; install-packages.el
;; Author: Rachel Fae Fox <fox@foxiepa.ws>
;; URL: https://git.foxiepa.ws/foxiepaws/dotfiles/
(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)
(defvar eyecandy '(smex abyss-theme airline-themes powerline powerline-evil
rainbow-delimiters purple-haze-theme org-beautify-theme))
(defvar osx '(osx-plist osx-dictionary osx-clipboard osx-browse swift-mode
swift-playground-mode swift3-mode swift-helpful osx-lib osx-trash))
(defvar orgstuff '(org org-journal org-journal-list org-kindle org-multi-wiki org-projectile org-wc ego
org-analyzer org-board org-d20 org-ac
org-brain org-clock-today org-gcal org-static-blog org-sync
org-sync-snippets org-timeline org-trello))
(defvar langs '(python racket-mode yaml-mode nixpkgs-fmt nix-mode haskell-mode elixir-mode
arduino-mode qml-mode qt-pro-mode))
(defvar evil '(evil evil-leader evil-org evil-smartparens evil-surround evil-collection))
(defvar extras '(magit elscreen projectile flx flx-ido diminish diminish-buffer neotree
paradox use-package editorconfig editorconfig-custom-majormode))
(defvar progtools '(flycheck ac-c-headers ac-html ac-html-bootstrap elixir-yasnippets ac-clang
auto-complete-distel auto-complete-c-headers auto-complete-exuberant-ctags
yasnippet-classic-snippets yasnippet-snippets snippet))
(defvar projectmanagement '(projectile projectile-rails projectile-codesearch projectile-variable project-shells))
(let ((my-packages (append eyecandy osx orgstuff langs evil extras progtools projectmanagement)))
(defun my-packages-installed-p ()
(cl-loop for p in my-packages
when (not (package-installed-p p)) do (cl-return nil)
finally (cl-return t)))
(unless (my-packages-installed-p)
;; check for new packages (package versions)
(package-refresh-contents)
;; install the missing packages
(dolist (p my-packages)
(when (not (package-installed-p p))
(package-install p)))))