optimize and use use-package
This commit is contained in:
parent
f6d3734a66
commit
7033155c6a
10 changed files with 296 additions and 92 deletions
42
.emacs.d/config/dev.el
Normal file
42
.emacs.d/config/dev.el
Normal file
|
@ -0,0 +1,42 @@
|
|||
;; 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))))
|
||||
|
||||
;; rust
|
||||
(use-package cargo :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
|
||||
(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 "")))
|
Loading…
Add table
Add a link
Reference in a new issue