From: Alexander Viro <aviro@redhat.com>
To: John Holp <jholp@chesapeake.net>
Cc: linux-audit@redhat.com
Subject: Re: copying lines from one file to another using vi
Date: Sat, 6 Feb 2010 15:48:35 -0500 [thread overview]
Message-ID: <20100206204835.GC993@shell.devel.redhat.com> (raw)
In-Reply-To: <911903C52CE64CBBA9EE580F74300C45@jholpPC>
On Sat, Feb 06, 2010 at 03:29:25PM -0500, John Holp wrote:
> Redhat wizards,
>
> I am doing good with auditing but want to copy key lines from example files into /etc/audit/audit.rules
>
> What is the vi/vim syntax to copy lines from one file and post them into another file - i.e. my audit.rules file?
>
> 5yy appears to yank the current line and 4 more and one can paste the buffered lines into the same file but I want to pass the lines to a different file.
>
> :h file_name I recall from along ago but that is for an entire file - I think:
>
> Please help me to copy files from sample auditing files into my real "audit.rules".
Switch to another file, then paste there... The most portable way is
:n <filename><CR>
but in almost all vi variants there's a way to split the window and open
a new file there. For nvi that would be
:Vi <filename><CR>
for vim - :split <filename><CR>
and switching between those subwindows is
^W
in nvi an
^Ww
in vim.
prev parent reply other threads:[~2010-02-06 20:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-06 20:29 copying lines from one file to another using vi John Holp
2010-02-06 20:48 ` Alexander Viro [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100206204835.GC993@shell.devel.redhat.com \
--to=aviro@redhat.com \
--cc=jholp@chesapeake.net \
--cc=linux-audit@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.