Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Emacsとその周辺 / Emacs and CLI tools
Search
FUJIWARA Shunichiro
June 16, 2017
Technology
3
9.3k
Emacsとその周辺 / Emacs and CLI tools
社内勉強会の資料です
FUJIWARA Shunichiro
June 16, 2017
Tweet
Share
More Decks by FUJIWARA Shunichiro
See All by FUJIWARA Shunichiro
監視のこれまでとこれから/sakura monitoring seminar 2025
fujiwara3
11
3.8k
k6による負荷試験 入門から日常的な実践まで/Re:TechTalk #01
fujiwara3
2
81
困難を「一般解」で解く
fujiwara3
10
3.6k
「隙間家具OSS」に至る道/Fujiwara Tech Conference 2025
fujiwara3
7
12k
alecthomas/kong はいいぞ / kamakura.go#7
fujiwara3
1
1k
ISUCONに強くなるかもしれない日々の過ごしかた/Findy ISUCON 2024-11-14
fujiwara3
11
1.3k
「最高のチューニング」をしないために / hack@delta 24.10
fujiwara3
21
4.4k
AWS Lambdaで実現するスケーラブルで低コストなWebサービス構築/YAPC::Hakodate2024
fujiwara3
10
6.4k
CEL(Common Expression Language)で書いた条件にマッチしたIAM Policyを見つける / iam-policy-finder
fujiwara3
2
1.9k
Other Decks in Technology
See All in Technology
Node-RED × MCP 勉強会 vol.1
1ftseabass
PRO
0
140
AWS CDK 実践的アプローチ N選 / aws-cdk-practical-approaches
gotok365
6
690
急成長を支える基盤作り〜地道な改善からコツコツと〜 #cre_meetup
stefafafan
0
120
~宇宙最速~2025年AWS Summit レポート
satodesu
1
1.8k
Claude Code Actionを使ったコード品質改善の取り組み
potix2
PRO
6
2.1k
A2Aのクライアントを自作する
rynsuke
1
170
IIWレポートからみるID業界で話題のMCP
fujie
0
770
TechLION vol.41~MySQLユーザ会のほうから来ました / techlion41_mysql
sakaik
0
180
AIの最新技術&テーマをつまんで紹介&フリートークするシリーズ #1 量子機械学習の入門
tkhresk
0
130
BrainPadプログラミングコンテスト記念LT会2025_社内イベント&問題解説
brainpadpr
1
160
製造業からパッケージ製品まで、あらゆる領域をカバー!生成AIを利用したテストシナリオ生成 / 20250627 Suguru Ishii
shift_evolve
PRO
1
130
Fabric + Databricks 2025.6 の最新情報ピックアップ
ryomaru0825
1
130
Featured
See All Featured
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
107
19k
Documentation Writing (for coders)
carmenintech
71
4.9k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
48
2.8k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
281
13k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
16
940
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.5k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.2k
A Tale of Four Properties
chriscoyier
160
23k
Building an army of robots
kneath
306
45k
How to Ace a Technical Interview
jacobian
277
23k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.3k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
46
9.6k
Transcript
Emacsͱͦͷपล 2017.06.09 @fujiwara
ͳͥ Emacs Λ͍ͬͯΔͷ͔ 1. େֶͰ࠷ॳʹΘ͞Εͨͷ͕ Mule ͩͬͨ(1994) Emacs → Nemacs(ຊޠԽ)
→ Mule(ଟݴޠԽ) → ຊମʹՌऔΓࠐΈ(Emacs 20,21) 2. ͦͷޙ JED Λ Emacs ΩʔόΠϯυͰͬͯͨ(2000) www.jedsoft.org/jed/ 3. Emacs ʹ͖ͬͯͨ (200?)
Vim ͍·͢ .vimrc 1ߦ syntax on • Ͳ͜ͷαʔόͰ࡞ۀ͢ΔͨΊ • ઃఆϑΝΠϧͳΜͱͳ͘
vim Ͱ͍͡Δ͜ͱ͕ଟ͍
screen .screenrc ̍ߦ escape ^z^z • Ͳ͜ͷαʔόͰ࡞ۀ͢ΔͨΊ • Ctrl-A ͩͱਏ͍
$ echo "escape ^z^z" > ~/.screenrc ιϥͰଧͯΔ
emacsclient ىಈ͍ͯ͠Δ Emacs ʹରͯ͠ϑΝΠϧΛ։͔ͤΔίϚϯυ ;; .emacs (server-start) # .zshrc alias
ec='emacsclient -n' $ ec ϑΝΠϧ໊ Ͱىಈ͍ͯ͠Δ Emacs ͰϑΝΠϧΛ։͚Δ
emacsclient -n Φϓγϣϯ: block͠ͳ͍ EmacsʹϑΝΠϧΛ։͔ͤͨΒͬͯ͘Δ (σϑΥϧτϑΝΠϧΛด͡Δ·Ͱͭ) ීஈ͜ΕΛ͏
EDITOR=emacsclient # .zshrc export EDITOR=$HOME/local/bin/emacsclient git commit ͨ͠ͱ͖ʹ Emacs ͰίϛοτϩάΛฤूͰ͖Δ
(͜ͷ߹ -n Λ͚͍͚ͯͳ͍)
peco github.com/peco/peco Ctrl-R ͰώετϦΛ peco ͰḷΔ # .zshrc function peco_select_history()
{ BUFFER=$(fc -l -n 1 | gtac | peco --query "$LBUFFER") CURSOR=$#BUFFER # move cursor zle -R -c # refresh } zle -N peco_select_history bindkey '^R' peco_select_history
ghq + peco github.com/motemen/ghq GoͷϦϙδτϦϨΠΞτͰશͯͷ git repo Λஔ͢Δౕ peco Ͱબͯ͠
cd ͢Δ function peco-src () { local selected_dir=$(ghq list | peco --query "$LBUFFER") if [ -n "$selected_dir" ]; then BUFFER="cd $HOME/src/${selected_dir}" zle accept-line fi zle clear-screen } zle -N peco-src bindkey '^]' peco-src
direnv github.com/direnv/direnv # .envrc export AWS_PROFILE=someproject-assumerole export AWS_REGION=ap-northeast-1 $ cd
/Users/fujiwara/src/github.com/fujiwara/someproject direnv: loading .envrc direnv: export +AWS_PROFILE +AWS_REGION ϓϩδΣΫτʹԠͨ͡ڥมΛઃఆ
gh-open github.com/typester/gh-open $ gh-open ~/path/to/repo GitHubͷϖʔδΛϒϥβͰ։͍ͯ͘ΕΔ
ag + peco + ec github.com/ggreer/the_silver_searcher/ ཁ͢Δʹ͍͢͝ grep # .zshrc
agec () { emacsclient -n $(ag $@ | peco --query "$LBUFFER" | awk -F: '{print "+" $2, $1}') } ag Ͱ grep ͨ݁͠ՌΛ peco Ͱબ "ϑΝΠϧ໊:ߦ൪߸:ߦͷ༰" → awk Ͱ "+ߦ൪߸ ϑΝΠϧ໊" emacsclient -n +10 foo.txt (foo.txt Λ Emacs Ͱ։͍ͯ10ߦʹҠಈ)