Timeline for Using inotifywait along with vim
Current License: CC BY-SA 3.0
10 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 1, 2020 at 20:02 | comment | added | Chris Stryczynski |
Seems the option needs to be set with this actually :set backupcopy=yes
|
|
| Apr 29, 2020 at 14:08 | comment | added | Doron Behar |
You are right :) I got confused between that and the option backup.
|
|
| Apr 29, 2020 at 10:43 | comment | added | Gilles 'SO- stop being evil' | @DoronBehar Did it? I link to the manual and it doesn't suggest that anything has changed. If something has changed, please edit my answer to say what to do depending on the version (keep in mind that not everyone uses the latest version). | |
| Apr 29, 2020 at 10:09 | comment | added | Doron Behar | I think Vim changed these options' names so this answer is worth updating | |
| Jul 30, 2019 at 20:04 | comment | added | lmat - Reinstate Monica |
@Gilles I decided on while true; do inotifywait ... [no -m]; make; sleep .1; done; or so. There are some gotchas, but I've arrived at something quite workable.
|
|
| Jul 29, 2019 at 19:12 | comment | added | Gilles 'SO- stop being evil' |
@LimitedAtonement That's a much more complicates use case than the one in this question. For your use case, you'd need to wait a bit after one file is saved. Files are never really modified “at once”. If you save multiple files with :wa, you get successive inotify events. You'd need to wait after the first one to see if others are coming. But you can use the code presented here: the additional complexity would go inside the ….
|
|
| Jul 29, 2019 at 18:50 | comment | added | lmat - Reinstate Monica |
The drawback to the method proposed here is that when you write several files "at once", your commands will be run once for each file. I'm editing code, so I may modify a header and a couple other translation units and :wa. Then my build is run once for every file written.
|
|
| Apr 13, 2017 at 12:36 | history | edited | CommunityBot |
replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
|
|
| Jul 24, 2015 at 14:40 | history | edited | Gilles 'SO- stop being evil' | CC BY-SA 3.0 |
typo: missing argument to inotifywait (thanks user2847643)
|
| Mar 9, 2015 at 0:16 | history | answered | Gilles 'SO- stop being evil' | CC BY-SA 3.0 |