Submit Search
Upload
Vim勉強会
•
Download as PPTX, PDF
•
0 likes
•
1,215 views
Fujita Shinjiro
Follow
Vimの基本操作に関する紹介スライドです. 内輪の勉強会で使った資料のため, 内輪ネタが少しあります. ご了承下さい.
Read less
Read more
Engineering
Report
Share
Report
Share
1 of 31
Download now
Recommended
Bitbucket Pull Request 練習帳
Bitbucket Pull Request 練習帳
Hiramatsu Ryosuke
Vimはこわくない
Vimはこわくない
Yuichi Watanabe
地獄のVimmer
地獄のVimmer
Daisuke Masuyama
今日からはじめるVim入門
今日からはじめるVim入門
Yuta Ogura
カスタムメモリマネージャと高速なメモリアロケータについて
カスタムメモリマネージャと高速なメモリアロケータについて
alwei
これだけ知っときゃなんとかなるVim
これだけ知っときゃなんとかなるVim
arisu yano
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Recommended
Bitbucket Pull Request 練習帳
Bitbucket Pull Request 練習帳
Hiramatsu Ryosuke
Vimはこわくない
Vimはこわくない
Yuichi Watanabe
地獄のVimmer
地獄のVimmer
Daisuke Masuyama
今日からはじめるVim入門
今日からはじめるVim入門
Yuta Ogura
カスタムメモリマネージャと高速なメモリアロケータについて
カスタムメモリマネージャと高速なメモリアロケータについて
alwei
これだけ知っときゃなんとかなるVim
これだけ知っときゃなんとかなるVim
arisu yano
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
More Related Content
Featured
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
Featured
(20)
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
Skeleton Culture Code
Skeleton Culture Code
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
How to have difficult conversations
How to have difficult conversations
Introduction to Data Science
Introduction to Data Science
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
The six step guide to practical project management
The six step guide to practical project management
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
Vim勉強会
1.
Vim勉強会(第1回) Vim初心者のための基本講座
2.
自己紹介 • 藤田慎二郎
• 広島大学分散システム学研究室所属(2014年現在) • Vim歴2年(まだまだ未熟です) • 神崎師匠の弟子 2
3.
Vim勉強会(第1回)の主旨 • キーボードのホームポジションから離れること
なくテキスト編集する方法を習得 - マウス操作の排除 - 矢印キーの排除 • 基本的でかつ実用的な操作に絞って紹介 3
4.
1. Vimの基礎知識 本旨へ入る前に
4
5.
Vimの基本操作 • カーソル移動
- h(←) - j(↓) - k(↑) - l(→) • 1文字削除(x) • Undo(u) • Redo(Ctrl + r) 5
6.
Vimのモード 6 挿入モード
ノーマルモード v, V, Ctrl+v :, /, ?, ! ヴィジュアル モード コマンドモード a, i, s, c etc… Esc, Ctrl+[ Esc, Ctrl+[
7.
Vimのモード • ノーマルモード
- カーソル移動、文字の削除 • 挿入モード - 文章の書き込み • ヴィジュアルモード - 文字の選択(マウスのドラッグと同じ) • コマンドモード - 保存、検索、置換など 7
8.
Vimのモード • ノーマルモード
- カーソル移動、文字の削除 • 挿入モード - 文章の書き込み • ヴィジュアルモード - 文字の選択(マウスのドラッグと同じ) • コマンドモード - 保存、検索、置換など 8 今後掲載する操作は全て ノーマルモードが起点
9.
ヴィジュアルモード • v(文字単位で選択)
• V(行単位で選択) • Ctrl+v(矩形選択) 9 よく使うので要記憶
10.
2. カーソルの移動 長い文章でも一瞬で行きたい場所へ
10
11.
カーソルの移動(細かい移動) • 単語単位での移動
- w(単語単位で後ろに移動) - b(単語単位で前に移動) • 指定した文字まで移動 - f <character>(同じ行内で前方検索して移動) ;(セミコロン)と,(カンマ)で前後に移動 - F <character>(同じ行内で後方検索して移動) ;(セミコロン)と,(カンマ)で(略) 11
12.
カーソルの移動(大きい移動) • gg(ファイルの頭に移動)
• G(ファイルの末尾に移動) • <number>G(指定行へ移動) • Ctrl+f, Ctrl+b(1ページ単位で移動) • Ctrl+d, Ctrl+u(半ページ単位で移動) 12
13.
カーソルの移動(大きい移動) • *(カーソル下の単語間を移動)
- ”n”で前方検索、”N”で後方検索 • /<some words>(指定した文字を前方検索) - “n”もしくは”N”でさらに前後の文字を検索 - 正規表現を使用可能 13
14.
3. 文字の消去とコピー 消去は一瞬で、コピーはマウスなしで
14
15.
文字や文章の消去 • dd(1行まるごと削除)
• D(カーソル位置より後を削除) • viewで選択して”d”(選択範囲を削除) - 選択の際に「カーソルの移動」でやった操作を活用 • dt<character>(指定した文字までを削除) - “d”を”c”にすれば削除した後「挿入モード」へ移行 15
16.
Text Objectを使った消去(重要) •
テキストオブジェクトとは - あるルールに基いたテキストのまとまり - 「”」で囲まれた文章 - 「htmlタグ」で囲まれた文章など… 16 String str = “Hello World!”; <b>Hello World!</b>
17.
Text Objectを使った消去(重要) •
dw, cw(単語単位で削除) • di”, ci”(”で囲まれた文字を削除) - 「”」の他に「(」「<」「[」も指定可能 • da”, ca”(”で囲まれた文字を”を含めて削除) - 「”」の他に(略) 17
18.
Text Objectを使った消去(重要) •
dw, cw(単語単位で削除) • di”, ci”(”で囲まれた文字を削除) - 「”」の他に「(」「<」「[」も指定可能 • da”, ca”(”で囲まれた文字を”を含めて削除) - 「”」の他に(略) 18 超便利なので これだけでも憶えよう
19.
文字のコピー • Vimでのコピーは”Copy”ではなく”Yank”
• yy, Y(カーソルのある行をコピー) • Viewで選択してy(選択した範囲をコピー) • yi”, ya” etc…(Text Objectを使ったコピー) - 動作は「消去」のときと同じ - ywなども使用可 • 貼り付けはp(”Paste”) 19
20.
文字のコピー(切り取り) • Vimでは「切り取り=消去」
• つまり「文字の消去」が「切り取り」に相当 • 消去した後にp(Paste)すれば貼り付け可能 • そのため「切り取り」の操作は「文字の消去」 を参照 20
21.
4. ファイルを開く ファイル間の行き来も全てVimで
21
22.
新規ファイルを開く • 主にコマンドモードでの操作
• :n <file name>(指定したファイル名で開く) - すでにファイルがある場合はそれを開く - 頭に「:(コロン)」があるので注意 • :bp, :bn(開いたファイル間を行き来する) - :bpは前のファイル(previous) - :bnは後のファイル(next) 22
23.
新規ファイルを開く • :ls(開いたファイルの一覧を表示)
• :b<number>(指定した番号のファイルを開く) - 番号は:lsで確認 • Ctrl+ws(画面を水平分割) - 画面内に2つのファイルを表示して編集 • Ctrl+wv(画面を垂直分割) - 画面内に(略) 23
24.
5. その他小技集 必須ではないが知ってるとやばい小技集
24
25.
その他小技集 • Ctrl+n(文字入力中に使用すると自動で補完)
- 長い変数名でも一発で入力可能 • 矩形選択(Ctrl+v)して「I//<Esc>」 or :<number>, <number> norm I// - 指定した範囲の行頭に「//」を挿入 • gg=G(全行に対してコードを整形) - 自動でインデントを入れてくれる 25
26.
その他小技集 • .(「ドット」、前の編集操作を繰り返す)
• q<character>(Vimのマクロ機能を呼び出し) - <character>にマクロを記録開始 ↓ • @<character> - <character>に登録したマクロを呼び出し 26
27.
その他小技集 • :s/<置換したい文字列>/<置換する文字列>/g
- 同じ行の中で文字列を置換 • :%s/<置換したい文字列>/<置換する文字列>/g - ファイル全体で文字列を置換 • 最後の「g」を「c」にすると1つずつ確認しな がら置換可能 • <置換したい文字列>には正規表現を使用可 27
28.
6. どこでもVimを IDEでもブラウザでもVimを使おう
28
29.
どこでもVimを • Vimは様々な環境で使えるようプラグインが
多数存在 • Eclipse(Vrapper) - 矩形選択などVimの機能をフル活用するには 少し設定をいじる必要有り • Visual Studio(VsVim) - 矩形選択など(略) • Google Chrome(wasavi) 29
30.
最後に • 今回紹介した操作はとにかくVimを使うことに
よってのみ習得可能 • 習得するとテキスト編集が超効率的に 30
31.
最後に • 今回紹介した操作はとにかくVimを使うことに
よってのみ習得可能 • 習得するとテキスト編集が超効率的に 31 どんどんVimを使おう!
Download now