CSU Long Beach
CECS 274
Programming and Problem Solving II


Syllabus
Schedule
Grading
Project 1
Project 2
Solution to Project 2
Project 3
Solution to Project 3
Project 4
Solution to Project 4
Project 5
Set Solution to Project 5
Map Solution to Project 5
Lecture Notes
Basic Unix Commands
Basic vi Commands
More vi Commands
Using Eclipse
Compiling and Running Java on Unix


Mimi Opkins Home

More vi Commands

    Here are some additional movement commands:

     

    Name

    Command

    Description

    move word

    w, W, b, B

    Forward or backward by word

    end of word

    e, E

    Move to end of word

    sentence

    ), (

    Beginning of next or current sentence

    paragraph

    }, {

    Beginning of next or current paragraph

    lines

    0, $

    Beginning or end of current line

    home

    H

    Top line of screen

    last

    L

    Last line of screen

    middle

    M

    Middle line of screen

    Scroll

    CTRL-F, CTRL-B

    Scroll forward, backward one screen

    Scroll

    CTRL-D, CTRL-U

    Scroll down, up one-half screen

    Scroll

    CTRL-E, CTRL-Y

    Show one more line at bottom, top of window

    Redraw

    CTRL-L, CTRL-R

    Redraw screen (without scrolling)

    Search

    /text

    Search  forward for text

    Search

    n

    Repeat previous search

    Search

    N

    Repeat search in opposite direction

    Search

    /

    Repeat forward search

    Search

    ?

    Repeat previous search backward

    Search

    ?text

    Search backward for text

    Match

    %

    Find match of current parenthesis, brace or bracket

    Line Number

    CTRL-G

    Display current line number

    Line Number

    nG

    Move to line number n

    Line Number

    G

    Move to last line in file

    Line Number

    :n

    Move to line number n

    Marking

    mx

    Mark current position with character x

    Marking

    `x

    Move to cursor mark x

    Marking

    'x

    Move to start of line containing x

     

    Here are some additional edit commands:

     

    Name

    Command

    Description

    Change text

    cw, cl

    Change word, change line (finish with ESC)

    Replace

    rx, Rtext

    Replace character or text with typing (finish with ESC)

    Repeat

    .

    Repeat last change

    Copy, yank

    yy

    Copy current line into buffer

    Copy, yank

    #Y

    Copy # lines into a buffer (# maybe nothing)

    Paste

    p, P

    Insert buffer contents after or before cursor

    Copy

    ye, yl, y}

    Copy to end of word, line, or paragraph

    Join

    J

    Join two lines

    Delete

    D

    Delete remainder of line