mirror of
https://github.com/neovim/neovim.git
synced 2026-04-27 01:34:16 +00:00
docs: misc
This commit is contained in:
8
BUILD.md
8
BUILD.md
@@ -572,3 +572,11 @@ See "Available System Integrations" in `zig build -h` to see available system in
|
||||
`zig build --system deps_dir` will enable all integrations and turn off dependency fetching. This requires you to pre-download the dependencies which don't have a system integration into `deps_dir` (at the time of writing these are ziglua, [`lua_dev_deps`](https://github.com/neovim/deps/blob/master/opt/lua-dev-deps.tar.gz), and the built-in tree-sitter parsers). You have to create subdirectories whose names are the respective package's hash under `deps_dir` and unpack the dependencies inside that directory - ziglua should go under `deps_dir/zlua-0.1.0-hGRpC1dCBQDf-IqqUifYvyr8B9-4FlYXqY8cl7HIetrC` and so on. Hashes should be taken from `build.zig.zon`.
|
||||
|
||||
See the `prepare` function of [this `PKGBUILD`](https://git.sr.ht/~chinmay/nvim_build/tree/26364a4cf9b4819f52a3e785fa5a43285fb9cea2/item/PKGBUILD#L90) for an example.
|
||||
|
||||
## Cross-compiling
|
||||
|
||||
Cross-compilation is not supported, but we collect notes here for reference (improvements welcome).
|
||||
Also relevant for webassembly (WASM) build.
|
||||
|
||||
- Set `NVIM_HOST_PRG` so that the docs and tags generation works without
|
||||
depending on the target binary.
|
||||
|
||||
@@ -39,6 +39,10 @@ effects. Be careful not to destroy your text.
|
||||
==============================================================================
|
||||
2. Defining autocommands *autocmd-define*
|
||||
|
||||
Use |nvim_create_autocmd()| to define an event handler from Lua.
|
||||
|
||||
Vimscript commands are described below.
|
||||
|
||||
*:au* *:autocmd*
|
||||
:au[tocmd] [group] {event} {aupat} [++once] [++nested] {cmd}
|
||||
Add {cmd} to the list of commands that Vim will
|
||||
@@ -125,6 +129,14 @@ prompt. When one command outputs two messages this can happen anyway.
|
||||
==============================================================================
|
||||
3. Removing autocommands *autocmd!* *autocmd-remove*
|
||||
|
||||
Using Lua, these functions remove autocmds and autocmd groups:
|
||||
|
||||
- |nvim_del_autocmd()|
|
||||
- |nvim_del_augroup_by_id()|
|
||||
- |nvim_del_augroup_by_name()|
|
||||
|
||||
Vimscript commands are described below.
|
||||
|
||||
:au[tocmd]! [group] {event} {aupat} [++once] [++nested] {cmd}
|
||||
Remove all autocommands associated with {event} and
|
||||
{aupat}, and add the command {cmd}.
|
||||
|
||||
@@ -182,14 +182,13 @@ except only the last section of the buffer is editable, and the user can
|
||||
- advanced "picker" plugins
|
||||
|
||||
A prompt buffer is created by setting 'buftype' to "prompt". You would
|
||||
normally only do that in a newly created buffer: >vim
|
||||
normally only do that in a new, empty buffer: >vim
|
||||
|
||||
:set buftype=prompt
|
||||
|
||||
Prompt buffers ignore modified checks for changes made to the buffer, so
|
||||
interactive input does not make them hard to close. But if a plugin or user
|
||||
explicitly sets 'modified', a modified prompt buffer can't be closed without
|
||||
saving.
|
||||
Prompt buffers do not implicitly set 'modified' on user input or other
|
||||
changes. But a user or plugin can set 'modified' explicitly, to prevent the
|
||||
buffer from being easily closed.
|
||||
|
||||
The user can edit and input text at the end of the buffer. Pressing Enter in
|
||||
the input section invokes the |prompt_setcallback()| callback, which is
|
||||
|
||||
@@ -4468,11 +4468,13 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
result of a BufNewFile, BufRead/BufReadPost, BufWritePost,
|
||||
FileAppendPost or VimLeave autocommand event. See |gzip-example| for
|
||||
an explanation.
|
||||
|
||||
When 'buftype' is "prompt", 'modified' is not implicitly set when the
|
||||
buffer is changed, but a user or plugin may explicitly set it.
|
||||
|
||||
When 'buftype' is "nowrite" or "nofile", this option may be set, but
|
||||
it is ignored and will not block closing the window. For "prompt"
|
||||
buffers, changes made to the buffer do not make it count as modified,
|
||||
but an explicit ":set modified" is respected and will block closing the
|
||||
window.
|
||||
will be ignored.
|
||||
|
||||
Note that the text may actually be the same, e.g. 'modified' is set
|
||||
when using "rA" on an "A".
|
||||
|
||||
|
||||
@@ -1330,7 +1330,7 @@ static void normal_check_text_changed(NormalState *s)
|
||||
|
||||
static void normal_check_buffer_modified(NormalState *s)
|
||||
{
|
||||
// Trigger BufModified if b_modified changed
|
||||
// Trigger BufModified if 'modified' changed.
|
||||
if (!finish_op && has_event(EVENT_BUFMODIFIEDSET)
|
||||
&& curbuf->b_changed_invalid == true) {
|
||||
apply_autocmds(EVENT_BUFMODIFIEDSET, NULL, NULL, false, curbuf);
|
||||
|
||||
@@ -5935,11 +5935,13 @@ local options = {
|
||||
result of a BufNewFile, BufRead/BufReadPost, BufWritePost,
|
||||
FileAppendPost or VimLeave autocommand event. See |gzip-example| for
|
||||
an explanation.
|
||||
|
||||
When 'buftype' is "prompt", 'modified' is not implicitly set when the
|
||||
buffer is changed, but a user or plugin may explicitly set it.
|
||||
|
||||
When 'buftype' is "nowrite" or "nofile", this option may be set, but
|
||||
it is ignored and will not block closing the window. For "prompt"
|
||||
buffers, changes made to the buffer do not make it count as modified,
|
||||
but an explicit ":set modified" is respected and will block closing the
|
||||
window.
|
||||
will be ignored.
|
||||
|
||||
Note that the text may actually be the same, e.g. 'modified' is set
|
||||
when using "rA" on an "A".
|
||||
]=],
|
||||
|
||||
Reference in New Issue
Block a user