1
0
Fork 0
dotfiles/.emacs.d/include/misc.el
Lucas Sta Maria ebd48de368
fix(emacs): add hledger-mode
Signed-off-by: Lucas Sta Maria <lucas@priime.dev>
2023-12-31 07:57:12 -05:00

92 lines
2.9 KiB
EmacsLisp

;;; misc.el --- Miscellaneous configuration for packages.
;;; Commentary:
;; Miscellaneous configuration for packages. If a package doesn't
;; necessarily require its own configuration file (its configuration could be
;; short), then it belongs here.
;;; Code:
(require 'git-gutter)
(require 'elfeed)
(require 'neotree)
(defun config-compile ()
"(Re)compile the current Emacs configuration."
(interactive)
(byte-recompile-directory "~/.emacs.d/"))
(defun config-download (&optional confirm)
"Download the latest Emacs config files from the GitHub repository if CONFIRM."
(interactive)
(let* ((confirm (or confirm
(read-string "Type `YES' to confirm download: "))))
(if (not (string= confirm "YES"))
(print "Cancelling config download/update...")
(let* ((gh-url "https://raw.githubusercontent.com/priime0/dotfiles/master/.emacs.d/")
(target-dir "~/.emacs.d/")
(filenames
'("init.el"
"include/general.el"
"include/misc.el"
"include/utils.el"
"include/racket.el"
"include/pdfconfig.el"
"include/cppconfig.el"
"include/latexconfig.el"
"include/mu4econfig.el"
"include/orgconfig.el"))
(file-paths (mapcar (lambda (s) (concat target-dir s))
filenames))
(file-urls (mapcar (lambda (s) (concat gh-url s))
filenames))
(file-path-urls (lists->alist file-paths file-urls)))
(mkdir (concat target-dir "include") t)
(mapc (lambda (f)
(url-copy-file (cdr f) (car f) t))
file-path-urls)))))
;; LSP
(setq lsp-inlay-hint-enable t)
;; Git Gutter
(global-git-gutter-mode +1)
;; Elfeed
(setq elfeed-feeds
'(("https://edwardwibowo.com/rss.xml" blog)
("https://priime.dev/feed.xml" blog)
("https://fasterthanli.me/index.xml" blog)
("https://blog.cleancoder.com/atom.xml" blog)))
;; Magit
(global-set-key (kbd "C-c g g") #'magit)
(global-set-key (kbd "C-c g b") #'magit-blame)
(setq auth-sources '("~/.authinfo"))
;; Neotree
(defun neotree-toggle-current-directory ()
"Toggle neotree at the current directory."
(interactive)
(let ((current-directory
(if buffer-file-name
(file-name-directory buffer-file-name)
"~")))
(if (and (fboundp 'neo-global--window-exists-p)
(neo-global--window-exists-p))
(neotree-hide)
(neotree-dir current-directory))))
(global-set-key (kbd "C-c t") #'neotree-toggle-current-directory)
(setq neo-theme 'icon)
;; Orderless
(setq completion-styles '(orderless basic))
(setq completion-category-overrides '((file (styles basic partial-completion))))
;; hledger
(setq hledger-currency-string "$")
;; SLIME
(setq inferior-lisp-program "sbcl")
(provide 'misc)
;;; misc.el ends here