36

Hi. So I've been a fish user for a while, but I've always gotten frustrated with it not being POSIX compliant. I tried to use zsh with oh-my-zsh to still benefit from fish's capabilities on zsh, but I had 2 problems with it: it was incredibly slow, and it wasn't as good. As I recently found out, the plugins can just be sourced in zsh directly, skipping oh-my-zsh, and fixing my speed issues. But the second issue remained: zsh-autosuggestions is just not as good as fish's autocompletion feature, which suggests commands in a user's PATH, as well as autocompletes directories, without me having ever accessed them, meaning they weren't even in the history at that point, which allowed me to hit the ground running. I want that with zsh as well. Is there a plugin or something like that, which allows for these extra features, and can autosuggest commands from PATH and autocomplete directories? I really want to switch to a POSIX shell, but the lack of this feature would make it feel like quite a downgrade. Thanks.

top 18 comments
sorted by: hot top controversial new old
[-] INeedMana@lemmy.world 10 points 1 year ago

autosuggest commands from PATH and autocomplete directories

I think you might have autocompletion disabled. I have these features in my zsh

[-] theshatterstone54@feddit.uk 5 points 1 year ago

It works now, thank you for the help.

[-] Scraft161@iusearchlinux.fyi 7 points 1 year ago

you should be able to reconfigure the plugin, I have it set to pull from history first and after that look for standard command completion using the following:

ZSH_AUTOSUGGEST_STRATEGY=(history completion)

important is that you put this BEFORE sourcing the plugin.

the github should carry more information on how to configure this plugin.

PS: I use all of 4 plugins (fzf-tab-bin, zsh-autosuggestions, zsh-syntax-highlighting, zsh-history-substring-search) and I have a better shell in zsh than I will ever have in fish, I don't need anything more fancy and oh-my-zsh is hell to work with compared to a simple .zshrc I handrolled because it's got any other shell I know beat (yes I know of nushell and it is cool, but it's even less posix than fish). also, once you're done run zcompile .zshrc, you won't regret it.

[-] theshatterstone54@feddit.uk 2 points 1 year ago

It worked! Thank you so much. That's all I need. I have seen people use zsh-history-substring-search and fzf-tab but I don't currently need them, so I won't use them. Once again, thank you so much.

[-] Scraft161@iusearchlinux.fyi 2 points 1 year ago

No problem, I was looking for this after I tried using fish seriously for a month and it was the only thing I needed

[-] nlm@beehaw.org 1 points 1 year ago

Commenting so I can remember to try this out! Cheers mate!

[-] Scraft161@iusearchlinux.fyi 2 points 1 year ago

You can save posts on Lemmy, for me it's a bookmark icon (I use liftoff) they will show up in your bookmarks.

I love this feature as a nice "come back to this later" button

[-] nlm@beehaw.org 1 points 1 year ago

Yup, did that too! :)

[-] PotatoesFall@discuss.tchncs.de 5 points 1 year ago

Sorry, not an answer to your question, but what is it about non POSIX that frustrates you?

[-] theshatterstone54@feddit.uk 5 points 1 year ago

I type in a command without sudo, I prefer to type in a sudo !! rather than to up arrow, then do Ctrl+A then type sudo and press Enter, for example. I wanted to install Nix earlier, but I needed to be in a POSIX shell for it to work, so I had to switch to bash for the installation. Those are just 2 examples from earlier today, and while you can learn to deal with them, it would juat be more effective to use a POSIX shell instead. It also means I can just set it as my login shell instead of having each of my terminal keybinds as kitty -e fish, across all of my many window manager configs. Fish is faster, but I'm not sure if the cost is worthwhile.

[-] LiveLM@lemmy.zip 3 points 1 year ago* (last edited 1 year ago)

I prefer to type in a sudo !! rather than to up arrow, then do Ctrl+A then type sudo and press Enter

Fish has a hotkey for this built-in, just hit Alt + S.
The login shell troubles are very valid however. I worked around them by modifying my .bashrc to drop me into fish, and it has been working pretty well for me so far.
The linked solution also handles only launching fish if the parent process is not fish, so you can still access bash easily for when you really need it.

[-] theshatterstone54@feddit.uk 1 points 1 year ago

Thank you for your suggestions, but zsh has been treating me very well, so I think I'll stick with it for now.

[-] fushuan@lemm.ee 5 points 1 year ago

Every time I install a new machine I install zsh and then run the install script in here: https://github.com/romkatv/zsh4humans

It's a simple script created by the powerlevel10k zsh terminal theme author, and it's simple and awesome.

[-] theshatterstone54@feddit.uk 1 points 1 year ago

Okay, I LOVE this. If I ever decide to do a new zsh config, I will definitely use that. There's some pretty cool stuff in here, but I've already got everything configured pretty much the way I want it. Thanks anyways.

[-] epocsquadron@kbin.social 1 points 1 year ago

Another alternative I like is zim. I feel it’s snappier and less fiddly than oh-my-zsh.

[-] theshatterstone54@feddit.uk 1 points 1 year ago

I've just skipped "frameworks" and straight up source the .zsh files directly into my .zshrc. Less bloat, more speed.

[-] iusearchbtw 4 points 1 year ago* (last edited 1 year ago)

Literally not even slightly what you're asking for, but have you considered using bash with ble.sh? I'm also a former fish user, and ble.sh replicates all of fish's quality of life improvements (that I used, at least) and then some, all with a single source command in my .bashrc.

[-] theshatterstone54@feddit.uk 1 points 1 year ago

Just tried it, it's alright, but it seems that zsh meets my needs better currently, so I'll stick to zsh.

this post was submitted on 21 Jul 2023
36 points (97.4% liked)

Linux

48454 readers
755 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS