diff --git a/README.md b/README.md index 5e266ec..bdf5ad1 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,7 @@ watch.stop() -- Stop all watchers ```lua local watch = require("watch") +-- Use `%s` inside the command to insert the absolute path of the current file. watch.start("cat %s", 3000, nil, "errog.log") -- Specify 3000 ms refresh watch.start("cat %s", nil, nil, "errog.log") -- Default to 1000 ms refresh ``` diff --git a/doc/watch.txt b/doc/watch.txt index f306d34..0a06dba 100644 --- a/doc/watch.txt +++ b/doc/watch.txt @@ -145,7 +145,7 @@ watch.start({command}, {refresh_rate*}, {bufnr*}, {file*}) *watch.start()* milliseconds. Defaults to `500`. {bufnr} (integer) (optional) The buffer number to load to. Defaults to a new buffer. - {file} (string) (optional) The absolute path of a file to + {file} (string) (optional) The path of a file to watch. If given, the command will be run when the file is modified on the disk, checking at an interval of {refresh_rate}.