| (add-hook 'solidity-mode-hook 'ethereum-c-mode-hook) | (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) | (provide 'init-solidity) | ||||
| ;;; init-solidity.el ends here | ;;; init-solidity.el ends here |