linux

Linux Vi Editor




A text editor is a program that can be used to create and modify text files. One of the most popular editors on Unix systems is vi Editor.


Three modes are available in Vi editor.

  • ex-mode
  • command-mode
  • insert-mode


  • Commands which are used in Vi :

    h      move cursor one character to left

    j      move cursor one line down

    k       move cursor one line up

    l       move cursor one character to right

    w       move cursor one word to right

    b       move cursor one word to left

    0       move cursor to beginning of line

    $       move cursor to end of line

    nG       move cursor to line n

    control-f       scroll forward one screen

    control-b       scroll backward one screen

    i       insert to left of current cursor position (end with ESC)

    a       append to right of current cursor position(end with ESC)

    dw       delete current word (end with ESC)

    cw       change current word (end with ESC)

    r       change current character

    ~       change case (upper-, lower-) of current character

    dd       delete current line

    D       delete portion of current line to right of the cursor

    x       delete current character

    ma       mark currrent position

    d`a       delete everything from the marked position to here

    `a       go back to the marked position

    p       dump out at current place your last deletion (``paste'')

    u       undo the last command

    .       repeat the last command

    J       combine (``join'') next line with this one

    :w       write file to disk, stay in vi

    :q!       quit VI, do not write file to disk,

    ZZ       write file to disk, quit vi

    :r filename       read in a copy of the specified file to the current buffer

    /string       search forward for string (end with Enter)

    ?string       search backward for string (end with Enter)

    n repeat the last search ("next search'')

    :s/s1/s2       replace ("substitute'') (the first) s1 in this line by s2

    :lr/s/s1/s2/g       replace all instances of s1 in the line range lr by s2

    For more free linux tutorial on vi editor refer linux.org


                               send to a friend                                            moby@mylinuxplanet.com      

    Please free to mail your queries and feed back at moby@mylinuxplanet.com a free linux tutorial website


    Linux Tutorials

    About This Site

    History of Linux

    Open Source

    File system terms

    Linux File System

    History of Shell

    Opening a Shell Prompt

    Shell Prompt Basics

    Linux Shell Prompt

    Linux Commands

    Viewing Text Files From The Shell

    Manipulating Information from Shell

    Linux Help

    Managing Linux Files

    Multiple Commands Usage

    Managing Linux Directories

    Linux Directory Commands

    Locating And Search Commands

    Command History

    Wildcard Characters

    Creating a Linux User

    Ownership And Permissions

    File Compression

    Virtual Console Logout & Shutdown

    Running Background Process

    Shell Prompt Keyshortcuts

    Clearing And Resseting Terminal

    Vi Editor

    Shell Scripting

    Installing and Removing Applications

    Servers in Linux

    Our Link Partners