Coder Social home page Coder Social logo

vim-guide's Introduction

Vim Guide

List

Modes

There are two modes in vi: normal and insert.

  • from normal to insert: i
  • from insert to normal: esc

In insert mode, you just type characters as you need.

The following commmands are used in normal mode.

Movement

Characters

  • up: k
  • down: j
  • left: h
  • right: l

Words

  • back (to the start of current or previous word): b
  • end (to the end of current of next word): e
  • next (to the start of next word): w

Lines

  • go to line $n: $nG
  • go to start of current line: 0
  • go to end of current line: $

Documents

  • go to start of current document: gg
  • go to the end of current document: G

Search

  • character $c inline: f$c to next, F$c to previous
  • the other part of current bracket: %
  • current word: * to next, # to previous
  • regular expression $r: /$r, n to next, N to previous

Editing

This will switch to insert mode.

  • insert: i
  • append: a
  • new line after current line: o
  • new line before current line: O

Copy & Paste

  • copy: all deletions will copy the content
  • copy: todo
  • paste: p

Repetition

  • do some $ops over $n times: $n$ops
  • do previous ops: .

Undo & Redo

  • undo: u
  • redo: ctrl+r

Save & Quit

  • save: :w
  • quit: :q, :q! to force quit
  • save and quit: :wq, :wq! to force save and quit

Others

  • line number: :set nu to show, set nu! to hide

vim-guide's People

Watchers

James Cloos avatar Yao Zhao 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.