From 4247cf6defd56989b91c957b5b32a19925c71057 Mon Sep 17 00:00:00 2001 From: Tim Allen Date: Wed, 23 Jan 2019 12:34:02 +1100 Subject: [PATCH] doc: Document the buffer=/path/to/file scope syntax. Also, make sure all commands that involve scopes link to the scopes documentation, and refer to the "scope" parameter as `*scope*` for consistency. --- doc/pages/commands.asciidoc | 39 ++++++++++++++++++++++--------------- doc/pages/scopes.asciidoc | 10 ++++++++++ 2 files changed, 33 insertions(+), 16 deletions(-) diff --git a/doc/pages/commands.asciidoc b/doc/pages/commands.asciidoc index cdca31ed..3afb8837 100644 --- a/doc/pages/commands.asciidoc +++ b/doc/pages/commands.asciidoc @@ -96,20 +96,21 @@ of the file onto the filesystem *set-option* [] :: *alias* set + - change the value of an option - note that the name of a particular buffer can be specified when the - target *scope* is 'buffer', e.g. set buffer=/path/to/buffer foo "bar"; - the scope can also take the `current` special value, which will automatically - point to the narrowest scope available in the current context - (See <>) + change the value of an option in *scope* + (See <> + and <>) *unset-option* :: *alias* unset + - unset the value of an option (See <>) + unset the value of an option in *scope*, so the value from an outer scope + is used + (See <> + and <>) *update-option* :: update the value of an option if its type supports that operation - (See <>) + (See <> + and <>) == Commands and Keys @@ -118,11 +119,13 @@ of the file onto the filesystem define a new command (See <>) *alias* :: - define a new alias, within the context of a scope + define a new alias named *name* in *scope* + (See <>) *unalias* []:: remove an alias if its current value is the same as the one passed as an optional parameter, remove it unconditionally otherwise + (See <>) *evaluate-commands* [] ...:: *alias* eval + @@ -134,10 +137,12 @@ of the file onto the filesystem execute a series of keys, as if they were hit (See <>) *map* [] :: - bind a list of keys to a combination (See <>) + bind a list of keys to a combination (See <> + and <>) *unmap* []:: - unbind a key combination (See <>) + unbind a key combination (See <> + and <>) *declare-user-mode* :: declare a new user keymap mode @@ -151,13 +156,13 @@ of the file onto the filesystem == Hooks *hook* [-group ] :: - execute a command whenever an event is triggered - (See <>) + execute *command* whenever an *hook_name* is triggered in *scope* + (See <> and <>) *remove-hooks* :: *alias* rmhooks + remove every hooks in *scope* that are part of the given *group* - (See <>) + (See <> and <>) == Display @@ -173,10 +178,12 @@ of the file onto the filesystem *set-face* :: *alias* face + - define a face in *scope* (See <>) + define a face in *scope* + (See <> and <>) *unset-face* :: - Remove a face definition from *scope* (See <>) + Remove a face definition from *scope* + (See <> and <>) *colorscheme* :: load named colorscheme diff --git a/doc/pages/scopes.asciidoc b/doc/pages/scopes.asciidoc index b09ab13e..b6711278 100644 --- a/doc/pages/scopes.asciidoc +++ b/doc/pages/scopes.asciidoc @@ -46,6 +46,16 @@ The above priority line implies that objects can have individual values that will be resolved first in the *window* scope (highest priority), then in the *buffer* scope, and finally in the *global* scope (lowest priority). +Normally, the *buffer* scope keyword means the scope associated with the +currently active buffer, but it's possible to specify any existing buffer by +adding an `=` and the value of `%val{buffile}` for that buffer +(See <>). +For example, to set the `indentwidth` option for the `/etc/fstab` buffer:: + +---- +set-option buffer=/etc/fstab indentwidth 8 +---- + The `set-option` and `unset-option` commands also accept *current* as a valid scope name. It refers to the narrowest scope the option is set in.