aboutsummaryrefslogtreecommitdiff
path: root/src/api.h
blob: 39a51b91572114adab6e0dac7a6276c36ef29c5a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#ifndef NEOVIM_API_H
#define NEOVIM_API_H

#include <stdint.h>

/// Send keys to vim input buffer, simulating user input.
///
/// @param str The keys to send
void api_push_keys(char *str);

/// Executes an ex-mode command str
///
/// @param str The command str
void api_command(char *str);

/// Evaluates the expression str using the vim internal expression
/// evaluator (see |expression|).  Returns the expression result as:
/// - a string if the Vim expression evaluates to a string or number
/// - a list if the Vim expression evaluates to a Vim list
/// - a dictionary if the Vim expression evaluates to a Vim dictionary
/// Dictionaries and lists are recursively expanded.
///
/// @param str The expression str
void api_eval(char *str);

/// Like eval, but returns special object ids that can be used to interact
/// with the real objects remotely.
//
/// @param str The expression str
uint32_t api_bind_eval(char *str);

/// Returns a list of paths contained in 'runtimepath'
/// 
/// @return The list of paths
char **api_list_runtime_paths(void);

/// Return a list of buffers
///
/// @return the list of buffers
char **api_list_buffers(void);

/// Return a list of windows
///
/// @return the list of windows
char **api_list_windows(void);

/// Return a list of tabpages
///
/// @return the list of tabpages
char **api_list_tabpages(void);

/// Return the current line
///
/// @return The current line
char *api_get_current_line(void);

/// Return the current buffer
///
/// @return The current buffer
uint32_t api_get_current_buffer(void);

/// Return the current window
///
/// @return The current window
uint32_t api_get_current_window(void);

/// Return the current tabpage
///
/// @return The current tabpage
uint32_t api_get_current_tabpage(void);

/// Sets the current line
///
/// @param line The line contents
void api_set_current_line(char *line);

/// Sets the current buffer
///
/// @param id The buffer id
void api_set_current_buffer(uint32_t id);

/// Sets the current window
///
/// @param id The window id
void api_set_current_window(uint32_t id);

/// Sets the current tabpage
///
/// @param id The tabpage id
void api_set_current_tabpage(uint32_t id);

/// Get an option value string
///
/// @param name The option name
char *api_get_option(char *name);

/// Get an option value string
///
/// @param name The option name
/// @param value The new option value
void api_set_option(char *name, char *value);

/// Write a message to vim output buffer
///
/// @param str The message
void api_out_write(char *str);

/// Write a message to vim error buffer
///
/// @param str The message
void api_err_write(char *str);

#endif // NEOVIM_API_H