presentations/terminal-velocity-ato-2019.md -rw-r--r-- 4.6 KiB View raw
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
% 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