wowest
wowest

Reputation: 1994

How can I make cygwin autocomplete windows paths?

I don't want to type /cygdrive/c/path/to/stuff, especially when using tools that don't know anything about cygwin. Is there a way to configure cygwin to autocomplete "c:\path\to\stuff" or even "c:/path/to/stuff"?

Upvotes: 10

Views: 4747

Answers (4)

Gery
Gery

Reputation: 9036

use alias:

Open the .bashrc file already copied in your home directory and type (I use "vi" editor for this but you can use "pico" which is a bit easier):

alias C="C:\Documents\ and\ Settings\Administrator"

you can use any path here. Save the .bashrc ("Ctrl+X" in pico I think, and :wq in "vi") and close the terminal. After restarting this console, typing "C" and pressing enter will send you automatically to "C:\Documents and Settings\Administrator"

To know which alias you have, just type "alias" in your terminal and all your alias will show up.

Upvotes: 0

Kevin Haines
Kevin Haines

Reputation: 2552

Windows itself can autocomplete paths, with some minor registry tweaks. Or am I missing something in this question?

Upvotes: 0

Alastair
Alastair

Reputation: 4523

For tools that can't understand cygwin paths, you'll need to convert them to windows paths. The cygpath utility can do this for you:

notepad $(cygpath -w /cygdrive/c/path/to/stuff)

You can probably create aliases or wrapper scripts for commonly-used windows executables.

Upvotes: 11

John Safranek
John Safranek

Reputation: 743

Autocomplete should be working after the /cygdrive/c bit. Make a symlink for "/cygdrive/c/" to something else, like "ln -s /cygdrive/c /c". Also, make sure your inputrc is set up correctly.

Upvotes: 3

Related Questions