tvi: start in ex mode if the executable is ex - neatvi - [fork] simple vi-type editor with UTF-8 support
(HTM) git clone git://src.adamsgaard.dk/neatvi
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
(DIR) commit a31794862811a9d7f32ea15eefe36dc0ced578e8
(DIR) parent 1c7721d44a7eca5625abb8848294646e9c786f6e
(HTM) Author: Ali Gholami Rudi <ali@rudi.ir>
Date: Thu, 14 Apr 2016 01:15:35 +0430
vi: start in ex mode if the executable is ex
Suggested by Christian Neukirchen <chneukirchen@gmail.com>.
Diffstat:
M vi.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
(DIR) diff --git a/vi.c b/vi.c
t@@ -1310,7 +1310,8 @@ static void vi(void)
int main(int argc, char *argv[])
{
int i;
- xvis = 1;
+ char *prog = strchr(argv[0], '/') ? strrchr(argv[0], '/') + 1 : argv[0];
+ xvis = strcmp("ex", prog) && strcmp("neatex", prog);
for (i = 1; i < argc && argv[i][0] == '-'; i++) {
if (argv[i][1] == 's')
xled = 0;