____    ____  __  .___  ___.                                              
                                              \   \  /   / |  | |   \/   |                                              
                                               \   \/   /  |  | |  \  /  |                                              
                                                \      /   |  | |  |\/|  |                                              
                                                 \    /    |  | |  |  |  |                                              
                                                  \__/     |__| |__|  |__|                                              
                                                                                                                        
                        .___  ___.   ______   .___________. __    ______   .__   __.      _______.                      
                        |   \/   |  /  __  \  |           ||  |  /  __  \  |  \ |  |     /       |                      
                        |  \  /  | |  |  |  | `---|  |----`|  | |  |  |  | |   \|  |    |   (----`                      
                        |  |\/|  | |  |  |  |     |  |     |  | |  |  |  | |  . `  |     \   \                          
                        |  |  |  | |  `--'  |     |  |     |  | |  `--'  | |  |\   | .----)   |                         
                        |__|  |__|  \______/      |__|     |__|  \______/  |__| \__| |_______/                          
                                                                                                                        
                                                                                                                        
                           _____            _____               ___     ____             __ _ _                         
                          |  ___|__  _ __  |  ___|   _ _ __    ( _ )   |  _ \ _ __ ___  / _(_) |_                       
                          | |_ / _ \| '__| | |_ | | | | '_ \   / _ \/\ | |_) | '__/ _ \| |_| | __|                      
                          |  _| (_) | |    |  _|| |_| | | | | | (_>  < |  __/| | | (_) |  _| | |_                       
                          |_|  \___/|_|    |_|   \__,_|_| |_|  \___/\/ |_|   |_|  \___/|_| |_|\__|                      
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                 1 / 13 
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                Introduction                                                
                                                                                                                        
                                                                                                                        
                                                                                                                        
          ██ Who even is this guy?                              ▓▓▓ What is this vim thing?                             
                                                                                                                        
             •  Senior Software Engineer @iHeart                Well it is not a gym...                                 
             •  Keyboard and ergonomics enthusiast                                                                      
             •  Die hard terminal fanboy                                                                                
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
          "Vim is a powerful, free, and open-source terminal based text editor                                          
          known for its efficiency and keyboard-centric approach." - ChatGPT                                            
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                 2 / 13 
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                              Why am I here?                                              
                                                                                                                        
                                                                                                                        
                                                                                                                        
          ██ What is this talk not about?                                                                               
                                                                                                                        
             •  Setting up the vim editor in your               ▓▓▓ What is this talk about then!?                      
                terminal                                                                                                
             •  An in-depth guide into everything you              •  Using the modal style editing that vim            
                can do with vim                                       embraces to make moving around text               
             •  Abolishing mice and touch devices                     documents and projects blazingly fast             
                ◦  Although this one is borderline                 •  Getting a basic understanding of the              
                                                                      core building blocks of cursor movement           
                                                                      in vim, aka motions                               
                                                                   •  Talking about where you can use vim               
                                                                      motions outside of the terminal editor            
                                                                      (Like plugins for other editors/IDEs)             
                                                                   •  Most importantly, how to exit vim!                
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                 3 / 13 
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                            Why vim motions?                                            
                                                                                                                        
                                                                                                                        
                                                                                                                        
          ██ Why use vim motions when I      ██ Alright, but then what          ██ So then I should just                
          can just move my mouse?            about this "blazing fast"          learn my editor's shortcuts?            
                                             text editing?                                                              
          Computer work and typing is                                           I mean yes, you should.                 
          strenuous activity!                This all boils down to             Especially if your editor has           
                                             Actions Per Minute (APM).          things like built in                    
          It's estimated that 1.8            Knowing your way around the        debugging or compilation                
          million US workers suffer          keyboard and all the keyboard      features.                               
          from Repetitive Strain             shortcuts just lets you do                                                 
          Injuries (RSI) every year.[1]      things faster than clicking        This talk is mostly focused             
                                             with a mouse.                      on editing text though, so              
          Researchers in Sweden has                                             let's take a deeper dive into           
          found that half of people who                                         the differences between                 
          work with computers complain                                          conventional text editors and           
          of RSI.[2]                                                            modal text editors.                     
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                 4 / 13 
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                            Let's talk modes                                            
                                                                                                                        
                                                                                                                        
                                                                                                                        
          ██ What is modality?                                                                                          
                                                                                                                        
          It is the state of being modal. Basically it just means to have different modes or patterns of                
          interaction. Kind of like a transformer!                                                                      
                                                                                                                        
          ▓▓▓ So what modes does vim have?                                                                              
                                                                                                                        
          A whole bunch actually. However, the 4 most common are:                                                       
                                                                                                                        
             •  normal                                                                                                  
                ◦  Where you can enter shortcuts for moving around                                                      
                   documents, performing commands, etc. This is usually                                                 
                   the default mode.                                                                                    
             •  insert                                                                                                  
                ◦  Where you can actually enter text. The most common                                                   
                   keybind to enter insert mode is i                                                                    
             •  visual                                                                                                  
                ◦  Allows you to visually select text using the motions                                                 
                   similar to normal mode. The most common keybind to                                                   
                   enter visual mode is with the v key, or V to enter                                                   
                   visual block mode which lets you easily select entire                                                
                   lines.                                                                                               
             •  command                                                                                                 
                ◦  Gives you a sort of command palette to run vim                                                       
                   commands. The most common keybind to enter command                                                   
                   mode is :.                                                                                           
                ◦  This is how you might normally exit vim, using the                                                   
                   command wq to save (or write) and quit, or with q! to                                                
                   force quit.                                                                                          
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                 5 / 13 
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                           I like to move it                                           
                                                                                                                        
                                                                                                                        
                                                                                                                        
          ██ So now that we have a small glimpe into the modes of vim, let's look more at vim motions and               
          commands                                                                                                      
                                                                                                                        
          A vim command is how to tell vim to take actions (such        ▓▓▓ Vertical motions                            
          as move up one line, delete a word, etc). A vim motion                                                        
          is a subset of vim commands that allows you to move              •  j/k                                       
          your cursor around a buffer (a.k.a. an open file).                  ◦  These move the cursor down             
          Some more common motions are:                                          and up respectively.                   
                                                                           •  G                                         
          ▓▓▓ Horizontal motions                                              ◦  Takes you to the last line             
                                                                                 of the buffer.                         
             •  h/l                                                        •  gg                                        
                ◦  These move the cursor left and right                       ◦  Takes you to the first line            
                   respectively.                                                 of the buffer.                         
             •  0                                                          •  ctrl + f/b                                
                ◦  Brings you to the beginning of the line.                   ◦  Moves you down or up one               
             •  ^                                                                full page                              
                ◦  Brings you to the first non-whitespace                  •  ctrl + d/u                                
                   character of the line.                                     ◦  Moves you down or up one               
             •  $                                                                half page                              
                ◦  Brings you to the end of the line.                      •  :{num}<CR>                                
             •  f{char}                                                       ◦  Go to line number {num}.               
                ◦  Brings you to the next occurrence of {char}.                                                         
             •  F{CHAR}                                                                                                 
                ◦  Brings you to the previous occurrence of                                                             
                   {char}.                                                                                              
             •  t{char}                                                                                                 
                ◦  Brings you 1 char before the next occurrence                                                         
                   of {char}.                                                                                           
             •  T{CHAR}                                                                                                 
                ◦  Brings you 1 char after the previous                                                                 
                   occurrence of {char}.                                                                                
                                                                                                                 6 / 13 
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                       I like to move it pt2                                       
                                                                                                                        
                                                                                                                        
                                                                                                                        
          ██ Text objects                                                                                               
                                                                                                                        
             •  One of the really neat things about vim is the idea of text objects. These are things like              
                words, sentances, paragraphs, and even coding specific objects like functions, classes, or              
                blocks.                                                                                                 
                                                                                                                        
          ▓▓▓ Word motions                                                                                              
                                                                                                                        
          These operate on individual words.                    ▓▓▓ Sentance motions                                    
                                                                                                                        
             •  w                                                  •  These operate on numbers of words until           
                ◦  Move forward one word.                             an ending punctuation (Such as ., !, or ?).       
             •  b                                                  •  )                                                 
                ◦  Move backward one word.                            ◦  Move forward one sentance.                     
             •  e                                                  •  (                                                 
                ◦  Move forward to the end of the word.               ◦  Move backwards one sentance.                   
             •  ge                                                                                                      
                ◦  Move backward to end of the previous         ▓▓▓ Paragraph motions                                   
                   word.                                                                                                
                                                                   •  These operate on collections of                   
                                                                      sentances until an empty line.                    
                                                                   •  }                                                 
                                                                      ◦  Move forward one paragraph.                    
                                                                   •  {                                                 
                                                                      ◦  Move backwards one paragraph.                  
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                 7 / 13 
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                         I like to SELECT it                                         
                                                                                                                        
                                                                                                                        
                                                                                                                        
          ██ Text object selections                                                                                     
                                                                                                                        
          These allow you to select a surrounding text object or block to perform an action on. These only              
          work either in visual mode or after an operator (We'll get to those next)                                     
                                                                                                                        
             •  a                                                                                                       
                ◦  Selects an object.                                                                                   
             •  i                                                                                                       
                ◦  Selects inside an object.                                                                            
             •  Examples                                                                                                
                ◦  aw                                                                                                   
                   ▪  Select a word                                                                                     
                ◦  ip                                                                                                   
                   ▪  Select inside a paragraph                                                                         
                ◦  i[                                                                                                   
                   ▪  Select inside of a [] block                                                                       
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                 8 / 13 
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                             Now do it again                                             
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
          Vim motions can often be accompanied by a count that allows you to do the same motion multiple times          
          without having to press the keybind more than once. This usually takes the form of {count}{motion}.           
          Here are a couple examples:                                                                                   
                                                                                                                        
             •  3w                                                                                                      
                ◦  Move forward 3 words.                                                                                
             •  5j                                                                                                      
                ◦  Move down 5 lines.                                                                                   
             •  2f-                                                                                                     
                ◦  Move to the 2nd occurrence of the - character.                                                       
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                 9 / 13 
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                Operator PLZ                                                
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
          ██ The next classification of vim commands are operators                                                      
                                                                                                                        
          operators allow you to, well, operate on text. Things like, deleting, replacing, yanking (or                  
          copying), etc. These commands are combined with motions to allow you to do operations over a                  
          specific subset of text without having to select it first. These take the form of {operator}{motion}.         
                                                                                                                        
             •  c                                                                                                       
                ◦  "change"                                                                                             
                ◦  Edits the text selected by the motion.                                                               
                ◦  Example                                                                                              
                   ▪  cw                                                                                                
                   ▪  Changes the next word.                                                                            
             •  d                                                                                                       
                ◦  "delete"                                                                                             
                ◦  Deletes the text selected by the motion.                                                             
                ◦  Example                                                                                              
                   ▪  d2w                                                                                               
                   ▪  Deletes the next 2 words.                                                                         
                   ▪  There is a common shortcut of dd to delete an entire line.                                        
             •  y                                                                                                       
                ◦  "yank"                                                                                               
                ◦  Copies the text selected by the motion into the selected register (Default is ")                     
                ◦  Example                                                                                              
                   ▪  yip                                                                                               
                   ▪  Yanks inside the current paragraph                                                                
                   ▪  There is a common shortcut of yy to yank an entire line.                                          
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                10 / 13 
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                On Your Mark                                                
                                                                                                                        
                                                                                                                        
                                                                                                                        
          ██ Marks let you save a spot in your file to          ██ You can use a mark as a motion too                   
          easily jump back to                                                                                           
                                                                   •  d`a                                               
             •  To save a mark you use m{char} where                  ◦  delete all text from current cursor            
                char is some key like a, b, or 1.                        potion to position of mark a                   
             •  To recall a mark you have two options              •  d'a                                               
                ◦  '{char} goes to the first                          ◦  delete all text from current line to           
                   non-whitespace character on the line                  line of mark a                                 
                   of the mark                                                                                          
                ◦  `{char} goes to the exact cursor             ██ And you can jump between them                        
                   position of the mark                                                                                 
                   ▪  I know, it won't let me highlight            •  ]' jump to next line with a mark                  
                      that backtick...                             •  [' jump to previous line with a mark              
             •  :marks to show a list of all your                  •  ]` jump to next mark                              
                current marks                                      •  [` jump to previous mark                          
                                                                                                                        
          ██ There are also some special marks                  Plus you can use counts to do them multiple             
                                                                times: 5]' jumps the next 5 lines with marks            
             •  `. jump to position where last change                                                                   
                occurred in current buffer                                                                              
             •  `" jump to position where last exited                                                                   
                current buffer                                                                                          
             •  `0 jump to position in last file edited                                                                 
                (when exited Vim)                                                                                       
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                11 / 13 
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                      I Think I Need a Tutor                                      
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
          Learning this new paradigm of text editing can seem daunting. However there are 2 big advantages you          
          have. They are vim tutor and emulation plugins for existing editors.                                          
                                                                                                                        
          ██ Tutor me senpai                                                                                            
                                                                                                                        
          Vim comes with a really helpful sort of "tutorial" that goes over all this and more. You can invoke           
          it from within the vim editor by running vimtutor from your shell. This will bring you into a                 
          tailored vim experience that will let you practice your skills and build muscle memory.                       
                                                                                                                        
          ▓▓▓ But I can't be spending all my time in the tutorial, I need to actually get stuff done                    
                                                                                                                        
          I hear you on this one. This is where vim emulation plugins come in super handy! I started off using          
          the VSCodeVim [3] plugin to learn these motions without leaving my existing setup. There are also             
          plugins for JetBrains IDEs [4] and Sublime Text [5]. Zed even has native vim emulation [6]! Chances           
          are there is an plugin for your editor of choice.                                                             
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                12 / 13 
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                         FIN                                                         
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
          ██ Citations                                                                                                  
                                                                                                                        
             1. ergonomics (                                                                                            
                https://www.shrm.org/resourcesandtools/hr-topics/risk-management/pages/ergonomics-away-from-of          
                fice.aspx)                                                                                              
             2. rsi (http://www.rsi.org.uk/pdf/ULDs_Overview.pdf)                                                       
             3. VSCodeVim (https://marketplace.visualstudio.com/items?itemName=vscodevim.vim)                           
             4. IdeaVim (https://lp.jetbrains.com/ideavim/)                                                             
             5. vintage (https://www.sublimetext.com/docs/vintage.html)                                                 
             6. Zed (https://zed.dev/docs/vim)                                                                          
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                13 / 13