SlideShare a Scribd company logo
vi
Vim, Nvim
Introduction to Vi
Why VI editor?
1.Move your fingers not hands.
2.Fast editing and movement
3.Light weight
4.Many plugins
Vim Modes
Three Modes
1.Command Mode - ESC, Ctrl-c (We navigate, hit shortcuts)
2.Insert Mode - i, a, s (We write here)
3.Visual Mode - v, Ctrl-v (We select text here)
Visual Mode isn’t provided in ‘vi’ editor, its added
in vim.
Never Forget hjkl
In Command Mode
1.h - Left
2.j - Down
3.k - Up
4.l - Right
5.:w - save
6.:wq - save and quit
Insert Mode
1.i - insert where the cursor is
2.a - insert next position
3.s - delete current position and insert
Visual Mode
1.v - start selection
2.Ctrl-v - Vertical selection
3.Shift-v - Select by line
Try: ‘Shift-v’ and press ‘y’ then ‘p’
Common Shortcuts
1.Using numbers for navigation:
a.10l - position cursor after 10 letters (left direction)
b.99k - move up 99 lines (k is up)
c.33s - delete 33 letters and then insert
2. Ctrl-d = page down
3.Ctrl-b = page up
4.:%s/old_pat/new_pat/g = replace old_pat with new_pat
Vim as an IDE
1.Syntax highlighting = syntastic
2.Autocomplete = youcompleteme, jedi-vim, ctags
3.Browse files = nerdtree, ctrlp
4.Status = Vim airline
5.Git = fugitive
6.Code snippets = Ultisnips
7.Edit history = Gundo
Basic Vimrc
syntax on
filetype plugin indent on
set autoindent
set backspace=indent,eol,start
set expandtab " enter spaces when tab is pressed
set tabstop=4 " use 4 spaces to represent tab
set shiftwidth=4

More Related Content

PPT
Motion day6
DOC
1 d motion review 2011
PDF
Assignment1-ch#1
PDF
Make vim plugin with elixir
PDF
How To Access Code In Large w/ Vim
PDF
Vim Basics
PPTX
Vim survival guide
PDF
vim brownbag - Richard forth
Motion day6
1 d motion review 2011
Assignment1-ch#1
Make vim plugin with elixir
How To Access Code In Large w/ Vim
Vim Basics
Vim survival guide
vim brownbag - Richard forth

Similar to Introduction to Vi (20)

PDF
Introduction to vim
PDF
3.8.a how to - vim course book
PDF
101 3.8.1 vim course book
PPT
PDF
What is Vim?
PPT
Mastering the Linux vi Editor: Essential Commands and Techniques
PDF
Unit 5 vim an advanced text editor
PPT
Vi editor in linux
PPT
07 vi text_editor
ODP
Augusta Linux User Group - Vim Introduction
PDF
Mission vim possible
PDF
Vi Improved Vim First Edition Steve Oualline
PDF
Tuffarsi in vim
PPTX
Vi editor
PPTX
PDF
Vi survival guide
PPTX
ODP
Coding In Vim
PDF
Introduction to vim
3.8.a how to - vim course book
101 3.8.1 vim course book
What is Vim?
Mastering the Linux vi Editor: Essential Commands and Techniques
Unit 5 vim an advanced text editor
Vi editor in linux
07 vi text_editor
Augusta Linux User Group - Vim Introduction
Mission vim possible
Vi Improved Vim First Edition Steve Oualline
Tuffarsi in vim
Vi editor
Vi survival guide
Coding In Vim
Ad

More from MicroPyramid . (8)

PPTX
Custom web application development with Django for startups and Django-CRM intro
PPTX
Social login integration
PPTX
Packaging and distributing python code to Pypi
PPTX
Introduction to react_js
PDF
Git & github
PPTX
Django elastic beanstalk
PPTX
Unit Testing with Python
PPTX
Hands on django part 1
Custom web application development with Django for startups and Django-CRM intro
Social login integration
Packaging and distributing python code to Pypi
Introduction to react_js
Git & github
Django elastic beanstalk
Unit Testing with Python
Hands on django part 1
Ad

Recently uploaded (20)

PDF
System and Network Administraation Chapter 3
PDF
AI in Product Development-omnex systems
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPT
Introduction Database Management System for Course Database
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Nekopoi APK 2025 free lastest update
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Softaken Excel to vCard Converter Software.pdf
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
System and Network Administraation Chapter 3
AI in Product Development-omnex systems
How to Migrate SBCGlobal Email to Yahoo Easily
Navsoft: AI-Powered Business Solutions & Custom Software Development
VVF-Customer-Presentation2025-Ver1.9.pptx
Introduction Database Management System for Course Database
CHAPTER 2 - PM Management and IT Context
Operating system designcfffgfgggggggvggggggggg
How Creative Agencies Leverage Project Management Software.pdf
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Which alternative to Crystal Reports is best for small or large businesses.pdf
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Odoo Companies in India – Driving Business Transformation.pdf
Nekopoi APK 2025 free lastest update
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Softaken Excel to vCard Converter Software.pdf
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Upgrade and Innovation Strategies for SAP ERP Customers

Introduction to Vi

  • 3. Why VI editor? 1.Move your fingers not hands. 2.Fast editing and movement 3.Light weight 4.Many plugins
  • 4. Vim Modes Three Modes 1.Command Mode - ESC, Ctrl-c (We navigate, hit shortcuts) 2.Insert Mode - i, a, s (We write here) 3.Visual Mode - v, Ctrl-v (We select text here) Visual Mode isn’t provided in ‘vi’ editor, its added in vim.
  • 5. Never Forget hjkl In Command Mode 1.h - Left 2.j - Down 3.k - Up 4.l - Right 5.:w - save 6.:wq - save and quit
  • 6. Insert Mode 1.i - insert where the cursor is 2.a - insert next position 3.s - delete current position and insert
  • 7. Visual Mode 1.v - start selection 2.Ctrl-v - Vertical selection 3.Shift-v - Select by line Try: ‘Shift-v’ and press ‘y’ then ‘p’
  • 8. Common Shortcuts 1.Using numbers for navigation: a.10l - position cursor after 10 letters (left direction) b.99k - move up 99 lines (k is up) c.33s - delete 33 letters and then insert 2. Ctrl-d = page down 3.Ctrl-b = page up 4.:%s/old_pat/new_pat/g = replace old_pat with new_pat
  • 9. Vim as an IDE 1.Syntax highlighting = syntastic 2.Autocomplete = youcompleteme, jedi-vim, ctags 3.Browse files = nerdtree, ctrlp 4.Status = Vim airline 5.Git = fugitive 6.Code snippets = Ultisnips 7.Edit history = Gundo
  • 10. Basic Vimrc syntax on filetype plugin indent on set autoindent set backspace=indent,eol,start set expandtab " enter spaces when tab is pressed set tabstop=4 " use 4 spaces to represent tab set shiftwidth=4