Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tab key does not yield <tab> #15

Open
lichray opened this issue Mar 2, 2014 · 4 comments
Open

Tab key does not yield <tab> #15

lichray opened this issue Mar 2, 2014 · 4 comments

Comments

@lichray
Copy link
Owner

lichray commented Mar 2, 2014

From Xin Li:

It looks like the new nvi version don't accept in the context of
substitute. A minimal use case would be to replace all leading 8
spaces with tabs, what one would do on older version of nvi would be:

: 1,$ s/^ //g

Now, with nvi in FreeBSD 10.x+, entering won't yield the
character. This seems to be a regression from older nvi version.

@leres
Copy link
Collaborator

leres commented Dec 16, 2016

I also noticed that tab has changed since the 1.79 BSD version of nvi. For example, if you want to convert all blanks to tabs you might use:

 :%s/ /^I/g

With 1.79 (FreeBSD 9.1-RELEASE) you can just type a bare tab. With 2.1.2 (FreeBSD 10.3-RELEASE) or 2.1.3 you must escape ^I with ^V. This makes doing substitution with multiple tabs particularly problematic.

[edit: I just noticed that you can use a bare tab when in ex mode]

Not only was I a System V vi user in the late 70's but I was one of Keith Bostic's primary testers when he was writing nvi. I trip over this all the time and I think it is definitely a bug.

@lichray
Copy link
Owner Author

lichray commented Dec 16, 2016

For now, use

se filec=

in the configuration file to restore the right behavior. I merely set the default file name completion key to Tab, since the file name completion is greatly improved. I was thinking about how to make both work without conflicts, but no luck since then.

@leres
Copy link
Collaborator

leres commented Dec 16, 2016

Thanks for the workaround: it's super helpful!

Is it safe to say that a future version will remove:

 OI(O_FILEC, L("filec=\t"));

from opts_init()?

@lichray
Copy link
Owner Author

lichray commented Dec 16, 2016

Maybe I'll remove it, or find someway to let them work together by making completion code contextual.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants