SlideShare a Scribd company logo
(Vi iMproved)
Coding With Vim
Presented By: Matthew Kosolofski
Agenda
● What The Heck Is Vim and Why Would I Want To
Use It?!
● I Just Want To Edit A File!
● Vim On Steroids
● Painful Quirks and Gotchas
● Always Vimproving
What The Heck Is Vim and Why
Would I Want To Use It?
An open source highly configurable
command line text editor
Available for all standard platforms
Customize once and transfer to any other machine
Works really well as an IDE
Best thing of all... ITS FREE!
(charitable donations)
I Just Want To Edit A File!
Normal Mode
<ESC>
● For performing edit commands
● Can always be reached from other modes by hitting
escape
Undo Change: u
Redo Change: <CONTROL>r
Delete Line: dd
Copy Line (yank): yy
Paste After Cursor From Delete/Copy Buffer: p
Repeat Command X Times: <NUMBER><COMMAND>
Repeat Last Command: .
Tab Current Line Contents Right: <SHIFT>>
Tab Current Line Contents Left: <SHIFT><
Auto Format: =
Search For Next Word Under Cursor: <SHIFT>*
Start Recording Macro: q<KEY>
Stop Recording Macro: <ESC>q
Play Macro: <SHIFT>@<KEY>
Auto Text Completion: <CONTROL>p
Select Line(s): <SHIFT><RIGHT CLICK HOLD AND DRAG>
Copy Selection To Clipboard:
<CONTROL><SHIFT> c OR <LEFT CLICK>
Paste From Clipboard: <CONTROL><SHIFT>p OR <LEFT CLICK>
Insert Mode
<ESC> i
● Direct keyboard edits
Select Mode
● Windows like operations
Reg Ex Search: <ESC>/<REGEX>
Reg Ex Replace: <ESC> :%s/<FIND>/<REPLACE>/gci
Save File: <ESC>:w
Close File: <ESC>:q
Force File Close: <ESC>:q!
Force Save: <ESC>:w!
Plugin Commands: <ESC>:<COMMAND>
View Vim Help File: <ESC>:help vim
View Bundle Help File:<ESC>:help<BundleName>
Command Mode
<ESC>: <ESC>/ <ESC>?
● Search/Replacements
● Opening, closing, saving files
● Plugin commands
Select Lines: <ARROW KEYS>
Tab Selected Line Right: <SHIFT>>
Tab Selected Line Left: <SHIFT><
Copy Selected Text To Buffer: y
Deleted Text To Buffer: d
Regex search on selected: /<REGEX>
Replace on selected text: :s/<FIND>/<REPLACE>/gci
Visual Mode
<ESC>v <ESC><CONTROL>v
● Edits with selection
But Wait... There's More Modes!!!!
Ex-Mode - Like command mode but limited
Six mixed modes of the modes you just learned
On Steroids
● If missing, simply create the file
● Where you customize your vim experience (plugins, key
mappings, custom macros, vim environment)
● Automatically loaded when you open a file with vim
VIMRC
Located at: ~/.vimrc
Plugins
Vundle - Plugin manager
Control P - Recursively search for files using regex
NerdTree - Directory listing viewer
vDebug - Code debugging using xDebug
cTags - Drill into code
tList - Source code structure
Syntastic - Syntax checker
There's probably a plugin for that!
VIMDIFF
vimdiff <file1> <file2>
● For diffing 2 or more files
● Comes with vim installation
● Leverage a bash script to vimdiff changed repo files.
(see my guthub account for an example)
Painful Quirks and Gotchas!
● “<CONTROL> S” Accepts key strokes but quits echoing.
Recover: <CONTROL> Q
● Not all terminal emulators are created equal (putty, bash).
Expected key mappings may be overridden but can be
changed in the terminal preferences.
● Steep Learning Curve
Always Vimproving
www.vim.org
vimtutor
Questions?
Twitter
@mkosolof
LinkedIn
https://www.linkedin.com/pub/matthew-kosolofski/34/814/238
GitHub
http://github.com/mkosolofski
SlideShare
http://www.slideshare.net/MatthewKosolofski

More Related Content

PDF
Cashew Cafe - Original Storyboard
PDF
Vim Script Programming
ODP
Mechanize at the Ruby Drink-up of Sophia, November 2011
PDF
Ruby 2.0 at the Ruby drink-up of Sophia, February 2013
PDF
Ruby object model at the Ruby drink-up of Sophia, January 2013
PPTX
Django vs Flask
PPT
PMML - Predictive Model Markup Language
PDF
Pycon 2014 - Flask vs Django vs Web.py (PANEL)
Cashew Cafe - Original Storyboard
Vim Script Programming
Mechanize at the Ruby Drink-up of Sophia, November 2011
Ruby 2.0 at the Ruby drink-up of Sophia, February 2013
Ruby object model at the Ruby drink-up of Sophia, January 2013
Django vs Flask
PMML - Predictive Model Markup Language
Pycon 2014 - Flask vs Django vs Web.py (PANEL)

Viewers also liked (15)

PPT
Understanding REST
PPT
Almost Scraping: Web Scraping without Programming
ODP
Using Vim
PPTX
Soap vs rest
PDF
Developing RESTful Web APIs with Python, Flask and MongoDB
PDF
Scraping data from the web and documents
PPTX
The Django Web Application Framework 2
PDF
Kodar-lan - Text and editors Vi/Vim (2013-06-15)
PDF
The Django Web Application Framework
PPT
Basic introduction to SOA
PDF
Python RESTful webservices with Python: Flask and Django solutions
PDF
Restful Web Services
PPT
Learn REST API with Python
PPTX
Web Services - Architecture and SOAP (part 1)
PPT
A Comprehensive Introduction to Everything SOA
Understanding REST
Almost Scraping: Web Scraping without Programming
Using Vim
Soap vs rest
Developing RESTful Web APIs with Python, Flask and MongoDB
Scraping data from the web and documents
The Django Web Application Framework 2
Kodar-lan - Text and editors Vi/Vim (2013-06-15)
The Django Web Application Framework
Basic introduction to SOA
Python RESTful webservices with Python: Flask and Django solutions
Restful Web Services
Learn REST API with Python
Web Services - Architecture and SOAP (part 1)
A Comprehensive Introduction to Everything SOA
Ad

Similar to Coding In Vim (20)

PDF
What is Vim?
PPT
PDF
Vim Basics
PDF
vim brownbag - Richard forth
KEY
Vim week
PDF
Tuffarsi in vim
PDF
3.8.a how to - vim course book
PDF
101 3.8.1 vim course book
PPT
Vim Vi Improved
PDF
PPTX
Introduction to Vim
PPT
07 vi text_editor
PDF
Mission vim possible
PDF
Mission vim possible-full
ODP
Vim and Python
PDF
015-Editing-Files-With-Vi.pdf
PDF
PDF
Unit 5 vim an advanced text editor
PDF
vim-cheatsheet.pdf
PPT
Mastering the Linux vi Editor: Essential Commands and Techniques
What is Vim?
Vim Basics
vim brownbag - Richard forth
Vim week
Tuffarsi in vim
3.8.a how to - vim course book
101 3.8.1 vim course book
Vim Vi Improved
Introduction to Vim
07 vi text_editor
Mission vim possible
Mission vim possible-full
Vim and Python
015-Editing-Files-With-Vi.pdf
Unit 5 vim an advanced text editor
vim-cheatsheet.pdf
Mastering the Linux vi Editor: Essential Commands and Techniques
Ad

Recently uploaded (20)

PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
Spectroscopy.pptx food analysis technology
PPTX
MYSQL Presentation for SQL database connectivity
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Approach and Philosophy of On baking technology
PPTX
A Presentation on Artificial Intelligence
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Electronic commerce courselecture one. Pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Empathic Computing: Creating Shared Understanding
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
The Rise and Fall of 3GPP – Time for a Sabbatical?
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Assigned Numbers - 2025 - Bluetooth® Document
Spectroscopy.pptx food analysis technology
MYSQL Presentation for SQL database connectivity
NewMind AI Weekly Chronicles - August'25-Week II
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Advanced methodologies resolving dimensionality complications for autism neur...
Approach and Philosophy of On baking technology
A Presentation on Artificial Intelligence
gpt5_lecture_notes_comprehensive_20250812015547.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
The AUB Centre for AI in Media Proposal.docx
Electronic commerce courselecture one. Pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
20250228 LYD VKU AI Blended-Learning.pptx
Empathic Computing: Creating Shared Understanding

Coding In Vim

  • 1. (Vi iMproved) Coding With Vim Presented By: Matthew Kosolofski
  • 2. Agenda ● What The Heck Is Vim and Why Would I Want To Use It?! ● I Just Want To Edit A File! ● Vim On Steroids ● Painful Quirks and Gotchas ● Always Vimproving
  • 3. What The Heck Is Vim and Why Would I Want To Use It? An open source highly configurable command line text editor Available for all standard platforms Customize once and transfer to any other machine Works really well as an IDE Best thing of all... ITS FREE! (charitable donations)
  • 4. I Just Want To Edit A File!
  • 5. Normal Mode <ESC> ● For performing edit commands ● Can always be reached from other modes by hitting escape Undo Change: u Redo Change: <CONTROL>r Delete Line: dd Copy Line (yank): yy Paste After Cursor From Delete/Copy Buffer: p Repeat Command X Times: <NUMBER><COMMAND> Repeat Last Command: . Tab Current Line Contents Right: <SHIFT>> Tab Current Line Contents Left: <SHIFT>< Auto Format: = Search For Next Word Under Cursor: <SHIFT>* Start Recording Macro: q<KEY> Stop Recording Macro: <ESC>q Play Macro: <SHIFT>@<KEY>
  • 6. Auto Text Completion: <CONTROL>p Select Line(s): <SHIFT><RIGHT CLICK HOLD AND DRAG> Copy Selection To Clipboard: <CONTROL><SHIFT> c OR <LEFT CLICK> Paste From Clipboard: <CONTROL><SHIFT>p OR <LEFT CLICK> Insert Mode <ESC> i ● Direct keyboard edits Select Mode ● Windows like operations
  • 7. Reg Ex Search: <ESC>/<REGEX> Reg Ex Replace: <ESC> :%s/<FIND>/<REPLACE>/gci Save File: <ESC>:w Close File: <ESC>:q Force File Close: <ESC>:q! Force Save: <ESC>:w! Plugin Commands: <ESC>:<COMMAND> View Vim Help File: <ESC>:help vim View Bundle Help File:<ESC>:help<BundleName> Command Mode <ESC>: <ESC>/ <ESC>? ● Search/Replacements ● Opening, closing, saving files ● Plugin commands
  • 8. Select Lines: <ARROW KEYS> Tab Selected Line Right: <SHIFT>> Tab Selected Line Left: <SHIFT>< Copy Selected Text To Buffer: y Deleted Text To Buffer: d Regex search on selected: /<REGEX> Replace on selected text: :s/<FIND>/<REPLACE>/gci Visual Mode <ESC>v <ESC><CONTROL>v ● Edits with selection
  • 9. But Wait... There's More Modes!!!! Ex-Mode - Like command mode but limited Six mixed modes of the modes you just learned
  • 11. ● If missing, simply create the file ● Where you customize your vim experience (plugins, key mappings, custom macros, vim environment) ● Automatically loaded when you open a file with vim VIMRC Located at: ~/.vimrc
  • 12. Plugins Vundle - Plugin manager Control P - Recursively search for files using regex NerdTree - Directory listing viewer vDebug - Code debugging using xDebug cTags - Drill into code tList - Source code structure Syntastic - Syntax checker There's probably a plugin for that!
  • 13. VIMDIFF vimdiff <file1> <file2> ● For diffing 2 or more files ● Comes with vim installation ● Leverage a bash script to vimdiff changed repo files. (see my guthub account for an example)
  • 14. Painful Quirks and Gotchas! ● “<CONTROL> S” Accepts key strokes but quits echoing. Recover: <CONTROL> Q ● Not all terminal emulators are created equal (putty, bash). Expected key mappings may be overridden but can be changed in the terminal preferences. ● Steep Learning Curve