Macros | Functions
runtime.c File Reference
#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/misc1.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 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
 
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_u *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)
 

Detailed Description

Management of runtime files (including packages)

Macro Definition Documentation

◆ AFTER_SIZE

#define AFTER_SIZE   (sizeof("after") - 1)

◆ NVIM_SIZE

#define NVIM_SIZE   (sizeof("nvim") - 1)

◆ SITE_SIZE

#define SITE_SIZE   (sizeof("site") - 1)

Function Documentation

◆ add_pack_start_dirs()

void add_pack_start_dirs ( void  )

Add all packages in the "start" directory to 'runtimepath'.

◆ ArrayOf()

ArrayOf ( String  )

◆ do_in_cached_path()

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.

◆ do_in_path()

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.

◆ do_in_path_and_pp()

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.

◆ do_in_runtimepath()

int do_in_runtimepath ( char_u name,
int  flags,
DoInRuntimepathCB  callback,
void cookie 
)

Just like do_in_path_and_pp(), using 'runtimepath' for "path".

◆ ex_packadd()

void ex_packadd ( exarg_T eap)

":packadd[!] {name}"

◆ ex_packloadall()

void ex_packloadall ( exarg_T eap)

◆ ex_runtime()

void ex_runtime ( exarg_T eap)

":runtime [what] {name}"

◆ get_lib_dir()

char* get_lib_dir ( void  )

◆ load_plugins()

void load_plugins ( void  )

Read all the plugin files at startup.

◆ load_start_packages()

void load_start_packages ( void  )

Load plugins from all packages in the "start" directory.

◆ runtime_inspect()

Array runtime_inspect ( void  )

◆ runtime_search_path_build()

RuntimeSearchPath runtime_search_path_build ( void  )

◆ runtime_search_path_free()

void runtime_search_path_free ( RuntimeSearchPath  path)

◆ runtime_search_path_get_cached()

RuntimeSearchPath runtime_search_path_get_cached ( int *  ref)

◆ runtime_search_path_invalidate()

void runtime_search_path_invalidate ( void  )

◆ runtime_search_path_unref()

void runtime_search_path_unref ( RuntimeSearchPath  path,
int *  ref 
)

◆ runtime_search_path_validate()

void runtime_search_path_validate ( void  )

◆ runtimepath_default()

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

Parameters
clean_argNvim was started with –clean.
Returns
allocated string with the value

◆ source_in_path()

int source_in_path ( char_u path,
char_u name,
int  flags 
)

Just like source_runtime(), but use "path" instead of 'runtimepath'.

◆ source_runtime()

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.