Jump to content

What shell do you use?


cwade12c
 Share

Recommended Posts

I used bash for a while, but moved to zsh a few years ago. I've enjoyed how extensible it is, in addition to native Git autocomplete tools, some extra included utilities like zmv, directory aliases, path expansion, and a few other things I'm probably forgetting.

I have the oh-my-zsh framework setup with it [link] and have configured it to use the Agnoster theme [link] with a bundle of plugins. I have a really nifty command history plugin enabled, in addition to several others that I will share when I return to my home box. There's also some useful hooks for executing scripts before and after commands. I'll post my config later.

So, what shell do you use?

Link to comment
Share on other sites

I usually use whatever is available. But boy did you just open up my world with native Git autocomplete tools.  I wouldn't have even thought to ask for it.

Link to comment
Share on other sites

.zshrc

export ZSH=/home/wade/.oh-my-zsh

# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="agnoster"

# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git zsh-syntax-highlighting zsh-autosuggestions zsh-history-substring-search alias-tips)

source $ZSH/oh-my-zsh.sh
source ${ZSH_CUSTOM1:-$ZSH/custom}/plugins/listbox/listbox.sh

#wallpaper aliases

alias bgre="sh ~/code/sh/bg-restore.sh"
alias bgrand="sh ~/code/sh/bg-random.sh"

#extracting alias will do the following:
	# mkdir foo
	# cd foo
	# tar zxvf /path/to/bar.tar.gz | zip /path/to/bar.zip | 7x x foo.7z | *
	# mv bar-1.2.3
	# cd ..
	# rmdir foo
alias x="atool -x"

#alias to open any file or link in the preferred application
alias open="xdg-open"

#alias to copy STDIN to clipboard and paste clipboard as STDOUT
alias copy="xclip -selection clipboard"
alias paste="xclip -selection clipboard -o"

#alias to format STDIN that is JSON
alias json="python -m json.tool"

#alias to print recursive tree of all subdirectories and files
alias lst="ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/'"

#standard global aliases
alias -g L="|less"
alias -g H="|head"
alias -g T="|tail"
alias -g G="|grep"
alias -g C="wc -l"
alias -g N="/dev/null"
alias -g S="|sort"

#path global aliases
alias -g playground="/var/www/html/playground"

#alias for listing detailed size of entire directories
alias size="du -h --max-depth=1"

#alias to check all code for FIXME and TODO and XXX
alias todo="grep \"FIXME\" * ; grep \"TODO\" * ; grep \"XXX\" *"

#alias to edit zsh config
alias zc="nano ~/.zshrc"

#alias to execute gif conversion... syntax is 2gif <input> <hh:mm:ss> <seconds> 720 <output>
alias 2gif="~/code/sh/2gif.sh"

#alias to mute/unmute Spotify
alias ms="/home/wade/code/sh/mute-spotify.sh"



#commands to run

echo "Principles are expensive, making it all the more beautiful when a person stays true to them."
trap 'sh ~/code/sh/bg-restore.sh' 0
sh ~/code/sh/bg-random.sh


#custom hooks
precmd() { eval "$PROMPT_COMMAND" }

#execute this before every single command
PROMPT_COMMAND='sh ~/code/sh/bg-random.sh'



#custom functions

#credz to ubertaco
    function up {
        if [[ "$#" < 1 ]] ; then
            cd ..
        else
            CDSTR=""
            for i in {1..$1} ; do
                CDSTR="../$CDSTR"
            done
            cd $CDSTR
        fi
    }


#run previous command as sudo
    function plz(){
        sudo $(fc -ln -1)
    }

 

If anyone is interested in the hacky shell scripts I wrote, just let me know.

 

zsh plugins:

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...