Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Intro to Vim

Intro to Vim

A brief introduction to Vim including how to navigate between the various modes and some examples of motions, commands, and combinations of those.

This talk was presented at a private corporate event on May 5th, 2016.

Matt Chandler

May 05, 2016
Tweet

More Decks by Matt Chandler

Other Decks in Programming

Transcript

  1. A little history • “vi” was released in 1976 •

    Vim is an acronym for “Vi IMproved” • Vim was released in 1991 • Available on all platforms
  2. What is Vim? • Modal text editor, which means there

    are different layers for interacting with text • It is probably different than any other editor you have used, which is why it can seem difficult
  3. Motions j  move down one line 3j  move

    down three lines k  move up a line l  move right a character h  move left a character w  move forward a word b  move back a word e  move to end of next word
  4. The Vim Language Syntax is broken in to verb +

    noun d  delete w  word .  repeat last command u  undo last command
  5. Basic Verbs d  delete c  change > 

    indent v  visually select y  yank (copy) p  paste after cursor P  paste before cursor
  6. Combinations d  delete i  inner w  word

    Deletes the word and leaves you in normal mode
  7. Combinations c  change i  inner w  word

    Deletes the word and puts you in insert mode
  8. But that’s not all it  inner tag i” 

    inner quotes i{  inner curly braces i(  inner parentheses a”  around quotes t,  until comma t)  until closing parentheses
  9. But that’s not all dd  delete current line yy

     yank (copy) current line y5  yank next ten lines ddp  switch the current line with the one below /  search for characters
  10. Vim + Visual Studio • “VsVim” extension is an emulation

    layer for Visual Studio • “RelativeLineNumbers” gives you relative line numbers in Visual Studio
  11. Learning • vimtutor • Google “vim” + “query” will always

    yield results • Vi/Vim Stack Exchange • http://vi.stackexchange.com/ • Keep a cheat sheet handy at first • http://www.viemu.com/vi-vim-cheat-sheet.gif • Try to learn something new every week