dotfiles-emacs/.emacs.d/config/dev.el
finga e19e5b0a4e dev: Enable spell checking for comments in code
To improve the readability add spell checks when writing comments in
code files.
2023-07-14 12:49:34 +02:00

59 lines
2.4 KiB
EmacsLisp

;; magit
(use-package magit
:ensure t
:init
;; (taken from :open https://r0tty.org/git/dotfiles/emacs/tree/.emacs.d/config/development.el)
(defun vcsh (repo)
"Invoke magit on a vcsh repo. This requires an appropriate entry in `tramp-methods'."
(interactive (let ((repos (delq nil
(mapcar #'(lambda (name)
(if (string-match ".git$" name)
(substring name 0 -4)
nil))
(directory-files "~/.config/vcsh/repo.d")))))
(list (completing-read "Repository: " repos nil t))))
(magit-status-internal (format "/vcsh:%s:" repo)))
:config
;; Turn on flyspell when writing commit messages
(add-hook 'git-commit-setup-hook 'git-commit-turn-on-flyspell))
;; rust
(use-package cargo :ensure t)
(use-package cargo-mode :ensure t)
(use-package rust-mode :ensure t)
(use-package flycheck-rust :ensure t)
;; start cargo
(add-hook 'rust-mode-hook 'cargo-minor-mode)
;; yaml
(use-package yaml-mode :ensure t)
(use-package flycheck-yamllint :ensure t)
;; paredit
(use-package paredit :ensure t)
(autoload 'enable-paredit-mode "paredit" "Turn on pseudo-structural editing of Lisp code." t)
(add-hook 'emacs-lisp-mode-hook #'enable-paredit-mode)
(add-hook 'eval-expression-minibuffer-setup-hook #'enable-paredit-mode)
(add-hook 'ielm-mode-hook #'enable-paredit-mode)
(add-hook 'lisp-mode-hook #'enable-paredit-mode)
(add-hook 'lisp-interaction-mode-hook #'enable-paredit-mode)
(add-hook 'scheme-mode-hook #'enable-paredit-mode)
;; Hack to show only files known to git inside dired; needs the
;; `git-find' shell script shim (taken from :open https://r0tty.org/git/dotfiles/emacs/tree/.emacs.d/config/development.el)
(defun git-dired (dir)
(interactive (list (read-directory-name "Find files in directory: " nil "" t)))
(let ((find-program "git-find"))
(find-dired dir "")))
;; c
(setq c-default-style "linux"
c-basic-offset 2)
(add-hook 'c-mode-hook
(lambda ()
(set-fill-column 100)))
;; enable flyspell checks for comments in code
(add-hook 'prog-mode-hook #'flyspell-prog-mode)