doc: Document the switches of :edit.

This commit is contained in:
Tim Allen 2019-02-15 20:04:27 +11:00
parent 89cd68d8af
commit abbf843763
2 changed files with 40 additions and 7 deletions

View File

@ -8,7 +8,8 @@ To open buffers or navigate through the buffers list see
== Scratch Buffers == Scratch Buffers
Scratch buffers are useful for volatile data and quick prototyping. Scratch buffers are useful for volatile data and quick prototyping.
They are not linked to files. They are not linked to files, so Kakoune does not warn about unsaved
changes at exit, and the `:write` command requires an explicit filename.
One particular scratch buffer, named *\*scratch*\*, is automatically One particular scratch buffer, named *\*scratch*\*, is automatically
created when there are no other buffers left in the current created when there are no other buffers left in the current
@ -49,6 +50,8 @@ This is very useful for running some commands asynchronously while
displaying their result in a buffer. See `rc/make.kak` and `rc/grep.kak` displaying their result in a buffer. See `rc/make.kak` and `rc/grep.kak`
for examples. for examples.
When the buffer is deleted, the fifo will be closed, so any program When the write end of the fifo is closed, the buffer becomes an ordinary
writing to it will receive `SIGPIPE`. This is useful as it permits to <<buffers#scratch-buffers,scratch buffer>>. When the buffer is deleted,
stop the writing program when the buffer is deleted. Kakoune closes the read end of the fifo, so any program writing to it
will receive `SIGPIPE`. This is useful as it permits to stop the writing
program when the buffer is deleted.

View File

@ -19,11 +19,37 @@ of the file onto the filesystem
change the current directory to *directory*, or the home directory if change the current directory to *directory*, or the home directory if
unspecified unspecified
*edit[!]* <filename> [<line> [<column>]]:: *edit[!]* [<switches>] <filename> [<line> [<column>]]::
*alias* e + *alias* e +
open buffer on file, go to given line and column. If file is already open buffer on file, go to given line and column. If file is already
opened, just switch to this file. Use edit! to force reloading opened, just switch to this file. Use edit! to force reloading
*-debug*:::
The new buffer (if any) will be created as a debug buffer.
(See <<buffers#debug-buffers,`:doc buffers debug-buffers`>>)
*-existing*:::
If the named file does not exist, fail instead of creating a new buffer.
*-readonly*:::
The new buffer (if any) will be set read-only.
*-fifo* <fifoname>:::
Creates a new scratch buffer named <filename>, and continually appends
data from the fifo (named pipe) <fifoname> as it arrives.
(See <<buffers#fifo-buffers,`:doc buffers fifo-buffers`>>)
*-scratch*:::
Creates a new buffer named <filename>, which doesn't correspond to any
file on disk.
(See <<buffers#scratch-buffers,`:doc buffers scratch-buffers`>>)
*-scroll*:::
If used with `-fifo`, when new data arrives Kakoune will scroll the
buffer down to make the new data visible.
Otherwise, does nothing.
*write[!]* [-sync] [<filename>]:: *write[!]* [-sync] [<filename>]::
*alias* w + *alias* w +
write buffer to <filename> or use its name if filename is not write buffer to <filename> or use its name if filename is not
@ -57,11 +83,15 @@ of the file onto the filesystem
*buffer-next*:: *buffer-next*::
*alias* bn + *alias* bn +
switch to the next buffer switch to the next buffer.
Debug buffers are skipped.
(See <<buffers#debug-buffers,`:doc buffers debug-buffers`>>)
*buffer-prev*:: *buffer-prev*::
*alias* bp + *alias* bp +
switch to the previous buffer switch to the previous buffer.
Debug buffers are skipped.
(See <<buffers#debug-buffers,`:doc buffers debug-buffers`>>)
*delete-buffer[!]* [<name>]:: *delete-buffer[!]* [<name>]::
*alias* db + *alias* db +