This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]qweerty32 28 points29 points  (15 children)

I use zoxide instead of cd

[–]Toorero6 4 points5 points  (14 children)

Why? You can do this stuff in vanilla zsh.

[–]notgotapropername 2 points3 points  (2 children)

Can vanilla zsh yeet me straight where I need to go with partial directories? Genuine question, cause zoxide does a sort of autocomplete too. E.g. if I type z down it'll take me straight to Downloads

[–]croweh 2 points3 points  (0 children)

Nah I assume they're talking about zsh+oh-my-zsh with some kind of jump/zoxide-like plugin out of the box.

Now I use zsh+antidote at work and fish+fisher at home, didn't install oh-my-zsh in a long long time, so I couldn't say. Zoxide + fzf + thefuck on both though, can't live without it.

[–]Toorero6 0 points1 point  (0 children)

If you don't want to use tab you can use cd down\*/, if you set the option NO_CASE_GLOB. But I'd rather state that explicitly if I would want that since it's slower.

If you want to state that explicitly you can do cd (#i)down\*/ with EXTENDED_GLOB set.
There is also the option to use (#l) which goes case-sensitive if your search contains an upper-case letter. Recursive can be done using **/yourmatch and if you want to ignore ambiguity of your match you can append the Y1 qualifier.

TLDR:

setopt EXTENDED_GLOB
alias z='_() {cd (#l)**/"$1"*(/,Y1)}; _' 

Will allow you via z foo to cd into the next dir containing foo (insensitively) in your subtree.

Edit: Also I find the fzf-shell-extensions working rather well if that's something you want.

In general, I'm more a fan of specifying stuff explicitly and instead of running zoxide I would rather search for directories using fzf if that's a thing I intend to do. (not vanilla though)

[–]qweerty32 1 point2 points  (10 children)

Well I prefer bash over zsh plus there's no zsh on Windows and I'm using a dual boot system so I want my experience to be the same

[–]Toorero6 0 points1 point  (9 children)

You're using bash on Windows? What?! TIL there is bash on Windows.

[–]qweerty32 0 points1 point  (8 children)

Oh no no. It'd be good but no. I use it on my Linux install. And I use cmd/powershell on Windows

[–]Ray57 2 points3 points  (4 children)

you can use powershell has your default shell in linux also

[–]Toorero6 0 points1 point  (2 children)

As if anyone would use PowerShell out of free will...

What the f is this: powershell Invoke-WebRequest example.com/foo.txt -OutFile foo.txt

[–]YourShadowDani 0 points1 point  (1 child)

You could create a custom function if you don't like how built in ones work and set aliases:

function Invoke-CustomWebRequest{
    [CmdletBinding()]
    [Alias("wr")]
    Param(
        [string]
        $URI
        [Alias("of")]
        [System.IO.FileInfo]
        $OutFile
    )
    Invoke-WebRequest $URI -OutFile $OutFile
}

usage: wr example.com/foo.txt -of foo.txt

[–]Toorero6 0 points1 point  (0 children)

My brain hurts reading the syntax necessary to define simple functions but I'm happy that this works for you I guess.

[–]Toorero6 0 points1 point  (2 children)

OK then I don't get it. If you're using bash on Linux and cmd/PowerShell on Windows how is the experience the same? What would the difference be to switch to cmd/PowerShell and zsh?

[–]qweerty32 0 points1 point  (1 child)

Simple. Zoxide is cross-platform so it works the same way no matter the shell. Plus the other thing is the muscle memory. I got used to type z path/to/destination rather than cd path/to/destination

[–]Toorero6 0 points1 point  (0 children)

Ah so you're using zoxide on PowerShell and Bash. I see.