Created
June 19, 2020 14:36
-
-
Save Gordin/cb44429a25fd7d4d7ba73b970d68b5ab to your computer and use it in GitHub Desktop.
Make Tab-Completion usable in WSL by removing Windows stuff from PATH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # If in WSL, remove all windows stuff from path, except Windows dir for explorer.exe | |
| # This Speeds up Tab-completion A LOT. without this pressing TAB takes ~8.5 seconds, with this | |
| # ~100ms. Change /mnt/\c\/ to something different if the Windows drive is mounted somewhere else... | |
| C_DRIVE='/mnt/c' | |
| if [ -d "$C_DRIVE" ]; then | |
| export PATH=$(echo ${PATH} | \ | |
| awk -v RS=: -v ORS=: "/${C_DRIVE//\//\\/}/ {next} {print}" | sed 's/:*$//') | |
| # Add C:\Windows back so you can do `explorer.exe .` to open an explorer at current directory | |
| export PATH="$PATH:$C_DRIVE/Windows/" | |
| fi |
actually it didn't lol, there is numerous issues
Author
My script is just to remove all unnecessary windows directories out of the PATH, so that the terminal doesn't try to search through them, when you autocomplete binaries.
fzf has a shell shortcut ctrl+t, that let's you fuzzy-select directories and files under cwd, maybe try that one
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this wored for me, know a trick, so that when i hit tab, that it list all available files or folders?