58 lines
2.3 KiB
EmacsLisp
58 lines
2.3 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))
|
|
|
|
;; use ripgrep in emacs
|
|
(use-package deadgrep
|
|
:ensure t
|
|
:bind ("M-s d" . deadgrep))
|
|
|
|
;; paredit
|
|
(use-package paredit
|
|
:ensure t
|
|
:config
|
|
(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 "")))
|
|
|
|
;; python
|
|
;; (defun my-shell-mode-hook ()
|
|
;; (add-hook
|
|
;; 'comint-output-filter-functions
|
|
;; 'python-pdbtrack-comint-output-filter-function t))
|
|
;; (add-hook 'shell-mode-hook 'my-shell-mode-hook)
|
|
|
|
;; enable flyspell checks for comments in code
|
|
(add-hook 'prog-mode-hook #'flyspell-prog-mode)
|
|
|
|
;; language server
|
|
(use-package lsp-mode
|
|
:ensure t
|
|
:config
|
|
(add-hook 'rust-mode-hook 'lsp-deferred))
|