On 21/03/11 5:04 PM, John Magolske wrote:
I'm trying to create a mapping that would allow me to visually select
several lines of text, then create a file consisting of just those
lines (preserving indentation, etc), sorta like:
visually-selected-text-gets-piped-to>| /tmp/file1
Just use the :w command.
Visually select, then type : which will automatically fill out :'<,'> on the
commandline. Then you can do
:'<,'>w some_file
Or if you actually want to pipe to a command
:'<,'>w !some_command
Using :w won't change the name of the file you're editing (unless you're writing
the whole file and it doesn't have a name yet, IIRC).
Ben.
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php