diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2012-06-11 01:53:33 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2012-06-11 01:53:33 +0200 |
commit | 605f2641d83f4294147bede9403a590a29a6674a (patch) | |
tree | 294a5f2906af77f184176af88e9b86ce2e3f8b40 | |
parent | c9677ed83c948c9afb7f1bbd9bac91c854289887 (diff) | |
download | busybox-w32-605f2641d83f4294147bede9403a590a29a6674a.tar.gz busybox-w32-605f2641d83f4294147bede9403a590a29a6674a.tar.bz2 busybox-w32-605f2641d83f4294147bede9403a590a29a6674a.zip |
vi: do not set autoindent by default
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | editors/vi.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/editors/vi.c b/editors/vi.c index b4ad12e5c..a07b68714 100644 --- a/editors/vi.c +++ b/editors/vi.c | |||
@@ -154,12 +154,12 @@ | |||
154 | //usage:#define vi_full_usage "\n\n" | 154 | //usage:#define vi_full_usage "\n\n" |
155 | //usage: "Edit FILE\n" | 155 | //usage: "Edit FILE\n" |
156 | //usage: IF_FEATURE_VI_COLON( | 156 | //usage: IF_FEATURE_VI_COLON( |
157 | //usage: "\n -c Initial command to run ($EXINIT also available)" | 157 | //usage: "\n -c CMD Initial command to run ($EXINIT also available)" |
158 | //usage: ) | 158 | //usage: ) |
159 | //usage: IF_FEATURE_VI_READONLY( | 159 | //usage: IF_FEATURE_VI_READONLY( |
160 | //usage: "\n -R Read-only" | 160 | //usage: "\n -R Read-only" |
161 | //usage: ) | 161 | //usage: ) |
162 | //usage: "\n -H Short help regarding available features" | 162 | //usage: "\n -H List available features" |
163 | 163 | ||
164 | #include "libbb.h" | 164 | #include "libbb.h" |
165 | /* Should be after libbb.h: on some systems regex.h needs sys/types.h: */ | 165 | /* Should be after libbb.h: on some systems regex.h needs sys/types.h: */ |
@@ -558,7 +558,8 @@ int vi_main(int argc, char **argv) | |||
558 | } | 558 | } |
559 | #endif | 559 | #endif |
560 | 560 | ||
561 | vi_setops = VI_AUTOINDENT | VI_SHOWMATCH | VI_IGNORECASE; | 561 | // autoindent is not default in vim 7.3 |
562 | vi_setops = /*VI_AUTOINDENT |*/ VI_SHOWMATCH | VI_IGNORECASE; | ||
562 | // 1- process $HOME/.exrc file (not inplemented yet) | 563 | // 1- process $HOME/.exrc file (not inplemented yet) |
563 | // 2- process EXINIT variable from environment | 564 | // 2- process EXINIT variable from environment |
564 | // 3- process command line args | 565 | // 3- process command line args |
@@ -584,7 +585,7 @@ int vi_main(int argc, char **argv) | |||
584 | #if ENABLE_FEATURE_VI_COLON | 585 | #if ENABLE_FEATURE_VI_COLON |
585 | case 'c': // cmd line vi command | 586 | case 'c': // cmd line vi command |
586 | if (*optarg) | 587 | if (*optarg) |
587 | initial_cmds[initial_cmds[0] != 0] = xstrndup(optarg, MAX_INPUT_LEN); | 588 | initial_cmds[initial_cmds[0] != NULL] = xstrndup(optarg, MAX_INPUT_LEN); |
588 | break; | 589 | break; |
589 | #endif | 590 | #endif |
590 | case 'H': | 591 | case 'H': |
@@ -1191,7 +1192,7 @@ static void colon(char *buf) | |||
1191 | char *argp; | 1192 | char *argp; |
1192 | #endif | 1193 | #endif |
1193 | i = 0; // offset into args | 1194 | i = 0; // offset into args |
1194 | // only blank is regarded as args delmiter. What about tab '\t' ? | 1195 | // only blank is regarded as args delimiter. What about tab '\t'? |
1195 | if (!args[0] || strcasecmp(args, "all") == 0) { | 1196 | if (!args[0] || strcasecmp(args, "all") == 0) { |
1196 | // print out values of all options | 1197 | // print out values of all options |
1197 | #if ENABLE_FEATURE_VI_SETOPTS | 1198 | #if ENABLE_FEATURE_VI_SETOPTS |
@@ -2176,7 +2177,7 @@ static void show_help(void) | |||
2176 | "\n\tPattern searches with / and ?" | 2177 | "\n\tPattern searches with / and ?" |
2177 | #endif | 2178 | #endif |
2178 | #if ENABLE_FEATURE_VI_DOT_CMD | 2179 | #if ENABLE_FEATURE_VI_DOT_CMD |
2179 | "\n\tLast command repeat with \'.\'" | 2180 | "\n\tLast command repeat with ." |
2180 | #endif | 2181 | #endif |
2181 | #if ENABLE_FEATURE_VI_YANKMARK | 2182 | #if ENABLE_FEATURE_VI_YANKMARK |
2182 | "\n\tLine marking with 'x" | 2183 | "\n\tLine marking with 'x" |
@@ -2187,7 +2188,7 @@ static void show_help(void) | |||
2187 | //redundant: usage text says this too: "\n\tReadonly with -R command line arg" | 2188 | //redundant: usage text says this too: "\n\tReadonly with -R command line arg" |
2188 | #endif | 2189 | #endif |
2189 | #if ENABLE_FEATURE_VI_SET | 2190 | #if ENABLE_FEATURE_VI_SET |
2190 | "\n\tSome colon mode commands with \':\'" | 2191 | "\n\tSome colon mode commands with :" |
2191 | #endif | 2192 | #endif |
2192 | #if ENABLE_FEATURE_VI_SETOPTS | 2193 | #if ENABLE_FEATURE_VI_SETOPTS |
2193 | "\n\tSettable options with \":set\"" | 2194 | "\n\tSettable options with \":set\"" |