From fc4c5927cc1956bc6b197e0ec038737d07229cf5 Mon Sep 17 00:00:00 2001 From: d6 Date: Wed, 3 Aug 2022 00:37:37 -0400 Subject: [PATCH] merge --- init.el | 73 ++++++++++++++++++++++++++------------------------------- 1 file changed, 33 insertions(+), 40 deletions(-) diff --git a/init.el b/init.el index 4960d55..04aeaed 100644 --- a/init.el +++ b/init.el @@ -4,6 +4,11 @@ ;;; Code: +;; set up local directory +;(add-to-list 'load-path "~/.emacs.d/lisp/") +(add-to-list 'load-path (expand-file-name "lisp" user-emacs-directory)) +(setq-default flycheck-emacs-lisp-load-path 'inherit) + ;; set up straight.el (defvar bootstrap-version) (let ((bootstrap-file @@ -95,35 +100,6 @@ (newHeight (* newSize 10))) (set-face-attribute 'default nil :height newHeight))) -;; ;; use doom themes -;; (use-package doom-themes -;; ;; :straight (doom-themes :type git -;; ;; :host github -;; ;; :repo "doomemacs/themes") -;; :config ;(load-theme 'doom-badger t) -;; ;; (setq doom-badger-brighter-comments t -;; ;; doom-themes-treemacs-theme "doom-colors") -;; (load-theme 'neon-badger t) -;; (setq neon-badger-brighter-comments t -;; neon-themes-treemacs-theme "doom-colors") -;; ; (set-face-foreground-color 'font-lock-constant-face #635770) -;; ; (set-face-foreground 'font-lock-constant-face "#834980") -;; ; (set-face-foreground 'font-lock-constant-face "#c37990") -;; (doom-themes-neotree-config) -;; (doom-themes-treemacs-config) -;; (doom-themes-org-config)) - -;; (use-package heaven-and-hell -;; :ensure t -;; :init (setq heaven-and-hell-theme-type 'dark) -;; (setq heaven-and-hell-themes -;; '((light . doom-badger) -;; (dark . neon-badger))) -;; :hook (after-init . heaven-and-hell-init-hook) -;; ) - ;; :bind (("C-c " . heaven-and-hell-load-default-theme) - ;; ("" . heaven-and-hell-toggle-theme))) - ;; try using a fancier mode line (use-package doom-modeline :ensure t @@ -205,7 +181,7 @@ (use-package markdown-mode) (use-package racket-mode) (use-package tuareg) -(use-package forth-mode) +;(use-package forth-mode) (use-package rust-mode) (use-package which-key @@ -231,9 +207,14 @@ (use-package company :hook (scala-mode . company-mode) + (java-mode . company-mode) + (emacs-lisp-mode . company-mode) + (rust-mode . company-mode) + (python-mode . company-mode) :bind (("M-/" . company-complete)) :config (add-hook 'after-init-hook 'global-company-mode)) +(defvar use-lsp) (setq use-lsp (equal (system-name) "cult")) ;; when not using lsp use hippie expand @@ -456,12 +437,21 @@ ;; hcl / terraform (use-package hcl-mode) +;; dired +(setq dired-auto-revert-buffer t) +(defun my/toggle-dotfiles () + "Toggle visibility of files starting with dot." + (interactive) + (if (equal dired-listing-switches "-al") + (setq dired-listing-switches "-l") + (setq dired-listing-switches "-al"))) + ;;; turn off branch in mode line for now ;(setq vc-handled-backends nil) ;; force vc to update branches, etc. (unused for now) (defun force-update-vcs () - "Update vc in all verson-controlled buffers" + "Update vc in all verson-controlled buffers." (interactive) (dolist (buf (buffer-list)) (with-current-buffer buf @@ -511,10 +501,10 @@ (setq indent-tabs-mode (not indent-tabs-mode))) ;; handy function to regenerate tags -(defun regenerate-tags () - "regenerate-tags" +(defun my/regenerate-tags () + "Regenerate tags using ets." (interactive) - (defun runloop (dir) + (defun my/runloop (dir) (let ((tagfile (concat dir "TAGS"))) (if (file-exists-p tagfile) (let ((default-directory dir)) @@ -523,22 +513,22 @@ (async-shell-command "ets"))) (progn (let ((next (file-name-directory (directory-file-name dir)))) - (if (equal dir next) (shell-command "uptime") (runloop next))))))) - (runloop default-directory)) -(global-set-key (kbd "C-t") 'regenerate-tags) + (if (equal dir next) (shell-command "uptime") (my/runloop next))))))) + (my/runloop default-directory)) +(global-set-key (kbd "C-t") 'my/regenerate-tags) ;; spell checking as you type in text-mode ;(autoload 'flyspell-mode-on "flyspell" "On-the-fly ispell." t) (add-hook 'text-mode-hook 'flyspell-mode-on) ;; use nicer diff colors -(defun update-diff-colors () - "update the colors for diff faces" +(defun my/update-diff-colors () + "Update the colors for diff faces." (set-face-foreground 'diff-added "green") (set-face-foreground 'diff-removed "red") (set-face-foreground 'diff-changed "purple")) (eval-after-load "diff-mode" - '(update-diff-colors)) + '(my/update-diff-colors)) ;; (custom-set-variables ;; ;; custom-set-variables was added by Custom. @@ -553,3 +543,6 @@ ;; ;; Your init file should contain only one such instance. ;; ;; If there is more than one, they won't work right. ;; ) + +(provide 'init) +;;; init.el ends here