Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
1文字エイリアスのすゝめ
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Takafumi ONAKA
PRO
August 24, 2024
Technology
160
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
1文字エイリアスのすゝめ
2024-08-24 Kyoto.なんか #6
https://kyoto-nanka.connpass.com/event/324686/
Takafumi ONAKA
PRO
August 24, 2024
More Decks by Takafumi ONAKA
See All by Takafumi ONAKA
その Valkey 使いこなしていますか?
onk
PRO
5
2.3k
Hono x Inertia.js x Cloudflare_Workers
onk
PRO
0
20
気づけばこうなる運用 ~運用現場の現実と理想~
onk
PRO
0
100
プラットフォームを作る、プラットフォームを変える
onk
PRO
0
90
強いチームと開発生産性
onk
PRO
44
18k
ADRを運用して3年経った僕らの現在地
onk
PRO
22
26k
すこやかなサービス運営のための PWG (Performance Working Group)
onk
PRO
1
1.6k
オブザーバビリティの Primary Signals
onk
PRO
2
6.7k
Cache Stampede
onk
PRO
1
2.5k
Other Decks in Technology
See All in Technology
kintoneで在庫管理システムを作るときの要件定義・設計ポイント
kai0707
0
230
現場を動かすAIエージェント#2_製造業現場でのAI活用から見た、ハマる罠と実践知
kintotechdev
2
140
新卒エンジニア、 介護士になる
ryu1013
1
680
Content Mapper APIの応用例~CSS Modules、言語ファイル~
uhyo
2
570
AI時代に求められる優秀なTechLeadの振る舞い
pospome
4
4.9k
AIエージェント統制はAPIから——押さえるべき5つの要素
nagix
0
120
増え続けるプロダクトの品質をどう担保するか。ProductSpecとTypeScriptによる取り組み
joere
3
380
[General] 개발자로 해외 기업에서 일하기
skydoves
1
290
【Oracle AI SPOTLIGHT ウェビナー】事例から見る!なぜOCIが選ばれたのか ― AI時代のクラウド戦略を紐解く ―
oracle4engineer
PRO
2
150
続・ソフトウェアアーキテクトのための意思決定術: Decision Readiness, Revisited — When AI Changes the Economics of Software Architecture
snoozer05
PRO
5
1.3k
reInvent2026stby LT00 "Change your life!"
shinichirokawano
1
570
Flutter Webを「SDK」として配る — 50以上のゲームを支える埋め込みアーキテクチャ
masayukisuda
0
180
Featured
See All Featured
My Coaching Mixtape
mlcsv
0
380
Context Engineering - Making Every Token Count
addyosmani
9
1.3k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
500
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
660
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.9k
The Curious Case for Waylosing
cassininazir
1
610
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
510
Mobile First: as difficult as doing things right
swwweet
225
10k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
23k
The Spectacular Lies of Maps
axbom
PRO
1
1.1k
Transcript
1文字エイリアスのすゝめ id:onk 2024-08-24 Kyoto.なんか 1
• 大仲 能史 a.k.a. id:onk • 芸歴20年目 • 株式会社はてな ◦
チーフエンジニア ◦ Mackerel 開発チーム 自己紹介 2
3 今日の話
4 1文字エイリアス 使っている人 ノシ
1文字エイリアス • alias s="git status -sb" • 13文字 -> 1文字
◦ 13倍の生産性!!! 5
1文字エイリアス • Q: 実際はEnterも押すから7倍では? ◦ Enterを押すだけで動くようにしてある(デモ • Enter で ls
と git status を表示すると便利 6
historyを集計する • zshにはhistory機能がある • head ~/.zsh_history 7
head ~/.zsh_history 8 : 1522742171:0;brew update : 1522742190:0;brew upgrade :
1522742201:0;brew search ghq : 1522742205:0;brew install ghq : 1522742215:0;ls -apl : 1522742221:0;byobu : 1522742271:0;byobu : 1522742277:0;exit : 1522742279:0;cd dotfiles : 1522742283:0;exit
head ~/.zsh_history 9 : 1522742171:0;brew update : 1522742190:0;brew upgrade :
1522742201:0;brew search ghq : 1522742205:0;brew install ghq : 1522742215:0;ls -apl : 1522742221:0;byobu : 1522742271:0;byobu : 1522742277:0;exit : 1522742279:0;cd dotfiles : 1522742283:0;exit Time.at 1522742171 => 2018-04-03 16:56:11 +0900
history 10 $ history | tail -n 3 624392 cd
memo 624393 s 624394 v
historyを集計する 11 $ history 1 | awk '{ print $2
}' | sort | uniq -c | sort -nr | head
historyを集計する 12 141945 g 136083 s 67635 v 41072 cd
28606 rg 26105 tig 16898 t 12128 plenv 9685 :q 7998 ll
ちなみに以下の略 • g=git • s=git status -sb • function v()
{vi -p ${${=*/:/ +}/:*}} • t=tig • :q=exit • ll=ls -lFG 13
ちなみに以下の略 14 • function v() {vi -p ${${=*/:/ +}/:*}} ◦
vi -p で全部タブで開く ▪ bufferよりタブ派 ◦ s/:/ +/ みたいなヤツ ▪ v README.md:100 で100行目を開きたい ▪ vim README.md +100 ▪ grep -n で出てくる形式に合わせて、コピペで該当行に飛べ るように
ちなみに以下の略 15 • :q=exit ◦ vim派なので使っていたが ◦ 最近は Ctrl+D で閉じるようになったので使ってない
• ll=ls -lFG ◦ -l はいつもの ◦ -F はディレクトリだとスラッシュが付くとか ◦
-G は色付け ◦ 今は l 1文字にエイリアスしている ちなみに以下の略 16
17 g=git
18 gitって サブコマンドあるよね
historyを集計する 19 $ history 1 | awk '{ print $2,$3
}' | grep "^g " | sort | uniq -c | sort -nr | head
historyを集計する 20 24054 g a 16190 g ci 12911 g
ds 12303 g co 9046 g f 6665 g ap 5904 g switch 5844 g fix 5311 g b 5180 g r
• g a=git add • 2万回も叩いているなら1文字エイリアスに昇 格すると良いのでは??? ◦ alias a="git
add" まだまだ最適化できる 21
• g ds=git diff --staged -b • 1万回も叩いているなら1文字エイリアスに昇 格すると良いのでは?? ◦
alias d="git diff --staged -b" ◦ もともとalias d=dockerだったけど、より回数が多い 方を優先したいので徴収 まだまだ最適化できる 22
• git switch -d remotes/origin/HEAD ◦ remotes/origin ▪ ローカルでmainブランチは不要なのでremotesを直接見る ◦
main/masterが面倒ですよね ▪ git symbolic-ref refs/remotes/origin/HEAD ▪ デフォルトブランチが取れる! • をmに割り当てている gitのオススメ 23
というわけでやっていくぞ • 俺たちの手癖はまだまだ最適化できる • 使用頻度に合わせて最適化するのがオススメ ◦ 単純に生産性が上がる ◦ 文字数が少ないのは正義 •
ハフマン符号化 24
想定質問 • 他人のPCで困らない? ◦ 手癖がオプションを覚えてないので多少は困る ◦ aliasを作るときにしっかりオプション調べるので、 存在は覚えている=1回help見たら分かるので大丈夫 25
想定質問 • fishのabbrの方が ◦ 履歴を取って、最適化ループを回したい ◦ abbrはhistoryに「どう入力したか」は残らない 26