current system is Windows: >vim
if has("win32")
" ...
endif
< *feature-list*
List of supported pseudo-feature names:
acl |ACL| support.
bsd BSD system (not macOS, use "mac" for that).
clipboard |clipboard| provider is available.
fname_case Case in file names matters (for Darwin and MS-Windows
this is not present).
gui_running Nvim has a GUI.
hurd GNU/Hurd system.
iconv Can use |iconv()| for conversion.
linux Linux system.
mac MacOS system.
nvim This is Nvim.
python3 Legacy Vim |python3| interface. |has-python|
pythonx Legacy Vim |python_x| interface. |has-pythonx|
sun SunOS system.
ttyin input is a terminal (tty).
ttyout output is a terminal (tty).
unix Unix system.
*vim_starting* True during |startup|.
win32 Windows system (32 or 64 bit).
win64 Windows system (64 bit).
wsl WSL (Windows Subsystem for Linux) system.
*has-patch*
3. Vim patch. For example the "patch123" feature means that
Vim patch 123 at the current |v:version| was included: >vim
if v:version > 602 || v:version == 602 && has("patch148")
" ...
endif
< 4. Vim version. For example the "patch-7.4.237" feature means
that Nvim is Vim-compatible to version 7.4.237 or later. >vim
if has("patch-7.4.237")
" ...
endif
<
Parameters: ~
• {feature} (`string`)
Return: ~
(`0|1`)
has_key({dict}, {key}) *has_key()*
The result is a Number, which is TRUE if |Dictionary| {dict}
has an entry with key {key}. FALSE otherwise. The {key}
argument is a string.
Parameters: ~
• {dict} (`table`)
• {key} (`string`)
Return: ~
(`0|1`)
haslocaldir([{winnr} [, {tabnr}]]) *haslocaldir()*
The result is a Number, which is 1 when the window has set a
local path via |:lcd| or when {winnr} is -1 and the tabpage
has set a local path via |:tcd|, otherwise 0.
Tabs and windows are identified by their respective numbers,
0 means current tab or window. Missing argument implies 0.
Thus the following are equivalent: >vim
echo haslocaldir()
echo haslocaldir(0)
echo haslocaldir(0, 0)
< With {winnr} use that window in the current tabpage.
With {winnr} and {tabnr} use the window in that tabpage.
{winnr} can be the window number or the |window-ID|.
If {winnr} is -1 it is ignored, only the tab is resolved.
Throw error if the arguments are invalid. |E5000| |E5001| |E5002|
Parameters: ~
• {winnr} (`integer?`)
• {tabnr} (`integer?`)
Return: ~
(`0|1`)
hasmapto({what} [, {mode} [, {abbr}]]) *hasmapto()*
The result is a Number, which is TRUE if there is a mapping
that contains {what} in somewhere in the rhs (what it is
mapped to) and this mapping exists in one of the modes
indicated by {mode}.
The arguments {what} and {mode} are strings.
When {abbr} is there and it is |TRUE| use abbreviations
instead of mappings. Don't forget to specify Insert and/or
Command-line mode.
Both the global mappings and the mappings local to the current
buffer are checked for a match.
If no matching mapping is found FALSE is returned.
The following characters are recognized in {mode}:
n Normal mode
v Visual and Select mode
x Visual mode
s Select mode
o Operator-pending mode
i Insert mode
l Language-Argument ("r", "f", "t", etc.)
c Command-line mode
When {mode} is omitted, "nvo" is used.
This function is useful to check if a mapping already exists
to a function in a Vim script. Example: >vim
if !hasmapto('\ABCdoit')
map <Leader>d \ABCdoit
endif
< This installs the mapping to "\ABCdoit" only if there isn't
already a mapping to "\ABCdoit".