add 'setlocal' for directory specific options (#1381)

* add 'setlocal' for option 'sortby'

* save each local option separately

* add 'setlocal' for option 'reverse'

* add 'setlocal' for option 'dirfirst'

* add 'setlocal' for option 'hidden'

* add 'setlocal' for option 'dironly'

* add 'setlocal' for option 'info'

* add boolean toggling for 'setlocal' options

* check if the path is absolute for 'setlocal'

* add 'setlocal' options to completion

* add tests for 'setlocal'

* add 'setlocal' to the documentation

* use trailing '/' in 'setlocal' for subdir matching

* cleanup

* add 'setlocal' subdirs to the documentation
This commit is contained in:
Gökçehan Kara authored and GitHub committed 2023-09-02 22:22:56 +03:00
1 parent 990cea7e04
commit 8d013c9375
10 files changed
+486 -31

No files matched your search

+16 -1
View File
@@ -1349,7 +1349,7 @@ Characters from '#' to newline are comments and ignored:
# comments start with '#'
.EE
.PP
There are four special commands ('set', 'map', 'cmap', and 'cmd') for configuration.
There are five special commands ('set', 'setlocal', 'map', 'cmap', and 'cmd') for configuration.
.PP
Command 'set' is used to set an option which can be boolean, integer, or string:
.PP
@@ -1365,6 +1365,21 @@ Command 'set' is used to set an option which can be boolean, integer, or string:
set sortby "time" # string value with double quotes (backslash escapes)
.EE
.PP
Command 'setlocal' is used to set a local option for a directory which can be boolean or string. Currently supported local options are 'dirfirst', 'dironly', 'hidden', 'info', 'reverse', and 'sortby'. Adding a trailing path separator (i.e. '/' for Unix and '\e' for Windows) sets the option for the given directory along with its subdirectories:
.PP
.EX
setlocal /foo/bar hidden # boolean enable
setlocal /foo/bar hidden true # boolean enable
setlocal /foo/bar nohidden # boolean disable
setlocal /foo/bar hidden false # boolean disable
setlocal /foo/bar hidden! # boolean toggle
setlocal /foo/bar sortby time # string value w/o quotes
setlocal /foo/bar sortby 'time' # string value with single quotes (whitespaces)
setlocal /foo/bar sortby "time" # string value with double quotes (backslash escapes)
setlocal /foo/bar hidden # for only '/foo/bar' directory
setlocal /foo/bar/ hidden # for '/foo/bar' and its subdirectories (e.g. '/foo/bar/baz')
.EE
.PP
Command 'map' is used to bind a key to a command which can be builtin command, custom command, or shell command:
.PP
.EX