-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from Makaze/on-changes
Feature: Watch for file changes
- Loading branch information
Showing
4 changed files
with
116 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
Author: Makaze <[email protected]> | ||
License: GPLv3.0 | ||
Version: 0.2.0 | ||
Version: 0.3.0 | ||
|
||
================================================================================ | ||
INTRODUCTION *watch* | ||
|
@@ -35,6 +35,7 @@ Features: ~ | |
[x] Scrollable output | ||
[x] Pause watching when in the background | ||
[x] Option to open in a configurable split window | ||
[x] Option to watch for file changes | ||
|
||
Planned: ~ | ||
[ ] ANSI color support | ||
|
@@ -67,6 +68,21 @@ COMMANDS *watch-commands* | |
Parameters: ~ | ||
{command...} (string) Shell command to stop watching. | ||
|
||
:WatchFile {command...} {refresh_rate*} *WatchFile* | ||
Starts a new watcher for the currently open file. Behaves like |WatchStart|, | ||
but only runs the command if the file has been modified. | ||
|
||
`NOTE:` Refresh rate values lower than 1000 will be increased to 1000 ms. | ||
|
||
Parameters: ~ | ||
{command...} (string) Shell command to watch. Use `%s` inside the | ||
command to insert the absolute path of the | ||
current file. | ||
{refresh_rate} (integer) Time between refreshes in milliseconds. Will | ||
automically increase to a minimum of 1000. | ||
Defaults to 1000. | ||
|
||
|
||
================================================================================ | ||
CONFIGURATION *watch-config* | ||
|
||
|
@@ -118,7 +134,7 @@ watch.setup({opts*}) *watch.setup()* | |
delete the buffer when calling |watch.stop()|. Default | ||
false. | ||
|
||
watch.start({command}, {refresh_rate*}, {bufnr*}) *watch.start()* | ||
watch.start({command}, {refresh_rate*}, {bufnr*}, {file*}) *watch.start()* | ||
Starts continually reloading a buffer's contents with a shell command. If | ||
the command is aleady being watched, opens that buffer in the current | ||
window. | ||
|
@@ -129,6 +145,11 @@ watch.start({command}, {refresh_rate*}, {bufnr*}) *watch.start()* | |
milliseconds. Defaults to `500`. | ||
{bufnr} (integer) (optional) The buffer number to load to. | ||
Defaults to a new buffer. | ||
{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}. | ||
Defaults to no file (timer only). | ||
|
||
watch.stop({event*}) *watch.stop()* | ||
Stops watching the specified command and detaches from the buffer. If no | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters