Split window and jump to #define
Example
Normal 0 / 2Command-line 1 / 2Normal 2 / 2#include "defs.h"
int result = LIMIT;Cursor on line 1, column 1#include "defs.h"
int result = LIMIT;Cursor on line 1, column 1#define LIMIT 3
int helper(void);Cursor on line 1, column 9Split window and jump to #define.
Windows
- main.c Active
#include "defs.h" int result = LIMIT;
Command entered · ready to apply
Windows
- main.c Active
#include "defs.h" int result = LIMIT;
Command line
- Typed text
:dsplit LIMIT- Insertion offset
13
Jump to the macro definition in defs.h. A new split keeps main.c visible.
Windows
- defs.h Active
#define LIMIT 3 int helper(void);
- main.c
#include "defs.h" int result = LIMIT;
Before & after
#include "defs.h"
int result = LIMIT;Cursor on line 1, column 1Windows
- main.c Active
#include "defs.h" int result = LIMIT;
#define LIMIT 3
int helper(void);Cursor on line 1, column 9Windows
- defs.h Active
#define LIMIT 3 int helper(void);
- main.c
#include "defs.h" int result = LIMIT;
Documentation-backed illustration. +find_in_path; main.c includes the shown defs.h, path=. finds it, define matches #define, and include matches #include; nosplitbelow places the new horizontal split above the source window; the current buffer is named main.c and defs.h is a readable disk file beside it. Jump to the macro definition in defs.h. A new split keeps main.c visible. Primary help: :dsplit.
Details & Vim help
Split window and jump to #define. This Ex reference uses the full command name; the alphabetical index omits arguments. Supply the ranges, arguments, flags and prerequisite state documented in the linked help. Press Enter to submit a complete command. The index spelling :dsp[lit] puts the optional abbreviation suffix in square brackets; those brackets are not typed. Availability and exact behavior can depend on Vim build features, options, mappings and editor state; the linked help is authoritative.