Quellcode durchsuchen

Add forge-fmt to emacs Solidity

master
Bingen Eguzkitza vor 2 Wochen
Ursprung
Commit
c8d5e43aa9
1 geänderte Dateien mit 10 neuen und 0 gelöschten Zeilen
  1. +10
    -0
      lisp/init-solidity.el

+ 10
- 0
lisp/init-solidity.el Datei anzeigen

@@ -123,5 +123,15 @@

(add-hook 'solidity-mode-hook 'ethereum-c-mode-hook)

;; https://www.getfoundry.sh/config/editors#emacs
(defun forge-fmt ()
"Format current buffer with forge fmt."
(interactive)
(shell-command (format "forge fmt %s" (buffer-file-name)))
(revert-buffer t t t))
(add-hook 'solidity-mode-hook
(lambda ()
(add-hook 'after-save-hook #'forge-fmt nil t)))

(provide 'init-solidity)
;;; init-solidity.el ends here

Laden…
Abbrechen
Speichern