* Re: filecompletion in ksh93 (fwd)
@ 1999-12-11 17:03 Bart Schaefer
1999-12-19 1:41 ` Gabor
0 siblings, 1 reply; 2+ messages in thread
From: Bart Schaefer @ 1999-12-11 17:03 UTC (permalink / raw)
To: zsh-workers
This is interesting; I haven't seen a recent ksh manual. Looks like ksh
can do "widgets" too, after a fashion. Use of "trap" on a magic KEYBD
signal to invoke the function is kinda cutesy.
---------- Forwarded message ----------
Date: 11 Dec 1999 09:33:05 -0500
From: Gabor <gabor@vmunix.com>
Newsgroups: comp.unix.shell
Subject: Re: filecompletion in ksh93
In comp.unix.shell, Dave Brown <dagbrown@home.com> wrote:
# In article <82s1s9$cn5$1@avon.europe.sco.com>,
# Ajay Matai <matai@bigfoot.com> wrote:
# : How to make tab work as filename completion in ksh?
#
# You can't. You have to type awkward, nonintuitive characters
Wrong. You can. There might be better solutions than mine here. This one
works in vi mode, and the next one in emacs.
function vi_tab
{
# what looks like a space on the next line is a physical tab
if [[ ${.sh.edmode} == "^[" && ${.sh.edchar} == " " ]] then
.sh.edchar="^[\\"
elif [[ ${.sh.edmode} != "^[" && ${.sh.edchar} == "=" ]] then
.sh.edchar="=a"
fi
}
trap 'vi_tab' KEYBD
function emacs_tab
{
# what looks like a space on the next line is a physical tab
if [[ ${.sh.edchar} == " " ]] then
.sh.edchar="^[^["
fi
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: filecompletion in ksh93 (fwd)
1999-12-11 17:03 filecompletion in ksh93 (fwd) Bart Schaefer
@ 1999-12-19 1:41 ` Gabor
0 siblings, 0 replies; 2+ messages in thread
From: Gabor @ 1999-12-19 1:41 UTC (permalink / raw)
To: Bart Schaefer; +Cc: zsh-workers
On Sat, Dec 11, 1999 at 09:03:10AM -0800, Bart Schaefer wrote:
# This is interesting; I haven't seen a recent ksh manual. Looks like ksh
# can do "widgets" too, after a fashion. Use of "trap" on a magic KEYBD
# signal to invoke the function is kinda cutesy.
I am surprised more people don't know about this. It was one of the
first nifty things I learned in ksh93. :) But what's the best is that
people make statements about things which they know nothing about.
Like that it cannot be done, even though they don't use ksh93. I love
that.
# ---------- Forwarded message ----------
# Date: 11 Dec 1999 09:33:05 -0500
# From: Gabor <gabor@vmunix.com>
# Newsgroups: comp.unix.shell
# Subject: Re: filecompletion in ksh93
#
# In comp.unix.shell, Dave Brown <dagbrown@home.com> wrote:
# # In article <82s1s9$cn5$1@avon.europe.sco.com>,
# # Ajay Matai <matai@bigfoot.com> wrote:
# # : How to make tab work as filename completion in ksh?
# #
# # You can't. You have to type awkward, nonintuitive characters
#
# Wrong. You can. There might be better solutions than mine here. This one
# works in vi mode, and the next one in emacs.
#
# function vi_tab
# {
# # what looks like a space on the next line is a physical tab
# if [[ ${.sh.edmode} == "^[" && ${.sh.edchar} == " " ]] then
# .sh.edchar="^[\\"
# elif [[ ${.sh.edmode} != "^[" && ${.sh.edchar} == "=" ]] then
# .sh.edchar="=a"
# fi
# }
#
# trap 'vi_tab' KEYBD
#
# function emacs_tab
# {
# # what looks like a space on the next line is a physical tab
# if [[ ${.sh.edchar} == " " ]] then
# .sh.edchar="^[^["
# fi
# }
#
#
#
#
#
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1999-12-19 1:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-11 17:03 filecompletion in ksh93 (fwd) Bart Schaefer
1999-12-19 1:41 ` Gabor
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).