A complete “hot reload” package that let you choose a command to run on watched files.
This package is based on entr. Check out that great package.
I was coding a website with thymeleaf on springboot but I wasn’t able to make the hotreload functionality work properly for me.
That lead me to this package. It permits to choose one or multiple files/directories or both then write a custom command that will run each time these files are changed.
To be added !
(use-package entr-runner
:straight (entr-runner :type git :host github :repo "SamuelVanie/entr-runner.el"))
(package! entr-runner
:recipe (:host github :repo "SamuelVanie/entr-runner.el"))
You should then run the interactive command entr-runner-install
, this will automatically download and compile the entr package if it’s not present on your computer, or setup some variable if it’s already the case.
The installation script depends on which
, which is normally install on most unix machines.
Two possibilities :
- You can mark your files or directories inside dired (use the “*” key to do so), then run the command
entr-runner-dired
. That command will prompt you info about the flags that you wish to add to the command and there it is. (see demo) - You can also use the command
entr-runner-regex
that will prompt you for regex that will select all the files from the default-directory and run the command that you will choose on them.
You can stop the process by running the command entr-runner-kill-process
. That will kill the process in charge of watching the files.
When you run one of the entr commands, a special buffer will be created that is called entr-runner. This is the buffer in which you can check the logs of the command you ran.
Using thymeleaf on springboot you can set up an autoreload that didn’t work for me. I just use entr with the option “-r” with the command “gradlew bootRun” on my static files.
You can use rclone to automatically sync a directory to your google drive, or any cloud base storage.
The command I use is : rclone mount --vfs-cache-mode full org_google:/ ~/.org/
. This command mount your remote file system to a local directory(in this case .org).
Using make or a gcc command you can automatically compile and run your project.
Command similar to the simple gcc *.c -o project && ./project
Using a program like zathura that automatically load back the file on disk if its changes on disk.
A command like pdflatex file.tex -o file.pdf
could help you
If you can access you browser window through the command line, you could automatically reload the web page you’re programming. (You can use tool like xdotool)
Instead of entr that doesn’t work on windows, you could use some other command line utility like watchmedo(in watchdog) that is made in python and can also run on windows.
entr only works on UNIX systems, you must have a linux machine or a mac or WSL if that is possible.
- If you find a bug or have an idea for an improvement, please open an issue about it.
- If you want to contribute, you can open a pull request and I will be happy to review it.
- If you want to add a new feature, please open an issue first to discuss about it.
- If you want to support me, you can star the repository.