Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
globals.h File Reference
#include <stdbool.h>
#include <inttypes.h>
#include "nvim/macros.h"
#include "nvim/ex_eval.h"
#include "nvim/iconv.h"
#include "nvim/mbyte.h"
#include "nvim/menu.h"
#include "nvim/syntax_defs.h"
#include "nvim/types.h"
#include "nvim/event/loop.h"
#include "nvim/os/os_defs.h"

Go to the source code of this file.

Data Structures

struct  nvim_stats_s
 
struct  caller_scope
 

Macros

#define IOSIZE   (1024+1)
 
#define MSG_BUF_LEN   480
 
#define MSG_BUF_CLEN   (MSG_BUF_LEN / 6)
 
#define _PATHSEPSTR   "/"
 
#define FILETYPE_FILE   "filetype.vim"
 
#define FTPLUGIN_FILE   "ftplugin.vim"
 
#define INDENT_FILE   "indent.vim"
 
#define FTOFF_FILE   "ftoff.vim"
 
#define FTPLUGOF_FILE   "ftplugof.vim"
 
#define INDOFF_FILE   "indoff.vim"
 
#define DFLT_ERRORFILE   "errors.err"
 
#define SYS_VIMRC_FILE   "$VIM" _PATHSEPSTR "sysinit.vim"
 
#define DFLT_HELPFILE   "$VIMRUNTIME" _PATHSEPSTR "doc" _PATHSEPSTR "help.txt"
 
#define SYNTAX_FNAME   "$VIMRUNTIME" _PATHSEPSTR "syntax" _PATHSEPSTR "%s.vim"
 
#define EXRC_FILE   ".exrc"
 
#define VIMRC_FILE   ".nvimrc"
 
#define NO_SCREEN   2
 
#define NO_BUFFERS   1
 
#define DFLT_COLS   80
 
#define DFLT_ROWS   24
 
#define vim_lseek   lseek
 
#define vim_ftell   ftell
 
#define vim_fseek(a, b, c)   fseek(a, (long)b, c)
 
#define CONT_ADDING   1 /* "normal" or "adding" expansion */
 
#define CONT_INTRPT   (2 + 4) /* a ^X interrupted the current expansion */
 
#define CONT_N_ADDS   4 /* next ^X<> will add-new or expand-current */
 
#define CONT_S_IPOS
 
#define CONT_SOL
 
#define CONT_LOCAL
 
#define PROF_NONE   0
 profiling not started More...
 
#define PROF_YES   1
 profiling busy More...
 
#define PROF_PAUSED   2
 profiling paused More...
 
#define SID_MODELINE   -1
 
#define SID_CMDARG   -2
 
#define SID_CARG   -3
 
#define SID_ENV   -4
 
#define SID_ERROR   -5
 
#define SID_NONE   -6
 
#define SID_LUA   -7
 
#define SID_API_CLIENT   -8
 
#define ONE_WINDOW   (firstwin == lastwin)
 
#define FOR_ALL_FRAMES(frp, first_frame)   for (frp = first_frame; frp != NULL; frp = frp->fr_next)
 
#define FOR_ALL_TAB_WINDOWS(tp, wp)
 
#define FOR_ALL_WINDOWS_IN_TAB(wp, tp)
 
#define FOR_ALL_TABS(tp)   for (tabpage_T *tp = first_tabpage; tp != NULL; tp = tp->tp_next)
 
#define FOR_ALL_BUFFERS(buf)   for (buf_T *buf = firstbuf; buf != NULL; buf = buf->b_next)
 
#define FOR_ALL_BUFFERS_BACKWARDS(buf)   for (buf_T *buf = lastbuf; buf != NULL; buf = buf->b_prev)
 
#define FOR_ALL_SIGNS_IN_BUF(buf, sign)   for (sign = buf->b_signlist; sign != NULL; sign = sign->next)
 
#define DBCS_JPN   932 /* japan */
 
#define DBCS_JPNU   9932 /* euc-jp */
 
#define DBCS_KOR   949 /* korea */
 
#define DBCS_KORU   9949 /* euc-kr */
 
#define DBCS_CHS   936 /* chinese */
 
#define DBCS_CHSU   9936 /* euc-cn */
 
#define DBCS_CHT   950 /* taiwan */
 
#define DBCS_CHTU   9950 /* euc-tw */
 
#define DBCS_2BYTE   1 /* 2byte- */
 
#define DBCS_DEBUG   -1
 
#define enc_utf8   true
 
#define has_mbyte   true
 
#define SEA_NONE   0 /* don't use dialog */
 
#define SEA_DIALOG   1 /* use dialog when possible */
 
#define SEA_QUIT   2 /* quit editing the file */
 
#define SEA_RECOVER   3 /* recover the file */
 
#define STL_IN_ICON   1
 
#define STL_IN_TITLE   2
 
#define MIN_CD_SCOPE   kCdScopeWindow
 
#define MAX_CD_SCOPE   kCdScopeGlobal
 

Typedefs

typedef off_t off_T
 

Enumerations

enum  { WM_SHOWN = 1, WM_SCROLLED = 2, WM_LIST = 3 }
 
enum  WorkingStatus { kUnknown, kWorking, kBroken }
 
enum  CdScope { kCdScopeInvalid = -1, kCdScopeWindow, kCdScopeTab, kCdScopeGlobal }
 

Functions

EXTERN struct nvim_stats_s INIT (=PROF_NONE)
 PROF_ values. More...
 

Variables

int64_t fsync
 
int64_t redraw
 
EXTERN int cmdline_row
 
EXTERN int msg_col
 
EXTERN int msg_row
 
EXTERN int msg_scrolled
 
EXTERN dict_T vimvardict
 
EXTERN dict_T globvardict
 
EXTERN int did_emsg
 
EXTERN bool called_vim_beep
 
EXTERN int did_emsg_syntax
 
EXTERN int called_emsg
 
EXTERN except_Tcurrent_exception
 
EXTERN struct caller_scope provider_caller_scope
 
EXTERN linenr_T search_match_lines
 
EXTERN colnr_T search_match_endcol
 
EXTERN int modified_was_set
 
EXTERN int mouse_grid
 
EXTERN int mouse_row
 
EXTERN int mouse_col
 
EXTERN win_Tfirstwin
 
EXTERN win_Tlastwin
 
EXTERN win_Tcurwin
 
EXTERN win_Taucmd_win
 
EXTERN frame_Ttopframe
 
EXTERN tabpage_Tfirst_tabpage
 
EXTERN tabpage_Tcurtab
 
EXTERN alist_T global_alist
 
EXTERN int ru_col
 
EXTERN int ru_wid
 
EXTERN int sc_col
 
EXTERN pos_T VIsual
 Start position of active Visual selection. More...
 
EXTERN int VIsual_reselect
 Whether to restart the selection after a Select-mode mapping or menu. More...
 
EXTERN pos_T where_paste_started
 
EXTERN pos_T Insstart
 
EXTERN pos_T Insstart_orig
 
EXTERN int arrow_used
 
EXTERN hlf_T edit_submode_highl
 
EXTERN cmdmod_T cmdmod
 
EXTERN char_u IObuff [IOSIZE]
 Buffer for sprintf, I/O, etc. More...
 
EXTERN char_u NameBuff [MAXPATHL]
 Buffer for expanding file names. More...
 
EXTERN char_u msg_buf [MSG_BUF_LEN]
 Small buffer for messages. More...
 
EXTERN char os_buf [IOSIZE]
 
EXTERN int stop_insert_mode
 
EXTERN bool KeyTyped
 
EXTERN int KeyStuffed
 
EXTERN int searchcmdlen
 
EXTERN char_u langmap_mapchar [256]
 
EXTERN long sub_nsubs
 
EXTERN linenr_T sub_nlines
 
EXTERN char_u wim_flags [4]
 
EXTERN linenr_T printer_page_num
 
EXTERN time_t starttime
 
EXTERN int vim_ignored
 

Macro Definition Documentation

#define _PATHSEPSTR   "/"
#define CONT_ADDING   1 /* "normal" or "adding" expansion */
#define CONT_INTRPT   (2 + 4) /* a ^X interrupted the current expansion */
#define CONT_LOCAL
Value:
32 /* for ctrl_x_mode 0, ^X^P/^X^N do a local
* expansion, (eg use complete=.) */
#define CONT_N_ADDS   4 /* next ^X<> will add-new or expand-current */
#define CONT_S_IPOS
Value:
8 /* next ^X<> will set initial_pos?
* if so, word-wise-expansion will set SOL */
#define CONT_SOL
Value:
16 /* pattern includes start of line, just for
* word-wise expansion, not set for ^X^L */
#define DBCS_2BYTE   1 /* 2byte- */
#define DBCS_CHS   936 /* chinese */
#define DBCS_CHSU   9936 /* euc-cn */
#define DBCS_CHT   950 /* taiwan */
#define DBCS_CHTU   9950 /* euc-tw */
#define DBCS_DEBUG   -1
#define DBCS_JPN   932 /* japan */
#define DBCS_JPNU   9932 /* euc-jp */
#define DBCS_KOR   949 /* korea */
#define DBCS_KORU   9949 /* euc-kr */
#define DFLT_COLS   80
#define DFLT_ERRORFILE   "errors.err"
#define DFLT_HELPFILE   "$VIMRUNTIME" _PATHSEPSTR "doc" _PATHSEPSTR "help.txt"
#define DFLT_ROWS   24
#define enc_utf8   true
#define EXRC_FILE   ".exrc"
#define FILETYPE_FILE   "filetype.vim"
#define FOR_ALL_BUFFERS (   buf)    for (buf_T *buf = firstbuf; buf != NULL; buf = buf->b_next)
#define FOR_ALL_BUFFERS_BACKWARDS (   buf)    for (buf_T *buf = lastbuf; buf != NULL; buf = buf->b_prev)
#define FOR_ALL_FRAMES (   frp,
  first_frame 
)    for (frp = first_frame; frp != NULL; frp = frp->fr_next)
#define FOR_ALL_SIGNS_IN_BUF (   buf,
  sign 
)    for (sign = buf->b_signlist; sign != NULL; sign = sign->next)
#define FOR_ALL_TAB_WINDOWS (   tp,
  wp 
)
Value:
#define FOR_ALL_TABS(tp)
Definition: globals.h:463
#define FOR_ALL_WINDOWS_IN_TAB(wp, tp)
Definition: globals.h:439
#define FOR_ALL_TABS (   tp)    for (tabpage_T *tp = first_tabpage; tp != NULL; tp = tp->tp_next)
#define FOR_ALL_WINDOWS_IN_TAB (   wp,
  tp 
)
Value:
for (win_T *wp = ((tp) == curtab) \
? firstwin : (tp)->tp_firstwin; wp != NULL; wp = wp->w_next)
EXTERN win_T * firstwin
Definition: globals.h:425
return NULL
Definition: eval.c:23643
Definition: buffer_defs.h:1049
EXTERN tabpage_T * curtab
Definition: globals.h:459
#define FTOFF_FILE   "ftoff.vim"
#define FTPLUGIN_FILE   "ftplugin.vim"
#define FTPLUGOF_FILE   "ftplugof.vim"
#define has_mbyte   true
#define INDENT_FILE   "indent.vim"
#define INDOFF_FILE   "indoff.vim"
#define IOSIZE   (1024+1)
#define MAX_CD_SCOPE   kCdScopeGlobal
#define MIN_CD_SCOPE   kCdScopeWindow
#define MSG_BUF_CLEN   (MSG_BUF_LEN / 6)
#define MSG_BUF_LEN   480
#define NO_BUFFERS   1
#define NO_SCREEN   2
#define ONE_WINDOW   (firstwin == lastwin)
#define PROF_NONE   0

profiling not started

#define PROF_PAUSED   2

profiling paused

#define PROF_YES   1

profiling busy

#define SEA_DIALOG   1 /* use dialog when possible */
#define SEA_NONE   0 /* don't use dialog */
#define SEA_QUIT   2 /* quit editing the file */
#define SEA_RECOVER   3 /* recover the file */
#define SID_API_CLIENT   -8
#define SID_CARG   -3
#define SID_CMDARG   -2
#define SID_ENV   -4
#define SID_ERROR   -5
#define SID_LUA   -7
#define SID_MODELINE   -1
#define SID_NONE   -6
#define STL_IN_ICON   1
#define STL_IN_TITLE   2
#define SYNTAX_FNAME   "$VIMRUNTIME" _PATHSEPSTR "syntax" _PATHSEPSTR "%s.vim"
#define SYS_VIMRC_FILE   "$VIM" _PATHSEPSTR "sysinit.vim"
#define vim_fseek (   a,
  b,
 
)    fseek(a, (long)b, c)
#define vim_ftell   ftell
#define vim_lseek   lseek
#define VIMRC_FILE   ".nvimrc"

Typedef Documentation

typedef off_t off_T

Enumeration Type Documentation

anonymous enum
Enumerator
WM_SHOWN 

wildmenu showing

WM_SCROLLED 

wildmenu showing with scroll

WM_LIST 

cmdline CTRL-D

enum CdScope

The scope of a working-directory command like :cd.

Scopes are enumerated from lowest to highest. When adding a scope make sure to update all functions using scopes as well, such as the implementation of getcwd(). When using scopes as limits (e.g. in loops) don't use the scopes directly, use MIN_CD_SCOPE and MAX_CD_SCOPE instead.

Enumerator
kCdScopeInvalid 
kCdScopeWindow 

Affects one window.

kCdScopeTab 

Affects one tab page.

kCdScopeGlobal 

Affects the entire Nvim instance.

Used to track the status of external functions. Currently only used for iconv().

Enumerator
kUnknown 
kWorking 
kBroken 

Function Documentation

EXTERN struct nvim_stats_s INIT ( )

PROF_ values.

cmdline recursion level

result of cmdline window or 0

type of cmdline window or 0

key value of 'cedit' option

Stream to write script to.

Encoding used when 'fencs' is set to "default".

TRUE when redoing Visual.

Type of Visual mode.

Whether Select mode is active.

Whether Visual mode is active.

Batch-mode: "-es" or "-Es" commandline argument was given.

Non-zero when the current buffer can't be changed. Used for FileChangedRO.

the previous argument list id

Lines left before a "more" message. Ex mode needs to be able to reset this after you type something.

Set when a throw that cannot be handled in do_cmdline() must be propagated to the cstack of the previously called do_cmdline().

Set when a ":finish" or ":return" that cannot be handled in do_cmdline() must be propagated to the cstack of the previously called do_cmdline().

Number of nested try conditionals (across function calls and ":source" commands).

When "force_abort" is TRUE, always skip commands after an error message, even after the outermost ":endif", ":endwhile" or ":endfor" or for a function without the "abort" flag. It is set to TRUE when "trylevel" is non-zero (and ":silent!" was not used) or an exception is being thrown at the time an error is detected. It is set to FALSE when "trylevel" gets zero again and there was no error or interrupt or throw.

"msg_list" points to a variable in the stack of do_cmdline() which keeps the list of arguments of several emsg() calls, one of which is to be converted to an error exception immediately after the failing command returns. The message to be used for the exception value is pointed to by the "throw_msg" field of the first element in the list. It is usually the same as the "msg" field of that element, but can be identical to the "msg" field of a later list element, when the "emsg_severe" flag was set when the emsg() call was made.

When set, don't convert an error to an exception. Used when displaying the interrupt message or reporting an exception that is still uncaught at the top level (which has already been discarded then). Also used for the error message when no exception can be thrown.

The stack of all caught and not finished exceptions. The exception on the top of the stack is the one got by evaluation of v:exception. The complete stack of all caught and pending exceptions is embedded in the various cstacks; the pending exceptions, however, are not on the caught stack.

Garbage collection can only take place when we are sure there are no Lists or Dictionaries being used internally. This is flagged with "may_garbage_collect" when we are at the toplevel. "want_garbage_collect" is set by the garbagecollect() function, which means we do garbage collection before waiting for a char at the toplevel. "garbage_collect_at_exit" indicates garbagecollect(1) was called.

Non-zero when only "safe" commands are allowed, e.g. when sourcing .exrc or .vimrc in current directory.

Non-zero when changing text and jumping to another window/buffer is not allowed.

Non-zero when no buffer name can be changed, no buffer can be deleted and current directory can't be changed. Used for SwapExists et al.

Non-zero when evaluating an expression in a "sandbox". Several things are not allowed then.

"State" is the main state of Vim. There are other variables that modify the state: Visual_mode: When State is NORMAL or INSERT. finish_op : When State is NORMAL, after typing the operator and before typing the motion command. motion_force: Last motion_force from do_pending_operator() debug_mode: Debug mode

Variable Documentation

EXTERN int arrow_used
EXTERN win_T* aucmd_win
EXTERN int called_emsg
EXTERN bool called_vim_beep
EXTERN int cmdline_row
EXTERN cmdmod_T cmdmod
EXTERN except_T* current_exception

Exception currently being thrown. Used to pass an exception to a different cstack. Also used for discarding an exception before it is caught or made pending.

EXTERN tabpage_T* curtab
EXTERN win_T* curwin
EXTERN int did_emsg
EXTERN int did_emsg_syntax
EXTERN hlf_T edit_submode_highl
EXTERN tabpage_T* first_tabpage
EXTERN win_T* firstwin
int64_t fsync
EXTERN alist_T global_alist
EXTERN dict_T globvardict
EXTERN pos_T Insstart
EXTERN pos_T Insstart_orig
EXTERN char_u IObuff[IOSIZE]

Buffer for sprintf, I/O, etc.

EXTERN int KeyStuffed
EXTERN bool KeyTyped
EXTERN char_u langmap_mapchar[256]
EXTERN win_T* lastwin
EXTERN int modified_was_set
EXTERN int mouse_col
EXTERN int mouse_grid
EXTERN int mouse_row

Small buffer for messages.

EXTERN int msg_col
EXTERN int msg_row
EXTERN int msg_scrolled
EXTERN char_u NameBuff[MAXPATHL]

Buffer for expanding file names.

EXTERN char os_buf[IOSIZE]
EXTERN linenr_T printer_page_num
EXTERN struct caller_scope provider_caller_scope
int64_t redraw
EXTERN int ru_col
EXTERN int ru_wid
EXTERN int sc_col
EXTERN colnr_T search_match_endcol
EXTERN linenr_T search_match_lines
EXTERN int searchcmdlen
EXTERN time_t starttime
EXTERN int stop_insert_mode
EXTERN linenr_T sub_nlines
EXTERN long sub_nsubs
EXTERN frame_T* topframe
EXTERN int vim_ignored
EXTERN dict_T vimvardict
EXTERN pos_T VIsual

Start position of active Visual selection.

EXTERN int VIsual_reselect

Whether to restart the selection after a Select-mode mapping or menu.

EXTERN pos_T where_paste_started

When pasting text with the middle mouse button in visual mode with restart_edit set, remember where it started so we can set Insstart.

EXTERN char_u wim_flags[4]