SlideShare a Scribd company logo
1 of 58
Vim
How to Develop Like a Ninja
Alex Lewin
Sources: Vysakh Sreenivasan
https://www.slideshare.net/vysakh0/introduction-to-vim-the-text-editor
https://thoughtbot.com/blog/learning-vim-in-a-week
What is Vim?
• Text Editor (kind of like sublime/notepad)
• You don’t use your mouse
• Provides a language for editing
Talk Goals:
1. Learn How to Learn Vim
2. Show that it’s worth the effort
Infamous Learning Curve
Infamous Learning Curve
Vim Confidence vs. Time
Infamous Learning Curve
Vim Confidence vs. Time
Demo Video – No Vim vs. Vim
https://youtu.be/DAUxjfiD4hY
Demo Video – No Vim vs. Vim
https://youtu.be/DAUxjfiD4hY
The Ninja
Setup
1. Remap Caps Lock to ESC
2. Lower Key-Repeat Delay
(Google how to… Easy on Mac)
Keyboard
Elementary
Vim-speak
Modes
• Insert Mode – Lets you type (hit i)
• Visual Mode – Highlighting (hit v)
• Normal Mode – Everything Else (default, hit ESC to get back)
If you want it, put in “your vimrc"
Settings
Steal Mine: https://github.com/alexlwn123/.vimrc
~/.vimrc
How to code like a Ninja
Fly around like Superman
(without a mouse)
Step 1
Don’t try to memorize the commands. Just know they exist.
Superman (aka. Your cursor)
- Beginning or End of the street
- Next or Previous street
- ANYWHERE
Just by saying a magic word
He can teleport to the…
(magic words  motions)
How superman moves
(without a mouse)
What superman sees around
j
k
h l
b e
These are few positions in the file
$
0
Cursor movements:
The quick brown fox jumps.
j
k
h l
reddit.com/r/vimkeyboard
File movements:
gg first line
G last line
Line movements:
0 beginning of the line
$ end of the line
w word forward
b word backward
( sentence forward
) sentence backward
{ paragraph forward
} paragraph backward
w 2w
2b b
TODO 1: Master movement
- Just learn how to reach a particular position in a file.
- $ vimtutor
- pacvim
(brew install pacvim)
- Vim-Adventures.com
Learn to Fight!
(Edit text using vim motions)
Step 2
action + motion
Superman applies action along motion
Actions
- Delete d
- Yank (copy) y
- Change c
- Word w
- End of Line $
- Start of Line 0
- ‘till letter x tx
Motions (Objects)
Delete Word
d w
Delete Word
d w
2
2x
w 2w
2b b
dw (delete a word)
‘till comma
t ,
c
Change
Yank to the beginning
of the line
y 0
w 2w
2b b
y0 (yank till beginning of line)
0
TODO #2:
Learn to apply actions
while moving around
yy yanks (copies) the current line
dd deletes the current line
cc changes the current line
gUgU upcase the current line
Shortcut - doing the action twice
inside(i) the object or around(a) the object
:h text-objects
(This is where it get cool)
word
sentence
paragraph
" ", ‘ ‘
[], (), {}, <>
tags <p></p>
Vim treats these as objects
Actions
- Paragraph p
- Sentence s
- Tag <p1></p1> t
- ‘ ‘ , “ ”
- (, [, {, <
- Delete d
- Yank y
- Change c
Text Objects
Where
- Inside i
- Around a
- From the cursor position, you can say this
entire thing inside quotes using i”
- From the cursor position, you can say this
entire thing of quotes using a”
“This quote is an object”
di”
(delete inside quotes)
Misc Essentials
- Save :w
- Quit :q :wq
- Search /
- Undo / Redo u <Ctrl>r
Cheat Sheet: devhints.io/vim
Becoming a Ninja
Powerhouse Features
Tabs
:tabedit :tabe
Windows
:split or :vs
Delete(globally) all the lines that has the
word "cool".
:g/cool/d
Substitute “cool” with hot in all the lines and
places
:%s/cool/hot/g
Substitute “cool” with hot in all the lines that
have “weather”
:g/weather/s/cool/hot/g
Print any line that matches the regular
expression.
grep
Print any line that matches the regular
expression.
:g/re/p
Some Final
Thoughts…
Learning
Vim is an
investment
Don’t Start at
Work
Yes. Vim can do
that.
Think about the
End Goal
- http://stackoverflow.com/questions/1218390/what-is-your-most-
productive-shortcut-with-vim/1220118#1220118
- http://yanpritzker.com/2011/12/16/learn-to-speak-vim-verbs-nouns- and-
modifiers/
- http://vimcasts.org/
Few links to look at

More Related Content

Similar to Vim - How to Develop Like a Ninja

Mistakes I Made Building Netflix for the iPhone
Mistakes I Made Building Netflix for the iPhoneMistakes I Made Building Netflix for the iPhone
Mistakes I Made Building Netflix for the iPhonekentbrew
 
CSS3: stay tuned for style
CSS3: stay tuned for styleCSS3: stay tuned for style
CSS3: stay tuned for styleChris Mills
 
Node.js streams talk
Node.js streams talkNode.js streams talk
Node.js streams talkzladuric
 
CSS3 Animations & Transitions with PhoneGap
CSS3 Animations & Transitions with PhoneGapCSS3 Animations & Transitions with PhoneGap
CSS3 Animations & Transitions with PhoneGapMark A R Smith
 
Workingwithunity 110519054824-phpapp01
Workingwithunity 110519054824-phpapp01Workingwithunity 110519054824-phpapp01
Workingwithunity 110519054824-phpapp01Srijib Roy
 
Augusta Linux User Group - Vim Introduction
Augusta Linux User Group - Vim IntroductionAugusta Linux User Group - Vim Introduction
Augusta Linux User Group - Vim IntroductionKeith Pickett
 
Dreamweaver day4
Dreamweaver day4Dreamweaver day4
Dreamweaver day4Law Chng
 
Make Your Animations Perform Well - JS Conf Budapest 2017
Make Your Animations Perform Well - JS Conf Budapest 2017 Make Your Animations Perform Well - JS Conf Budapest 2017
Make Your Animations Perform Well - JS Conf Budapest 2017 Anna Migas
 
ncurses in your hobostove
ncurses in your hobostovencurses in your hobostove
ncurses in your hobostoveSmartLogic
 
When dynamic becomes static : the next step in web caching techniques
When dynamic becomes static : the next step in web caching techniquesWhen dynamic becomes static : the next step in web caching techniques
When dynamic becomes static : the next step in web caching techniquesWim Godden
 
Creating Responsive HTML5 Touch Interfaces
Creating Responsive HTML5 Touch InterfacesCreating Responsive HTML5 Touch Interfaces
Creating Responsive HTML5 Touch InterfacesStephen Woods
 
015-Editing-Files-With-Vi.pdf
015-Editing-Files-With-Vi.pdf015-Editing-Files-With-Vi.pdf
015-Editing-Files-With-Vi.pdfssuser584832
 
Building Efficient and Reliable Crawler System With Sidekiq Enterprise
Building Efficient and Reliable Crawler System With Sidekiq EnterpriseBuilding Efficient and Reliable Crawler System With Sidekiq Enterprise
Building Efficient and Reliable Crawler System With Sidekiq EnterpriseGary Chu
 

Similar to Vim - How to Develop Like a Ninja (20)

Mistakes I Made Building Netflix for the iPhone
Mistakes I Made Building Netflix for the iPhoneMistakes I Made Building Netflix for the iPhone
Mistakes I Made Building Netflix for the iPhone
 
Vi Editor
Vi EditorVi Editor
Vi Editor
 
CSS3: stay tuned for style
CSS3: stay tuned for styleCSS3: stay tuned for style
CSS3: stay tuned for style
 
Node.js streams talk
Node.js streams talkNode.js streams talk
Node.js streams talk
 
07.using vi
07.using vi07.using vi
07.using vi
 
CSS3 Animations & Transitions with PhoneGap
CSS3 Animations & Transitions with PhoneGapCSS3 Animations & Transitions with PhoneGap
CSS3 Animations & Transitions with PhoneGap
 
Rubymotion talk
Rubymotion talkRubymotion talk
Rubymotion talk
 
Vi editor
Vi editorVi editor
Vi editor
 
Workingwithunity 110519054824-phpapp01
Workingwithunity 110519054824-phpapp01Workingwithunity 110519054824-phpapp01
Workingwithunity 110519054824-phpapp01
 
Vim Basics
Vim BasicsVim Basics
Vim Basics
 
Augusta Linux User Group - Vim Introduction
Augusta Linux User Group - Vim IntroductionAugusta Linux User Group - Vim Introduction
Augusta Linux User Group - Vim Introduction
 
Dreamweaver day4
Dreamweaver day4Dreamweaver day4
Dreamweaver day4
 
Performance patterns
Performance patternsPerformance patterns
Performance patterns
 
Make Your Animations Perform Well - JS Conf Budapest 2017
Make Your Animations Perform Well - JS Conf Budapest 2017 Make Your Animations Perform Well - JS Conf Budapest 2017
Make Your Animations Perform Well - JS Conf Budapest 2017
 
ncurses in your hobostove
ncurses in your hobostovencurses in your hobostove
ncurses in your hobostove
 
When dynamic becomes static : the next step in web caching techniques
When dynamic becomes static : the next step in web caching techniquesWhen dynamic becomes static : the next step in web caching techniques
When dynamic becomes static : the next step in web caching techniques
 
Creating Responsive HTML5 Touch Interfaces
Creating Responsive HTML5 Touch InterfacesCreating Responsive HTML5 Touch Interfaces
Creating Responsive HTML5 Touch Interfaces
 
Kick my mouse away
Kick my mouse awayKick my mouse away
Kick my mouse away
 
015-Editing-Files-With-Vi.pdf
015-Editing-Files-With-Vi.pdf015-Editing-Files-With-Vi.pdf
015-Editing-Files-With-Vi.pdf
 
Building Efficient and Reliable Crawler System With Sidekiq Enterprise
Building Efficient and Reliable Crawler System With Sidekiq EnterpriseBuilding Efficient and Reliable Crawler System With Sidekiq Enterprise
Building Efficient and Reliable Crawler System With Sidekiq Enterprise
 

More from AlexLewin7

A Gentle Introduction to Blockchain & Cryptocurrency
A Gentle Introduction to Blockchain & CryptocurrencyA Gentle Introduction to Blockchain & Cryptocurrency
A Gentle Introduction to Blockchain & CryptocurrencyAlexLewin7
 
TAbConf 21 Hackathon Results
TAbConf 21 Hackathon ResultsTAbConf 21 Hackathon Results
TAbConf 21 Hackathon ResultsAlexLewin7
 
SSI, TBDex Overview
SSI, TBDex Overview SSI, TBDex Overview
SSI, TBDex Overview AlexLewin7
 
How Bitcoin Fits into Web 3
How Bitcoin Fits into Web 3How Bitcoin Fits into Web 3
How Bitcoin Fits into Web 3AlexLewin7
 
Nostr Intro - ATL BitDevs.pptx
Nostr Intro - ATL BitDevs.pptxNostr Intro - ATL BitDevs.pptx
Nostr Intro - ATL BitDevs.pptxAlexLewin7
 

More from AlexLewin7 (6)

Auntie LN
Auntie LN Auntie LN
Auntie LN
 
A Gentle Introduction to Blockchain & Cryptocurrency
A Gentle Introduction to Blockchain & CryptocurrencyA Gentle Introduction to Blockchain & Cryptocurrency
A Gentle Introduction to Blockchain & Cryptocurrency
 
TAbConf 21 Hackathon Results
TAbConf 21 Hackathon ResultsTAbConf 21 Hackathon Results
TAbConf 21 Hackathon Results
 
SSI, TBDex Overview
SSI, TBDex Overview SSI, TBDex Overview
SSI, TBDex Overview
 
How Bitcoin Fits into Web 3
How Bitcoin Fits into Web 3How Bitcoin Fits into Web 3
How Bitcoin Fits into Web 3
 
Nostr Intro - ATL BitDevs.pptx
Nostr Intro - ATL BitDevs.pptxNostr Intro - ATL BitDevs.pptx
Nostr Intro - ATL BitDevs.pptx
 

Recently uploaded

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 

Recently uploaded (20)

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 

Vim - How to Develop Like a Ninja

Editor's Notes

  1. Vim is a text editor that runs inside of the command line. It’s iconic for being hard to use, because you don’t touch your mouse
  2. Learning Vim seems really hard… until it clicks, I’m gonna try to give you the secret sauce ahead of time, which will hopefully get you over the initial ”hump” of getting used to using vim. I’m gonna show a few features of vim that will dramatically improve your efficiency... with the goal of blowing your mind
  3. Infamous for being really hard to learn
  4. https://youtu.be/DAUxjfiD4hY
  5. https://youtu.be/DAUxjfiD4hY
  6. Vim is a modal editor, so when in different modes, keys do different things - Insert mode: every button that you press, get printed where your cursor is
  7. Vim is a powerhouse for movement and navigation… Once you get fluent, you’ll blow your collogues away
  8. Vim is a powerhouse for movement and navigation… Once you get fluent, you’ll blow your collogues away
  9. Learning Vim is an investment in yourself... I tell people that Vim costs about a month of being bad at vim… After a month, you get to the same level of efficiency as your other editor (sublime, vscode)… After that first month, everything you learn is profit.
  10. For a very short while when starting out at vim, you’re gonna move really slowly… So, it might not be a good start using vim on projects with deadlines… Dedicate enough time to get to just a “workable” level, before moving to real projects
  11. I’m sure some people on this call are thinking “I’m not switching to vim unless it can do x, y, and z”… I promise, vim can do those things… it might take a little while to learn how to do it, but vim can do it… probably better than what ever you’ve been using So, try to suppress those thoughts as much as possible and it’ll work out…
  12. I’m sure some people on this call are thinking “I’m not switching to vim unless it can do x, y, and z”… I promise, vim can do those things… it might take a little while to learn how to do it, but vim can do it… probably better than what ever you’ve been using So, try to suppress those thoughts as much as possible and it’ll work out…