#include "nvim/api/private/helpers.h"
#include "nvim/ascii.h"
#include "nvim/charset.h"
#include "nvim/eval.h"
#include "nvim/ex_cmds.h"
#include "nvim/ex_cmds2.h"
#include "nvim/lua/executor.h"
#include "nvim/option.h"
#include "nvim/os/os.h"
#include "nvim/runtime.h"
#include "nvim/vim.h"
Macros | |
#define | NVIM_SIZE (sizeof("nvim") - 1) |
#define | SITE_SIZE (sizeof("site") - 1) |
#define | AFTER_SIZE (sizeof("after") - 1) |
Functions | |
void | runtime_init (void) |
void | ex_runtime (exarg_T *eap) |
":runtime [what] {name}" More... | |
int | do_in_path (char_u *path, char *name, int flags, DoInRuntimepathCB callback, void *cookie) |
RuntimeSearchPath | runtime_search_path_get_cached (int *ref) FUNC_ATTR_NONNULL_ALL |
RuntimeSearchPath | copy_runtime_search_path (const RuntimeSearchPath src) |
void | runtime_search_path_unref (RuntimeSearchPath path, int *ref) FUNC_ATTR_NONNULL_ALL |
int | do_in_cached_path (char_u *name, int flags, DoInRuntimepathCB callback, void *cookie) |
Array | runtime_inspect (void) |
ArrayOf (String) | |
int | do_in_path_and_pp (char_u *path, char_u *name, int flags, DoInRuntimepathCB callback, void *cookie) |
RuntimeSearchPath | runtime_search_path_build (void) |
void | runtime_search_path_invalidate (void) |
void | runtime_search_path_free (RuntimeSearchPath path) |
void | runtime_search_path_validate (void) |
int | do_in_runtimepath (char *name, int flags, DoInRuntimepathCB callback, void *cookie) |
Just like do_in_path_and_pp(), using 'runtimepath' for "path". More... | |
int | source_runtime (char *name, int flags) |
int | source_in_path (char_u *path, char_u *name, int flags) |
Just like source_runtime(), but use "path" instead of 'runtimepath'. More... | |
void | add_pack_start_dirs (void) |
Add all packages in the "start" directory to 'runtimepath'. More... | |
void | load_start_packages (void) |
Load plugins from all packages in the "start" directory. More... | |
void | ex_packloadall (exarg_T *eap) |
void | load_plugins (void) |
Read all the plugin files at startup. More... | |
void | ex_packadd (exarg_T *eap) |
":packadd[!] {name}" More... | |
char * | get_lib_dir (void) |
char * | runtimepath_default (bool clean_arg) |
Management of runtime files (including packages)
#define AFTER_SIZE (sizeof("after") - 1) |
#define NVIM_SIZE (sizeof("nvim") - 1) |
#define SITE_SIZE (sizeof("site") - 1) |
ArrayOf | ( | String | ) |
RuntimeSearchPath copy_runtime_search_path | ( | const RuntimeSearchPath | src | ) |
int do_in_cached_path | ( | char_u * | name, |
int | flags, | ||
DoInRuntimepathCB | callback, | ||
void * | cookie | ||
) |
Find the file "name" in all directories in "path" and invoke "callback(fname, cookie)". "name" can contain wildcards. When "flags" has DIP_ALL: source all files, otherwise only the first one. When "flags" has DIP_DIR: find directories instead of files. When "flags" has DIP_ERR: give an error message if there is no match.
return FAIL when no file could be sourced, OK otherwise.
int do_in_path | ( | char_u * | path, |
char * | name, | ||
int | flags, | ||
DoInRuntimepathCB | callback, | ||
void * | cookie | ||
) |
Find the file "name" in all directories in "path" and invoke "callback(fname, cookie)". "name" can contain wildcards. When "flags" has DIP_ALL: source all files, otherwise only the first one. When "flags" has DIP_DIR: find directories instead of files. When "flags" has DIP_ERR: give an error message if there is no match.
return FAIL when no file could be sourced, OK otherwise.
int do_in_path_and_pp | ( | char_u * | path, |
char_u * | name, | ||
int | flags, | ||
DoInRuntimepathCB | callback, | ||
void * | cookie | ||
) |
Find "name" in "path". When found, invoke the callback function for it: callback(fname, "cookie") When "flags" has DIP_ALL repeat for all matches, otherwise only the first one is used. Returns OK when at least one match found, FAIL otherwise. If "name" is NULL calls callback for each entry in "path". Cookie is passed by reference in this case, setting it to NULL indicates that callback has done its job.
int do_in_runtimepath | ( | char * | name, |
int | flags, | ||
DoInRuntimepathCB | callback, | ||
void * | cookie | ||
) |
Just like do_in_path_and_pp(), using 'runtimepath' for "path".
char* get_lib_dir | ( | void | ) |
RuntimeSearchPath runtime_search_path_build | ( | void | ) |
void runtime_search_path_free | ( | RuntimeSearchPath | path | ) |
RuntimeSearchPath runtime_search_path_get_cached | ( | int * | ref | ) |
void runtime_search_path_unref | ( | RuntimeSearchPath | path, |
int * | ref | ||
) |
char* runtimepath_default | ( | bool | clean_arg | ) |
Determine the startup value for &runtimepath
Windows: Uses "…/nvim-data" for kXDGDataHome to avoid storing configuration and data files in the same path. #4403
clean_arg | Nvim was started with –clean. |
Just like source_runtime(), but use "path" instead of 'runtimepath'.
int source_runtime | ( | char * | name, |
int | flags | ||
) |
Source the file "name" from all directories in 'runtimepath'. "name" can contain wildcards. When "flags" has DIP_ALL: source all files, otherwise only the first one.
return FAIL when no file could be sourced, OK otherwise.