~whereswaldon/presentations

presentations/terminal-velocity-ato-2019.md -rw-r--r-- 4.6 KiB View raw
36c7f48eChris Waldon Improve makefile and document with README 5 months ago

% Terminal Velocity % Work faster in your shell % Chris Waldon

Outline

  • Disclaimers
  • Feedback
  • Tools

Disclaimers


The views expressed in this presentation are entirely my own, and show not be construed to be the opinion of any of my employers (past, present, or future).


I'm going to show you a bunch of cool interactive tools. I am not advocating that you install all of them on your production systems or that you assume that they are available when writing portable shell scripts.


This list of tools is not exhaustive. In many cases, there are other tools that do nearly the same thing. Sometimes I'll just present the one that I learned first. Sometimes I'll present the one that I prefer. Sometimes I might not know about the cool alternatives.


I'm still learning. If you know other cool tools, share them with me!

Philosophy

What makes tools good?

  • speed?
  • ease?
  • simplicity?
  • documentation?
  • size?
  • bloat?
  • portability?
  • power?
  • flexibility?

Feedback

  • the core of agility

Tools

Getting around

z - jump around

  • {ba,z}sh: github.com/rupa/z
  • fish: github.com/jethrokuan/z
  • 100% shell script
  • frecency
  • use instead of cd

::: notes

Demo:

z Dow
z vul
z for
z src
kak ~/.local/share/z/data

:::

Finding stuff

fzf - fuzzy find

  • github.com/junegunn/fzf
  • golang
  • fuzzy, not regex
  • smart case
  • use like:
    • find
    • grep
    • decision

::: notes

ps -aef | fzf
systemctl | fzf
dmesg | fzf
Ctrl+R in fish
Ctrl+T in fish
Alt-C in fish

function gc
    set branch (git show-ref --heads | sed -E 's|refs/heads/||' | fzf --with-nth=2 --preview 'git show --color=always {1}' | string split " ")
    git checkout $branch[2]
end

:::

fd - find

  • github.com/sharkdp/fd
  • rust
  • use instead of find
  • heuristics:
    • skip hidden files by default
    • skip ignored files by default
    • smart case
  • even without heuristics, speedup 9x+

::: notes

fd uinput /
find / -name '*uinput*'

fd arbor
fd Arbor
find . -iname '*arbor*'
find . -name '*Arbor*'

:::

ripgrep - grep, but better

  • github.com/BurntSushi/ripgrep
  • rust
  • use instead of grep
  • heuristics:
    • recursive file search by default
    • skip hidden files by default
    • skip ignored files by default
    • smart case
  • even without heuristics, speedup 4x+

::: notes

rg 'var Version'
grep -r 'var Version' .

rg arbor
rg Arbor

cd ~/Code/builds/linux/
rg const
rg uinput

rg uinput --json

funced rged

:::

gron - make JSON greppable!

  • github.com/tomnomnom/gron
  • golang
  • use before jq and with rg or fzf
  • combines well with yaml2json and similar

::: notes

jq . pull.json
jq . pull.json | fzf --ansi
jq . pull.json | rg login
gron -c pull.json | fzf --ansi
gron pull.json | rg login
gron pull.json | bat -l js

:::

Looking at things

exa - ls for humans

  • github.com/ogham/exa
  • rust
  • alias to ls (use instead of)
  • same performance, richer info
  • check out --git and --tree

::: notes

exa -h
exa -l --git --tree

:::

bat - cat with wings

  • github.com/sharkdp/bat
  • rust
  • use instead of cat
  • syntax highlighting
  • pager auto-invocation
  • basically, look at stuff
  • combines really well with fzf

::: notes

needs no examples of its own, we've used it constantly throughout the other tools

:::

hexyl - read the matrix

  • github.com/sharkdp/hexyl
  • rust
  • view hex, but colors

::: notes

hexyl (which kak) | less -r

:::

Fixing UX

detox

  • detox.sourceforge.net
  • c
  • Fix file names

::: notes

detox -n *

:::

fish

  • github.com/fish-shell/fish-shell
  • c++
  • fish_update_completions
  • funced & funcsave
  • location-sensitive completion
  • colored feedback for:
    • whether command exists
    • whether path exists
    • VI-line-editing

::: notes

:::

Automation

entr - run commands when files change

  • eradman.com/entrproject/
  • run commands when files change
  • watch files listed on stdin

::: notes

bat makefile

:::

Multitasking

tmux - terminal multiplexing

  • github.com/tmux/tmux
  • c
  • 1:N terminals
  • supports tabs (called windows)
  • supports splits (called panes)
  • supports sessions
  • super scriptable

::: notes

:::

Editing

kakoune - feedback focused editor

  • github.com/mawww/kakoune
  • c++
  • vi-like, but constant feedback
  • commands are discoverable
  • see before you do

::: notes

:::

Questions?

Contact me:

  • keybase.io/whereswaldon
  • waldon.blog/contact
  • git.sr.ht/~whereswaldon
  • github.com/whereswaldon

Share your favorite tools with me!

This presentation available at:

git.sr.ht/~whereswaldon/presentations