Vim: Difference between revisions

From Halfface
Jump to navigation Jump to search
No edit summary
Line 4: Line 4:
  :e#
  :e#
==yank buffers==
==yank buffers==
Copy data to different buffers.
  vi /etc/{passwd,group,shadow} /tmp/newfile
  vi /etc/{passwd,group,shadow} /tmp/newfile
  "a2yy      # Yank two lines to yank buffer a.
  "a2yy      # Yank two lines to yank buffer a.
Line 14: Line 15:
  "bp
  "bp
  "cp
  "cp
Delete lines and add to a buffer.
vi /tmp/tmp1 /tmp/tmp2
"add        # Delete some lines and add to buffer a.
"Add        # Go to next lines and add lines to buffer a.
:wn
"ap        # Paste buffer.

Revision as of 05:16, 22 June 2008

Useful commands.

Switch to last file

:e#

yank buffers

Copy data to different buffers.

vi /etc/{passwd,group,shadow} /tmp/newfile
"a2yy       # Yank two lines to yank buffer a.
:n          # Go to next file.
"b2yy
:n
#c2yy
:n
"ap         # paste yank buffer a. 
"bp
"cp

Delete lines and add to a buffer.

vi /tmp/tmp1 /tmp/tmp2
"add         # Delete some lines and add to buffer a.
"Add        # Go to next lines and add lines to buffer a.
:wn
"ap         # Paste buffer.