vi

Oct. 28th, 2002 03:59 pm
hugme: (Default)
[personal profile] hugme
I wanted to write a quick 'everything you will ever need to know about vi' file... something quick and simple that you can learn all the commands in a few minutes but from it be able to do everything you will need to get get basic stuff done. it won't be much use for any of your own knowledge but it's what I am giving to my new users so they are afraid of it. This one file should give them information about vi so that they can do basic edits to files yet provide enough advanced commands so they don't feel it's easier just to copy it to their windows desktop and work on it there.

so this is what I came up with:


Everything you need to know about VI to be an expert.
 
 
basic commands:
 
movement:
        h = move left
        l = move right
        j = move down
        k = move up
(look at your keyboard, l,j and k are your home keys for your
        right hand)
 
Edit:
        i = go into edit mode at the curser
        a = go into edit mode before the curser
        o = open a new line under the current line to edit
        O = open a new line above the current line to edit
 
get out of edit mode: [esc]
 
delete:
        d* where * is a movement key = delete the character/line in
                that direction
        dd = delete line (see advanced comands for more info on this)
        D = delete the current line starting at the curser
 
other:
        . = repeat the last command
        u = undo the last command
        / = go into find mode
 
writing and exiting:
        :wq = write and quit
        :q! = quit but do not save changes
        ZZ = same as :wq
 
more advanced commands:
 
        entering a number... means do the next command that many times
        for example:
        70j = move down 70 lines
        10dd = delete the current line and the 9 after it
 
        p = paste what is in the clipboard to the file
        yy = copy the current line to the clipboard
        dd = cut the current line to the clipboard
 
        :E [new file] = this will split your screen top to bottom and
                open a new file (specified) into the bottom half of the
                screen. You can switch between the two screens with a
                [ctrl]w

Ex-pert, now a reformed pert.

Date: 2002-10-28 01:18 pm (UTC)
dwivian: (Default)
From: [personal profile] dwivian
ex: E is not a recognized command

Make sure you know what version of vi you are using, and if it is elVIs, VIm, or whatnot. Not all commands are everywhere.

Important cool additional commands....

c - change
cw - change word
c$ - change to end of line

d - delete
dw - delete word

w - movement key - move a word forward. W - move a word as defined by spaces, and not by semantics
b - movement key - move a word backward B - move back '' '' '''' ' ' ' ' '

just some more cool stuf used almost daily by your resident VIMaster

Re: Ex-pert, now a reformed pert.

Date: 2002-10-28 01:49 pm (UTC)
From: [identity profile] hugs.livejournal.com
I really considered adding a couple of those mainly cw. however I really don't want to make this an all in wonder file. I want it to be usefull enough so that someone can do what they need to without a problem but not so many commands that it scares them. This is for people who are rarely going to use vi but when they do they need to be able to get around a little.

I set a limit of 20 commands and went over by 1. I think I picked a good 21 of them.

Re: Ex-pert, now a reformed pert.

Date: 2002-10-28 01:50 pm (UTC)
From: [identity profile] hugs.livejournal.com
oh, and I know that :E doesn't work for every vi but it works for the 2 (nvi and something else) that we use here ;-)

Profile

hugme: (Default)
hugme

April 2011

S M T W T F S
     12
3456789
10111213141516
17 181920212223
24252627282930

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Apr. 8th, 2026 09:51 pm
Powered by Dreamwidth Studios