-
Notifications
You must be signed in to change notification settings - Fork 4
Variables
Antonio Davide edited this page Mar 9, 2023
·
7 revisions
It's possible to use variables inside JSON files with the syntax ${variablename}
, here is a list of the supported ones:
Name | Description | Example |
---|---|---|
VERSION | Current schema version | ${VERSION} |
env | Environment variables (equals to vim.env ) |
${env.HOME} |
sep | Operating system path separator | ${sep} |
file | The current opened file (full path) | ${file} |
file_name | The current opened file name (with extension) | ${file_name} |
file_stem | The current opened file name (without extension) | ${file_name} |
selected_text | The current selected text in the current buffer | `${selected_text} |
os_name | Operating system name (in lowercase) | ${os_name} |
user_home | Operating system user's HOME folder | ${user_home} |
number_of_cores | Number of CPU cores | ${number_of_cores} |
workspace_folder | Workspace root folder | ${workspace_folder} |
workspace_name | Workspace name (folder name is used) | ${workspace_name} |
cwd | NeoVim working directory | ${cwd} |
state | Workspace state (see config.json) | ${state.myvar} |
ws | Workspace variables (see variables.json) | ${ws.myvar} |
globals | Automaton builtin variables (see globals) | ${globals.gvar} |