Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For me, the transition from Bash to Zsh has been a huge efficiency boost. Mainly because of some great plugins for Zsh, such as z, zsh-peco-history (better history search), zsh-autosuggestions, and zsh-syntax-highlighting.

My blog post about setting up a Linux workstation describes this in detail: https://tkainrad.dev/posts/setting-up-linux-workstation/#swi....

The best thing is, there is no initial productivity hit. You don't miss out on any shell features that you are accustomed to.

Also, learning complex IDE features really pays off. At the very least, become familiar with the debugger.

Finally, I spent the last months making https://keycombiner.com/ in my spare time. It is an app for learning keyboard shortcuts and getting faster/more accurate at using them. It already made me more productive because I learned a lot of new shortcuts and found some problems in my typing accuracy.



For zsh, I highly recommend zsh-histdb, it stores all your commands in a sqlite database, along with data like timestamp, current working directory, hostname, session id, etc...

It has its own "histdb" command but the best part is that it integrates well with zsh-autosuggestions, so with the right SQL query you can make it suggest something "the latest command in the current session that matches, or if not found, the most frequent in that directory".

I know it is controversial because it is not using a text file and UNIX loves text files, but it really nice, and you still have your .zsh-history if you want to.


histdb is one of my top favorite tools. And I've come to the conclusion flat files can only get you so far. sqlite is probably the next best thing to flat files, and I think history is one of those things where switching to a db is an immediate win.


I would highly recommend checking out fzf for better history search. Found the recommendation on another similar thread here and from coworkers. It's surprisingly fast and very intuitive.

https://github.com/junegunn/fzf


+1 to this. I've never been a fan of how <ctrl r> works in bash, and fzf makes it soooo much better.


Both this and histdb look quite interesting. That being said, I never had the feeling that I am missing anything with zsh-peco-history.


Wanted to thank you for writing your blog post. I have been on Linux full-time since about july 2019 and found your post some time after that. Your post really kickstarted my productivity in Linux.


Glad it helped you! Thank you for the nice words :)


Today I switched from zsh to fish and I'm already much happier. Was using zsh for 4+ years, too


What benefits do you see in fish when compared to zsh?


I would say fish is to zsh like what zsh is to bash.

More seriously, for a start: good defaults, highlighting and autosuggestion built-in, parameters search with help and completion... (but it's not Posix).


Regarding POSIX, I've been using Fish for about 4 years now.

POSIX always comes up, how it's a deal breaker.I want to mention that I build all my scripts as POSIX as I can or using Bash extensions. You keep having Bash/ZSH on your machine, so you can still use your scripts and don't miss anything. Shebang's keeps working,

    #!/bin/sh
    #!/bin/bash
    #!/bin/zsh
Personally, I actually don't change my default shell (chsh step). I simply set my terminal to use the fish command instead of invoking the default shell.

    - Gnome Terminal, there's a Title and Command tab. You can set a custom command there. Just put the path to fish
    - Terminal.app, Preferences > Profiles > Shell > Run command
    - iTerm.app, Preferences > Profiles > General > Command
    - Tmux, on your .tmux.conf `set -g default-shell /usr/local/bin/fish`
It's more portable for me that way.


I was also interested about it and from my research, Fish has two major differences:

- it enables the cool functionality out of the box, so unlike zsh you don't need to have large configuration file to enable everything

- it is not afraid to break bash compatibility to fix confusing scripting issues, so fish most likely will fail when executing a bash script, but writing scripts in fish should be more enjoyable


I also want to thank you for this blog post. I'm a long time linux user, but just got a new machine and decided to start from scratch rather than try to port over my previous environment. Looks like just starting from your post will save me some time.


Thank you!

I am currently setting up a new desktop myself and will soon update the post regarding Ubuntu 20.04. However, this will only be very minor changes, almost everything still works exactly as described :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: