Semper Phone


  • Improve effortlessly – just by living your life
  • Learn while waiting for your apps to load
  • Recommended by 5 universities
  • Community of over 1,000,000 learners
  • 50,000+ expert-made packs, or create your own
"One of the best learning apps" - CNET
  • Apple Play Store
  • Install Semper from the Play Store
vi editor - inverted

vi editor - inverted

Last update 

-- This pack contains the same as "vi editor" but changes question and answer -- This contains an overview over the commands that are used inside the linux/unix command-line editor "vi". You will learn all of the important (and less important) commands you'll need to run vi and vim. Adopted from:

Items (55)

  • vi filename

    edit file "filename"

  • vi -r filename

    recover filename that was being edited when system crashed

  • :x

    quit vi, and save (option 1)

  • :wq

    quit vi, and save (option 2)

  • :q

    quit (or exit) vi

  • :q!

    quit vi without save

  • j or <Return>

    move cursor down one line

  • k [or up-arrow]

    move cursor up one line

  • h or <Backspace>   [or left-arrow]

    move cursor left one character

  • l or <Space>   [or right-arrow]

    move cursor right one character

  • 0 (zero)

    move cursor to start of current line

  • $

    move cursor to end of current line

  • w

    move cursor to beginning of next word

  • b

    move cursor back to beginning of preceding word

  • :0<Return> or 1G

    move cursor to first line in file

  • :n or nG

    move cursor to line n

  • :$ or G

    move cursor to last line in file

  • ^f

    move forward one screen

  • ^b

    move backward one screen

  • ^d

    move down one half screen

  • ^u

    move up one half screen

  • ^l

    redraws the screen

  • ^r

    redraws the screen, removing deleted lines

  • u

    undo (toggle)

  • i

    insert text before cursor, until <Esc>

  • I

    insert text at beginning of current line, until <Esc>

  • a

    append text after cursor, until <Esc>

  • A

    append text to end of current line, until <Esc>

  • o

    open and put text in a new line below current line, until <Esc>

  • O

    open and put text in a new line above current line, until <Esc>

  • r

    replace single character under cursor

  • R

    replace characters, starting at current cursor

  • cw

    change the current word with new text, starting with the character under cursor, until <Esc>

  • cNw

    change N words beginning with character under cursor, until <Esc>

  • C

    change the characters in the current line, until <Esc>

  • cc

    change the entire current line, stopping when <Esc>

  • Ncc or cNc

    change the next N lines stopping when <Esc>

  • x

    delete single character under cursor

  • Nx

    delete N characters

  • dw

    delete the single word

  • dNw

    delete N words

  • D

    delete the remainder of the line

  • dd

    delete entire current line

  • Ndd or dNd

    delete N lines

  • yy

    copy (yank, cut) the current line into the buffer

  • Nyy or yNy

    copy (yank, cut) the next N into the buffer

  • p

    put (paste) the line(s) in the buffer into the text after the current line

  • /string

    search forward for occurrence of string in text

  • ?string

    search backward for occurrence of string in text

  • n

    move to next occurrence of search string

  • N

    move to next occurrence of search string in opposite direction

  • :r filename

    read file named filename and insert after current line

  • :w

    write current contents to file named in original vi call

  • :w newfile

    write current contents to a new file named newfile

  • :w! prevfile

    write current contents over a pre-existing file named prevfile