10x Developer
  • Introduction
  • HTML
    • HTML DOM Jquery
    • HTML: Form
    • CSS
    • CSS Layout
    • CSS Flexbox
    • CSS Grid
    • SASS/LESS
    • CSS/LESS/SASS Cookbook
    • Bootstrap
  • JavaScript
    • JavaScript
    • ES6
    • TypeScript
    • JavaScript Testing
    • JavaScript Event Loop
    • DOM
    • Web APIs
    • JSON
    • RegEx
    • Functional Programming
    • JavaScript Lib
    • CoffeeScript
    • CoffeeScript to ES6 cheatsheet
  • Angular.js
    • Angular
    • Angular Cookbook
    • Angular Mistakes I Made
    • Angular 1.x
  • React.js
    • React.js
  • Node
    • Node.js
    • CLI command line tool
    • Electron / Atom
    • NW.js (node-webkit)
  • Serverless
    • AWS Lambda
    • Google Cloud Function
    • Actions on Google / Google Assistant
  • Full Stack Development
    • HTTP
    • Meteor
    • MongoDB
    • Digital Ocean
    • UI
    • Sketch
    • Web Dev Resources
  • Lang
    • Ruby
  • Know Your Tools
    • Chrome DevTools
    • Editor: VS Code
    • Editor: Vim
    • Editor: Sublime
    • Editor: Atom
    • Windows
    • Git
    • Linux / Bash
    • Mac
  • Cheatsheets
Powered by GitBook
On this page
  • Cheatsheet (that I don't know)
  • Cheatsheet
  • Use Bookmarks
  1. Know Your Tools

Editor: Vim

PreviousEditor: VS CodeNextEditor: Sublime

Last updated 5 years ago

Do this chanllege:

Cheatsheet (that I don't know)

My bad habit (mostly motion):

  • use 3j or 3k instead of hitting jjjj or kkkk

  • Edit at the first of the line: 0i -> I

  • Move to first non whitespace char: 0w -> ^

  • Navigation in current screen: H/M/L first/middle/last

  • Scroll current line to top of window: zt

  • t and f is different: t is to before the character where f includes the character. That's why when you copy to quote you should use vf' instead of vt' (this will miss the last character before ')

Good to use:

  • Good to navigate based on error message:

    • Go to line number 12: 12G

    • Go to column 20: 20l

  • Go to previous location: `` (two backticks)

  • Use bookmark: ma (mark with a) then `a (go to a)

Good to know:

  • Swap case: ~ (can do it in normal mode)

  • move screen: CTRL+e or CTRL+y

  • :x is same as :wq

Cheatsheet

  • %

  • gu gU

  • * n N

Use Bookmarks

  • set: ma

  • go: `a (go to exact location) or 'a (to go front of the line)

What can it do:

In-file navigation:

  • Use bookmark: ma and then `a

  • or go to last place: ``

Delete text in multiple lines (block):

  • go to start of block

  • ma

  • go to end of block

  • d`a

https://www.shortcutfoo.com/app/dojos/vim