'\" t .\" Title: kakoune .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 11/16/2018 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" .TH KAK_SCOPES 1 "" "" "scopes" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" scopes \- a .SH "DESCRIPTION" .sp Scopes are groups in which a particular Kakoune object (a variable, hook, alias etc) can have different values, depending on the group the value was declared in\&. .SH "NAMES AND HIERARCHY" .sp Scopes are named as follows: .PP \fBwindow\fR .RS 4 context linked to the window displaying a buffer .RE .PP \fBbuffer\fR .RS 4 context linked directly to the buffer .RE .PP \fBglobal\fR .RS 4 global context linked to the instance of Kakoune .RE .sp The following order of priority applies to the above scopes: .sp .if n \{\ .RS 4 .\} .nf window ]> buffer ]> global .fi .if n \{\ .RE .\} .sp The above priority line implies that objects can have individual values that will be resolved first in the \fBwindow\fR scope (highest priority), then in the \fBbuffer\fR scope, and finally in the \fBglobal\fR scope (lowest priority)\&. .SH "USES" .sp The scope paradigm is very useful as it allows the user to customize the behavior of the editor without modifying the configuration globally, as is the case with other editors who only have a single \fBglobal\fR scope by default\&. .sp Examples: .PP \fBfiletype\fR .RS 4 A single buffer opened in two separate windows can have different filetypes declared in the \fBwindow\fR scope with \fIset\fR (c\&.f\&. the \fIoptions\fR documentation page) .RE .PP \fBstatus line\fR .RS 4 All the buffers of the current session can have the same information displayed in the status line, except for a specific buffer (the \fImodelinefmt\fR option can be declared in the \fBglobal\fR scope, and customized in the \fBbuffer\fR scope with \fIset\fR, c\&.f\&. the \fIoptions\fR documentation page) .RE .SH "EXECUTION CONTEXT" .sp Some commands work in a specific context that might exclude one or several scopes altogether, consequently ignoring some values of a given object\&. .sp Example: the \fBwindow\fR scope is never considered when resolving the values of options when writing a buffer (e\&.g\&. \fIBOM\fR, \fIeolformat\fR)\&.