Annotation of src/usr.bin/vim/ops.h, Revision 1.1.1.1
1.1 downsj 1: /* $OpenBSD$ */
2: /* vi:set ts=4 sw=4:
3: *
4: * VIM - Vi IMproved by Bram Moolenaar
5: *
6: * Do ":help uganda" in Vim to read copying and usage conditions.
7: * Do ":help credits" in Vim to see a list of people who contributed.
8: */
9:
10: /*
11: * ops.h: Things mostly shared between normal.c, cmdline.c and ops.c
12: */
13:
14: /*
15: * Operators
16: */
17: #define NOP 0 /* no pending operation */
18: #define DELETE 1
19: #define YANK 2
20: #define CHANGE 3
21: #define LSHIFT 4 /* left shift */
22: #define RSHIFT 5 /* right shift */
23: #define FILTER 6
24: #define TILDE 7 /* switch case */
25: #define INDENT 8
26: #define FORMAT 9
27: #define COLON 10
28: #define UPPER 11 /* make upper case */
29: #define LOWER 12 /* make lower case */
30: #define JOIN 13 /* only for visual mode */
31: #define GFORMAT 14 /* "gq" */
32:
33: /*
34: * operator characters; the order must correspond to the defines above!
35: */
36: EXTERN char_u *opchars INIT(= (char_u *)"dyc<>!~=Q:UuJq");
37:
38: /*
39: * When a cursor motion command is made, it is marked as being a character or
40: * line oriented motion. Then, if an operator is in effect, the operation
41: * becomes character or line oriented accordingly.
42: *
43: * Character motions are marked as being inclusive or not. Most char. motions
44: * are inclusive, but some (e.g. 'w') are not.
45: *
46: * Generally speaking, every command in normal() should either clear any pending
47: * operator (with CLEAROP), or set the motion type variable.
48: */
49:
50: /*
51: * Motion types
52: */
53: #define MCHAR 0
54: #define MLINE 1
55: #define MBLOCK 2
56:
57: EXTERN int op_type INIT(= NOP); /* current pending operator type */
58: EXTERN int op_motion_type; /* type of the current cursor motion */
59: EXTERN int op_inclusive; /* TRUE if char motion is inclusive */
60: EXTERN int op_block_mode INIT(= FALSE);
61: /* current operator is Visual block mode */
62: EXTERN colnr_t op_start_vcol; /* start col for block mode operator */
63: EXTERN colnr_t op_end_vcol; /* end col for block mode operator */
64: EXTERN int op_end_adjusted; /* backuped op_end one char */
65: EXTERN long op_line_count; /* number of lines from op_start to
66: op_end (inclusive) */
67: EXTERN int op_empty; /* op_start and op_end the same */
68: EXTERN int op_is_VIsual; /* opeartor on visual area */
69:
70: EXTERN int yankbuffer INIT(= 0); /* current yank buffer */