Coder Social home page Coder Social logo

vim_mentor's Introduction

vim

Vim is a highly configurable text editor for efficiently creating and changing any kind of text. It is included as "vi" with most UNIX systems and with Apple OS X.

Modes in vim

  • Command Mode : everything you type is a command that allows you to move the cursor around, delete and copy text, search for words, save the file, quit, etc.

  • Insert Mode: everything you type (save for special keys) is added to the file, as would happen in a word processor; however, you can only move the cursor with the arrow keys, not the mouse.

To create a file with vim:

  • Type the command vim file_name.extension (e.g. vim_example.txt) or vi file_name.extension

  • The editor starts in command mode.

  • We can switch to insert mode by typing i. You should see the message -- INSERT -- appear at the bottom of your window.

  • To go back to command mode, press the escape key. The message should now disappear. Toggle back and forth between the two modes.

Command mode cheat sheet:

  • Saving and quiting:

    • :w - save

    • :wq - save and quit

    • :q - quit

    • :q! - quit, ignoring changes

    • :u - undo

  • Moving the cursor:

    • 0 - first column of the line
    • ^ - first non-blank character of the line
    • $ - jump to the last character of the line
    • w - jump to next word
    • b - jump to word-beginning
    • } - jump over a block of lines
    • % - jump to matching bracket
    • '*' - go to next occurrence of word under cursor
    • '#' - go to previous occurrence of word under cursor
  • Copy and Paste

    • yy - copy current line
    • 10yy copy 10 lines
    • p - paste
  • Search:

    • /word_to_search - search the document for the next occurrence of word_to_search
    • ?word_to_search - search the document for the previous occurrence of word_to_search

vim_mentor's People

Contributors

debasishmaji avatar

Watchers

 avatar  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.