Giter VIP home page Giter VIP logo

vim-cheatsheet's Introduction

First things first

:help help

Moving around

:help cursor-motions

  • hjkl
  • 0 $ _
  • gg G
  • w e b
  • f t F T
  • :number numberG
  • {} ( avoid holding jk )

PRO TIP: ; to jump to next ocurrence

Inserting text

:help inserting

  • I i a O o A

Deleting, fixing small fuckups

  • x, xp ( AKA "the windows move", swaps to characters very quickly )
  • r ( replace one chaacter )

Ever typed widht? try fhxp from the beginning of the line

Line operations

dd J

Select

  • v
  • V

Text objects

:help text-objects

count + operator + motion

aw iw ap ap i([{t

Operators

  • c - change
  • d - delete ( when you delete, you copy! )
  • y - yank ( copy )

PROTIP: paste over selected text

Repeat

The power of .

Macros ( complex repeats )

  • set @q ( fix macro )
  • use :normal @q to apply macro line by line

Search

/ n N ? .* ( poor man's fuzzy search )

  • search word under cursor

CONFIG TIP: smartcase

Jump jump

:help jumps

  • <c-[>
  • gf
  • g;

Substitute power

:s/foo/bar :s/foo/bar/g :%s/foo/bar/g

:%s/somematch/&Lol :%s/backreferences!/\1,\2

Use custom separators ( useful for URLs )

:%s!https?://www.google.com!http://www.duckduckgo.com!gc

CONFIG TIP: use smartcase BOOK: Mastering regular expressions

Splits/windows

  • s
  • v
  • c
  • o
  • hjkl

CONFIG TIP: remap hjkl

Command mode PRO tips

  • " ( " / )
  • navigate without cursors
  • open command-line window ( edit commands in normal mode OMG )
  • for keystrokes ( useful for macros, you'll see later )

Complete!

  • ( complete by word )
  • ( complete file path, relative to current directory )
  • ( complete a line )
  • Use to go up and down

vim-cheatsheet's People

Contributors

morantron avatar

Stargazers

Daniel Palomar Rodríguez avatar Ryan Kemper avatar Evandro Cavalcante Santos avatar Theodore Felix Leo avatar Adli Wahid avatar M avatar Stephen Rathbone avatar marc avatar Ian Martorell avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.