Tab Completion of File Paths

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Tab Completion of File Paths

Scott Morgan
The thread on getting script paths made me think of something that'd be
useful, but is possibly hard to do and certainly shouldn't be within the
standard distro: Tab completion for file functions.

e.g. you're in a REPL Lua interface and you do something like:

 > f = io.open("c:\exa<tab>
 > f = io.open("c:\example\

Same for any of the functions that take file paths.

Has anybody done this? How?

Scott

Reply | Threaded
Open this post in threaded view
|

Re: Tab Completion of File Paths

Gabriel Bertilson
On Tue, Jan 21, 2020 at 4:08 PM Scott Morgan <[hidden email]> wrote:

>
> The thread on getting script paths made me think of something that'd be
> useful, but is possibly hard to do and certainly shouldn't be within the
> standard distro: Tab completion for file functions.
>
> e.g. you're in a REPL Lua interface and you do something like:
>
>  > f = io.open("c:\exa<tab>
>  > f = io.open("c:\example\
>
> Same for any of the functions that take file paths.
>
> Has anybody done this? How?
>
> Scott

On Linux at least, this is provided by Mike Pall's "advanced readline
support" patch in Lua Power Patches
(http://lua-users.org/wiki/LuaPowerPatches). It's one of the patches I
generally use when I recompile Lua, along with Dirk Laurie's "preload
libraries with customized global names" patch. I never figured out how
to get it to work in Windows, though.

— Gabriel