Last active
July 1, 2021 17:38
-
-
Save kevinkirkup/ee5e4550ddccb9b8493bb69f22d56220 to your computer and use it in GitHub Desktop.
Shell-Fu - Little know command line tools - DoItLive
This file contains 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
#!/usr/bin/env sh | |
# -------------------------------------------------- | |
# DoItLive Session for Shell-Fu - Little know command line tools | |
# -------------------------------------------------- | |
#doitlive shell: /bin/zsh | |
#doitlive prompt: default | |
cd $MERCURY | |
# tmux intro | |
tmux | |
# Show window splitting and resize | |
# View TMUX configuration | |
cd ${HOME} && vim /.tmux.conf; cd ${OLDPWD} | |
# tmux advanced | |
tmux | |
# Show Window Layouts | |
# Show Window Layout Configs | |
# -------------------------------------------------- | |
# bat | |
# -------------------------------------------------- | |
# Markdown | |
bat README.md | |
# Cat replacement | |
bat -A /etc/hosts | |
# Curl | |
curl -s https://sh.rustup.rs | bat | |
# Man viewer | |
man 2 select | |
MANPAGER="sh -c 'col -bx | bat -l man -p'" man 2 select | |
# Tailing | |
tail -f /var/log/system.log | bat --paging=never -l log | |
# -------------------------------------------------- | |
# grc | |
# -------------------------------------------------- | |
netstat -rn | |
grc netstat -rn | |
ping localhost | |
grc ping localhost | |
tail /var/log/system.log | |
grc tail /var/log/system.log | |
[[ -s "/etc/grc.zsh" ]] && source /etc/grc.zsh | |
netstat -rn | |
# -------------------------------------------------- | |
# git-delta | |
# -------------------------------------------------- | |
vim ${HOME}/.gitconfig | |
git show | |
# -------------------------------------------------- | |
# tig | |
# -------------------------------------------------- | |
tig | |
tig --all | |
tig --all -- lib/mercury/ports.ex | |
vim ~/.tigrc | |
# -------------------------------------------------- | |
# the-silver-searcher (ag) | |
# -------------------------------------------------- | |
# Filetype filtering | |
ag clean | |
ag --elixir clean | |
ag port | |
ag -g port | |
ag "port\w+" | |
ag "port\w+" lib/mercury/ports | |
ag get_top | |
ag -a get_top | |
# -------------------------------------------------- | |
# fzf | |
# -------------------------------------------------- | |
fzf | |
# Use FZF with other commands | |
vim $(fzf) | |
# Select and edit multiple files | |
vim -o $(fzf -m) | |
fzf -q ".exs$ port web" | |
fzf --preview 'cat {}' | |
fzf --history ~/.zsh_history | |
# -------------------------------------------------- | |
# Combining Tools | |
# -------------------------------------------------- | |
# Select file with colored preview | |
fzf --preview 'bat --color=always --style=numbers --line-range=:500 {}' | |
# Search file contents | |
ag --nobreak --nonumbers --noheading . | fzf | |
# Zsh Tab completion | |
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh | |
vim ** #TAB | |
# Tab completion for SSH | |
ssh ** #TAB | |
# Tab completion for processes | |
kill -9 #TAB | |
# CTRL-T | |
# CTRL-R |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment