about summary refs log blame commit diff
path: root/configs/shared/.emacs.d/wpc/dotfiles.el
blob: f6deb82f16a775e730a527829a045d08fb3b330f (plain) (tree)























                                                                                
                                         
                             
                          
                                                  

















                                                                            
;;; dotfiles.el --- Elisp to make dotfile management -*- lexical-binding: t -*-
;; Author: William Carroll <wpcarro@gmail.com>

;;; Commentary:
;; Quickly edit commonly used files.

;;; Code:

(require 'macros)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; API
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defconst dotfiles/install-kbds? t
  "When t, install the keybindings.")

(defconst dotfiles/whitelist
  '(("compton" . "~/.config/compton.conf")
    ("dotfiles" . "~/Dropbox/dotfiles/")
    ("functions" . "~/functions.zsh")
    ("aliases" . "~/aliases.zsh")
    ("variables" . "~/variables.zsh")
    ("Xresources" . "~/.Xresources.shared")
    ("xsession" . "~/.xsessionrc.shared")
    ("tmux" . "~/.tmux.conf")
    ("zshrc" . "~/.zshrc")
    ("config.fish" . "~/.config/fish/config.fish")
    ("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)))

(when dotfiles/install-kbds?
  (evil-leader/set-key "J" #'dotfiles/edit))

(provide 'dotfiles)
;;; dotfiles.el ends here