More Related Content
More from Anil Kumar Pugalia
More from Anil Kumar Pugalia(18)
Power of vi
- 1. Power of 'vi'
© 2010 Anil Kumar Pugalia <email@sarika-pugs.com>
All Rights Reserved.
- 2. What to Expect?
Versions of 'vi'
Handy Tutorial
Patterns in 'vi'
Magic with 'vi'
© 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 2
All Rights Reserved.
- 3. 'vi' Versions
'vi' stands for “visual”
First in its series
After the line editors like 'ed'
Dates back to 'QWERTY' keyboard days
Designed to get maximum with minimum
'vim' – 'vi' improved
'gvim- graphical 'vim'
© 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 3
All Rights Reserved.
- 4. 'vi'sual Editor Benefits
Key to Productivity
Initial learning curve
But goes down fast with practice
Delivering more in long run
Including generating code
Speed without being Typist
No mouse & Minimized keypad usage
Short cuts
Unique features like Recording
© 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 4
All Rights Reserved.
- 5. Handy Tutorial for Starters
“vimtutor”
Type it on your shell
And try it right now
Follow what it says
And there you go using 'vim'
© 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 5
All Rights Reserved.
- 6. Patterns in 'vi'
Modes: Command (Esc), File (:), Edit
Edit Modes: a, i, o and A, I, O
Operations: c, d, r, s, y
Prefix: Repeat for line, w for word
Capitals: Till end of line
Undo: u, Redo: Ctrl+R
Prefix numbers for repeating
Search: / ?
© 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 6
All Rights Reserved.
- 7. Magic with 'vi'
Write a program to print from 1 to 1000
Without using any loops, conditionals, gotos
Print all in 4-digit formats prefixed by 0's
Not really 0's but spaces
Many more things ...
Including recording across multiple files
© 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 7
All Rights Reserved.
- 8. What all have we learnt?
Versions of 'vi': vi, vim, gvim
Handy Tutorial: vimtutor
Patterns in 'vi': Command Set
Magic with 'vi': Recording
© 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 8
All Rights Reserved.