2019-10-09 13:13:56 +02:00
|
|
|
;;; dotfiles.el --- Elisp to make dotfile management -*- lexical-binding: t -*-
|
|
|
|
;; Author: William Carroll <wpcarro@gmail.com>
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
;; Quickly edit commonly used files.
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
2020-01-08 16:16:26 +01:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; Dependencies
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
2019-10-09 13:13:56 +02:00
|
|
|
(require 'macros)
|
2020-01-08 16:16:26 +01:00
|
|
|
(require 'f)
|
2019-10-09 13:13:56 +02:00
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; API
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
|
|
(defconst dotfiles/install-kbds? t
|
|
|
|
"When t, install the keybindings.")
|
|
|
|
|
|
|
|
(defconst dotfiles/whitelist
|
|
|
|
'(("compton" . "~/.config/compton.conf")
|
2020-01-15 16:57:05 +01:00
|
|
|
("dotfiles" . "~/dotfiles/")
|
2019-10-09 13:13:56 +02:00
|
|
|
("functions" . "~/functions.zsh")
|
|
|
|
("aliases" . "~/aliases.zsh")
|
|
|
|
("variables" . "~/variables.zsh")
|
|
|
|
("Xresources" . "~/.Xresources.shared")
|
2020-01-08 16:14:03 +01:00
|
|
|
("xsession" . "~/.xsessionrc.shared")
|
2019-10-09 13:13:56 +02:00
|
|
|
("tmux" . "~/.tmux.conf")
|
|
|
|
("zshrc" . "~/.zshrc")
|
2020-01-08 16:14:03 +01:00
|
|
|
("config.fish" . "~/.config/fish/config.fish")
|
2019-10-09 13:13:56 +02:00
|
|
|
("configuration.nix" . "~/Dropbox/programming/nixify/configuration.nix")
|
|
|
|
("init.el" . "~/.emacs.d/init.el")
|
|
|
|
("init.vim" . "~/.config/nvim/init.vim"))
|
|
|
|
"Dotfiles that I commonly edit.")
|
|
|
|
|
|
|
|
(defun dotfiles/edit ()
|
|
|
|
"Select a dotfile from ivy and edit it in an Emacs buffer."
|
|
|
|
(interactive)
|
|
|
|
(ivy-read
|
|
|
|
"Dotfile: "
|
|
|
|
dotfiles/whitelist
|
|
|
|
:action (>> cdr find-file)))
|
|
|
|
|
2020-01-08 16:16:26 +01:00
|
|
|
(defun dotfiles/find-emacs-file (name)
|
|
|
|
"Call `find-file' on NAME located in dotfiles's emacs.d directory."
|
|
|
|
(find-file
|
2020-01-15 16:57:05 +01:00
|
|
|
(f-join "~/dotfiles/configs/shared/.emacs.d" name)))
|
2020-01-08 16:16:26 +01:00
|
|
|
|
2019-10-09 13:13:56 +02:00
|
|
|
(when dotfiles/install-kbds?
|
2020-01-08 16:19:24 +01:00
|
|
|
(evil-leader/set-key "J" #'dotfiles/edit)
|
|
|
|
(evil-leader/set-key "c" (lambda ()
|
|
|
|
(interactive)
|
|
|
|
(counsel-find-file "~/.config"))))
|
2019-10-09 13:13:56 +02:00
|
|
|
|
|
|
|
(provide 'dotfiles)
|
|
|
|
;;; dotfiles.el ends here
|