Vi by example – Buffers | Shoko's Spot
  • About

    This blog is a space for my thoughts, ideas, concept development, observed oddities exploration but mainly for much needed RANTING space from a frustrated penguin against the powers that be. Long live the yellow beak!
  • Subscribe
  • Mailing List

  •  

    May 2012
    M T W T F S S
    « Oct    
     123456
    78910111213
    14151617181920
    21222324252627
    28293031  
  • Vi by example – Buffers

    Notes:
    1. Open files in Vi are stored in buffers.
    2. Unless the buffer is explicitly deleted (:bdelete, :bwipeout), or Vi is exited, the buffer will remain in memory and available.

    Example:

    1. Start editing file1.txt – # vi file1.txtscreen1


    2. Edit file2.txt in a new window – :e file2.txt
    screen2


    3. Get all available buffers file names – :b <ctrl-d>
    screen1


    4. Go back to editing file1.txt in full screen – :b file1.txt
    screen2


    5. Put next buffer (which is now file2.txt) in a split with the current buffer (which is file1.txt) – :sbn
    screen5


    Commands:
    • Load the Nth buffer in full windows mode – :b <N>
    • Load a buffer by filename – :b <filename>
    • Load next buffer – :bn
    • Load previous buffer – :bp, :bN
    • Split window with buffer (by number or filename) – :sb <N>, :sb <filename>

    For more buffer commands type :help buffer

    Comment Pages

    There are 5 Comments to "Vi by example – Buffers"

    Write a Comment

    XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

    Search

  • Categories

  • Recent Posts

    • Kid Koala Live @ Maida Vale For 6 Music
    • SchemaSpy – Automatic ERD
    • AWS reserved instances – when is it cheaper?
    • Vi by example – Buffers
    • IAAS CPU bursts – Can it be bad?