SlideShare a Scribd company logo
How to become
a practical Vim user
   ujihisa.vim#3 2012-11-03


                 @kana1
It was very hard
  to master Vim
It was very hard
        to master Vim

• Too many features to learn
It was very hard
        to master Vim

• Too many features to learn
• Odd behavior for backward compatibility
It was very hard
        to master Vim

• Too many features to learn
• Odd behavior for backward compatibility
• Esoteric language to customize
Too many features
    to learn
Too many Ex commands
Too many Ex commands
Too many functions
Too many functions
Too many documents
Too many documents
Odd behavior
Odd behavior

• Useful features are turned off by default
Odd behavior

• Useful features are turned off by default
 • Syntax highlighting
Odd behavior

• Useful features are turned off by default
 • Syntax highlighting
 • Automatic indentation per filetype
Odd behavior

• Useful features are turned off by default
 • Syntax highlighting
 • Automatic indentation per filetype
 • Command-line completion
Odd behavior

• Useful features are turned off by default
 • Syntax highlighting
 • Automatic indentation per filetype
 • Command-line completion
 • and so on
Odd behavior
Odd behavior


• :map is recursively expanded
Odd behavior


• :map is recursively expanded
• <BS> cannot delete indent by default
Odd behavior


• :map is recursively expanded
• <BS> cannot delete indent by default
• and so on
Esoteric language
  to customize
Difficult comments
Difficult comments
:endsomething
:endsomething
Higher-odder functions
Higher-odder functions
But...
But...


• People rumor that
  Vim is one of the most invaluable skill
How to become a practical Vim user
How to become a practical Vim user
Now it’s very easy
 to master Vim
How to become a practical Vim user
Practical Vim
by Drew Neil
Why Practical Vim
    is great
Why Practical Vim
        is great

• Organized well to boost your productivity
Why Practical Vim
        is great

• Organized well to boost your productivity
• Focused on mastering built-in features
Organized well
Organized well


• Organized by useful theme
Organized well


• Organized by useful theme
• Can be read in any order
Organized well


• Organized by useful theme
• Can be read in any order
• Progress from simple to advanced
Organized by
useful theme
Organized by
                    useful theme
• 1. The Vim Way                          • 12. Matching Patterns and Literals
• 2. Normal Mode                          • 13. Search
• 3. Insert Mode                          • 14. Substitution
• 4.Visual Mode                           • 15. Global Commands
• 5. Command-Line Mode                    • 16. Index and Navigate Source Code with ctags
• 6. Manage Multiple Files                • 17. Compile Code and Navigate Errors with
                                            the Quickfix List
• 7. Open Files and Save Them to Disk
                                          • 18. Search Project-Wide with grep, vimgrep,
• 8. Navigate Inside Files with Motions     and Others

• 9. Navigate Between Files with Jumps    • 19. Dial X for Autocompletion
• 10. Copy and Paste                      • 20. Find and Fix Typos with Vim’s Spell Checker
• 11. Macros                              • 21. Now What?
Can be read
in any order
Can be read
              in any order
•   If you are an experienced user:
    → Read interesting tips,
        then move the book around as you need.
Can be read
               in any order
•   If you are an experienced user:
    → Read interesting tips,
        then move the book around as you need.

•   If you are a novice:
    → Read from the first to the last.
        Chapters are organized so.
Progress from
simple to advanced
Progress from
   simple to advanced
11. Macros
Progress from
   simple to advanced
11. Macros
Tip 64. Record and Execute a Macro
Progress from
   simple to advanced
11. Macros
Tip 64. Record and Execute a Macro
Tip 65. Normalize, Strike, Abort
Tip 66. Play Back with a Count
Tip 67. Repeat a Change on Contiguous Lines
Tip 68. Append Commands to a Macro
Tip 69. Act Upon a Collection of Files
Tip 70. Evaluate an Iterator to Number Items in a List
Progress from
   simple to advanced
11. Macros
Tip 64. Record and Execute a Macro
Tip 65. Normalize, Strike, Abort
Tip 66. Play Back with a Count
Tip 67. Repeat a Change on Contiguous Lines
Tip 68. Append Commands to a Macro
Tip 69. Act Upon a Collection of Files
Tip 70. Evaluate an Iterator to Number Items in a List
Tip 71. Edit the Contents of a Macro
Progress from
   simple to advanced
11. Macros
Tip 64. Record and Execute a Macro
Tip 65. Normalize, Strike, Abort
Tip 66. Play Back with a Count
Tip 67. Repeat a Change on Contiguous Lines
Tip 68. Append Commands to a Macro
Tip 69. Act Upon a Collection of Files
Tip 70. Evaluate an Iterator to Number Items in a List
Tip 71. Edit the Contents of a Macro
Progress from
   simple to advanced
11. Macros
Tip 64. Record and Execute a Macro
Tip 65. Normalize, Strike, Abort
Tip 66. Play Back with a Count
Tip 67. Repeat a Change on Contiguous Lines
Tip 68. Append Commands to a Macro
Tip 69. Act Upon a Collection of Files
Tip 70. Evaluate an Iterator to Number Items in a List
Tip 71. Edit the Contents of a Macro
Focused on mastering
   built-in features
Focused on mastering
    built-in features


• Not only how to use,
  but also how to combine
Focused on mastering
   built-in features
Focused on mastering
    built-in features
• Tip 1. Meet the dot command
  → Learn what the dot command does
    dw. = dwdw
Focused on mastering
    built-in features
• Tip 1. Meet the dot command
  → Learn what the dot command does
    dw. = dwdw
• Tip 9. Compose repeatable changes
  → Learn how to effectively use the dot
    Bad: dbx, bdw
    Good: daw
Focused on mastering
   built-in features
Focused on mastering
    built-in features
• Tip 10. Use counts to do simple arithmetic
  → Learn how to use counts
    d2w = 2dw = dwdw
Focused on mastering
    built-in features
• Tip 10. Use counts to do simple arithmetic
  → Learn how to use counts
    d2w = 2dw = dwdw
• Tip 11. Don’t count if you can repeat
  → Learn when to use counts
    dw... rather than d4w and 4dw
Conclusion
Conclusion

• If you are not a Vim wizard:
  → Buy Practical Vim!
Conclusion

• If you are not a Vim wizard:
  → Buy Practical Vim!
• If you are already a Vim wizard:
  → Share your magics!
But
But


• Focused on mastering built-in features
But


• Focused on mastering built-in features
• Not a book for how to tune up Vim for you
But


• Focused on mastering built-in features
• Not a book for how to tune up Vim for you
• Therefore
How to become a practical Vim user
We need “Practical Vim script”
       by Drew Neil
Q&A

More Related Content

How to become a practical Vim user

  • 1. How to become a practical Vim user ujihisa.vim#3 2012-11-03 @kana1
  • 2. It was very hard to master Vim
  • 3. It was very hard to master Vim • Too many features to learn
  • 4. It was very hard to master Vim • Too many features to learn • Odd behavior for backward compatibility
  • 5. It was very hard to master Vim • Too many features to learn • Odd behavior for backward compatibility • Esoteric language to customize
  • 6. Too many features to learn
  • 7. Too many Ex commands
  • 8. Too many Ex commands
  • 14. Odd behavior • Useful features are turned off by default
  • 15. Odd behavior • Useful features are turned off by default • Syntax highlighting
  • 16. Odd behavior • Useful features are turned off by default • Syntax highlighting • Automatic indentation per filetype
  • 17. Odd behavior • Useful features are turned off by default • Syntax highlighting • Automatic indentation per filetype • Command-line completion
  • 18. Odd behavior • Useful features are turned off by default • Syntax highlighting • Automatic indentation per filetype • Command-line completion • and so on
  • 20. Odd behavior • :map is recursively expanded
  • 21. Odd behavior • :map is recursively expanded • <BS> cannot delete indent by default
  • 22. Odd behavior • :map is recursively expanded • <BS> cannot delete indent by default • and so on
  • 23. Esoteric language to customize
  • 31. But... • People rumor that Vim is one of the most invaluable skill
  • 34. Now it’s very easy to master Vim
  • 37. Why Practical Vim is great
  • 38. Why Practical Vim is great • Organized well to boost your productivity
  • 39. Why Practical Vim is great • Organized well to boost your productivity • Focused on mastering built-in features
  • 41. Organized well • Organized by useful theme
  • 42. Organized well • Organized by useful theme • Can be read in any order
  • 43. Organized well • Organized by useful theme • Can be read in any order • Progress from simple to advanced
  • 45. Organized by useful theme • 1. The Vim Way • 12. Matching Patterns and Literals • 2. Normal Mode • 13. Search • 3. Insert Mode • 14. Substitution • 4.Visual Mode • 15. Global Commands • 5. Command-Line Mode • 16. Index and Navigate Source Code with ctags • 6. Manage Multiple Files • 17. Compile Code and Navigate Errors with the Quickfix List • 7. Open Files and Save Them to Disk • 18. Search Project-Wide with grep, vimgrep, • 8. Navigate Inside Files with Motions and Others • 9. Navigate Between Files with Jumps • 19. Dial X for Autocompletion • 10. Copy and Paste • 20. Find and Fix Typos with Vim’s Spell Checker • 11. Macros • 21. Now What?
  • 46. Can be read in any order
  • 47. Can be read in any order • If you are an experienced user: → Read interesting tips, then move the book around as you need.
  • 48. Can be read in any order • If you are an experienced user: → Read interesting tips, then move the book around as you need. • If you are a novice: → Read from the first to the last. Chapters are organized so.
  • 50. Progress from simple to advanced 11. Macros
  • 51. Progress from simple to advanced 11. Macros Tip 64. Record and Execute a Macro
  • 52. Progress from simple to advanced 11. Macros Tip 64. Record and Execute a Macro Tip 65. Normalize, Strike, Abort Tip 66. Play Back with a Count Tip 67. Repeat a Change on Contiguous Lines Tip 68. Append Commands to a Macro Tip 69. Act Upon a Collection of Files Tip 70. Evaluate an Iterator to Number Items in a List
  • 53. Progress from simple to advanced 11. Macros Tip 64. Record and Execute a Macro Tip 65. Normalize, Strike, Abort Tip 66. Play Back with a Count Tip 67. Repeat a Change on Contiguous Lines Tip 68. Append Commands to a Macro Tip 69. Act Upon a Collection of Files Tip 70. Evaluate an Iterator to Number Items in a List Tip 71. Edit the Contents of a Macro
  • 54. Progress from simple to advanced 11. Macros Tip 64. Record and Execute a Macro Tip 65. Normalize, Strike, Abort Tip 66. Play Back with a Count Tip 67. Repeat a Change on Contiguous Lines Tip 68. Append Commands to a Macro Tip 69. Act Upon a Collection of Files Tip 70. Evaluate an Iterator to Number Items in a List Tip 71. Edit the Contents of a Macro
  • 55. Progress from simple to advanced 11. Macros Tip 64. Record and Execute a Macro Tip 65. Normalize, Strike, Abort Tip 66. Play Back with a Count Tip 67. Repeat a Change on Contiguous Lines Tip 68. Append Commands to a Macro Tip 69. Act Upon a Collection of Files Tip 70. Evaluate an Iterator to Number Items in a List Tip 71. Edit the Contents of a Macro
  • 56. Focused on mastering built-in features
  • 57. Focused on mastering built-in features • Not only how to use, but also how to combine
  • 58. Focused on mastering built-in features
  • 59. Focused on mastering built-in features • Tip 1. Meet the dot command → Learn what the dot command does dw. = dwdw
  • 60. Focused on mastering built-in features • Tip 1. Meet the dot command → Learn what the dot command does dw. = dwdw • Tip 9. Compose repeatable changes → Learn how to effectively use the dot Bad: dbx, bdw Good: daw
  • 61. Focused on mastering built-in features
  • 62. Focused on mastering built-in features • Tip 10. Use counts to do simple arithmetic → Learn how to use counts d2w = 2dw = dwdw
  • 63. Focused on mastering built-in features • Tip 10. Use counts to do simple arithmetic → Learn how to use counts d2w = 2dw = dwdw • Tip 11. Don’t count if you can repeat → Learn when to use counts dw... rather than d4w and 4dw
  • 65. Conclusion • If you are not a Vim wizard: → Buy Practical Vim!
  • 66. Conclusion • If you are not a Vim wizard: → Buy Practical Vim! • If you are already a Vim wizard: → Share your magics!
  • 67. But
  • 68. But • Focused on mastering built-in features
  • 69. But • Focused on mastering built-in features • Not a book for how to tune up Vim for you
  • 70. But • Focused on mastering built-in features • Not a book for how to tune up Vim for you • Therefore
  • 72. We need “Practical Vim script” by Drew Neil
  • 73. Q&A

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n