I have started to learn vim in this modern enviroment where gui takes
prefers , one thing that still me back to other editors is the ease with
which we can copy and paste , can anybody help me out with safe effect in
vim or any thing of that sort
> one thing that still me back to other editors is the ease with
> which we can copy and paste , can anybody help me out with safe
> effect in vim or any thing of that sort
You can
set clipboard=unnamed
to use the system clipboard for yank and paste operations. With this
option you can easily copy and paste within vim and to/from other
applications. For further information see
On Thu, Nov 8, 2012 at 4:53 PM, vicky b <vickyb2...@gmail.com> wrote:
> I have started to learn vim in this modern enviroment where gui takes
> prefers , one thing that still me back to other editors is the ease with
> which we can copy and paste , can anybody help me out with safe effect in
> vim or any thing of that sort
If you are using gvim, you have the option of clicking on "Edit" -> "Copy"
and "Edit" -> "Paste". You need to select some text first obviously, before
copy. Selection can be done with mouse. Using CTRL-C and CTRL-V might also
work for copy/paste - whether it does work or not depends on a few factors.
It that the answer you were looking for?
Also, if GUI is what you want to work with, vim may not be worth looking
at. Just my opinion.
> On Thu, Nov 8, 2012 at 4:53 PM, vicky b <vickyb2...@gmail.com> wrote:
>> I have started to learn vim in this modern enviroment where gui takes
>> prefers , one thing that still me back to other editors is the ease with
>> which we can copy and paste , can anybody help me out with safe effect in
>> vim or any thing of that sort
> If you are using gvim, you have the option of clicking on "Edit" -> "Copy"
> and "Edit" -> "Paste". You need to select some text first obviously, before
> copy. Selection can be done with mouse. Using CTRL-C and CTRL-V might also
> work for copy/paste - whether it does work or not depends on a few factors.
> It that the answer you were looking for?
> Also, if GUI is what you want to work with, vim may not be worth looking
> at. Just my opinion.
> --
> 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
On Thu, Nov 8, 2012 at 1:37 PM, vicky b <vickyb2...@gmail.com> wrote:
> no i dont want to use GUI , i want to use vim not gvim how can copy and
> paste with ease in vim
y for yank (copy)
p for paste
Use the * register to yank/paste to/from the system clipboard.
This should be covered in the vimtutorial, run vimtutor if you have not
done so yet.
> On Thu, Nov 8, 2012 at 6:05 PM, Karthick Gururaj <
> karthick.guru...@gmail.com> wrote:
>> On Thu, Nov 8, 2012 at 4:53 PM, vicky b <vickyb2...@gmail.com> wrote:
>>> I have started to learn vim in this modern enviroment where gui takes
>>> prefers , one thing that still me back to other editors is the ease with
>>> which we can copy and paste , can anybody help me out with safe effect in
>>> vim or any thing of that sort
>> If you are using gvim, you have the option of clicking on "Edit" ->
>> "Copy" and "Edit" -> "Paste". You need to select some text first obviously,
>> before copy. Selection can be done with mouse. Using CTRL-C and CTRL-V
>> might also work for copy/paste - whether it does work or not depends on a
>> few factors.
>> It that the answer you were looking for?
>> Also, if GUI is what you want to work with, vim may not be worth looking
>> at. Just my opinion.
>> --
>> 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
> --
> *Thanks & Regards
> Vickyb
> *
> --
> 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
> On Thu, Nov 8, 2012 at 1:37 PM, vicky b <vickyb2...@gmail.com> wrote:
> > no i dont want to use GUI , i want to use vim not gvim how can copy and
> > paste with ease in vim
> y for yank (copy)
> p for paste
> Use the * register to yank/paste to/from the system clipboard.
> This should be covered in the vimtutorial, run vimtutor if you have not
> done so yet.
Hi,
You can also paste from a register in the insert mode, see ":help i^r".
For example CTRL-R0 in insert mode will paste the recent yank. There is
also ":help i^r^r" (e.g. CTRL-R_CTRL-R) which puts the content of the
register literally. This will differ from ^r if there is a backspace in
the register: using ^r will delete like backspace does, ^r^r will put
the backspace literally into the buffer.
> On Thu, Nov 8, 2012 at 1:37 PM, vicky b <vickyb2...@gmail.com
> <mailto:vickyb2...@gmail.com>> wrote:
> no i dont want to use GUI , i want to use vim not gvim how can
> copy and paste with ease in vim
> y for yank (copy)
> p for paste
> Use the * register to yank/paste to/from the system clipboard.
> This should be covered in the vimtutorial, run vimtutor if you have not
> done so yet.
Also, depending on which term you are using (this works in
gnome-terminal & konsole), you can select the text & then use
ctrl-shift-c to copy & ctrl-shift-p to paste if you get really stuck
and/or confused initially. And that works across all consoles you have
open, local & remote.
> On Thu, Nov 8, 2012 at 6:05 PM, Karthick Gururaj
> <karthick.guru...@gmail.com <mailto:karthick.guru...@gmail.com>> wrote:
> On Thu, Nov 8, 2012 at 4:53 PM, vicky b <vickyb2...@gmail.com
> <mailto:vickyb2...@gmail.com>> wrote:
> I have started to learn vim in this modern enviroment where
> gui takes prefers , one thing that still me back to other
> editors is the ease with which we can copy and paste , can
> anybody help me out with safe effect in vim or any thing of
> that sort
> If you are using gvim, you have the option of clicking on "Edit"
> -> "Copy" and "Edit" -> "Paste". You need to select some text
> first obviously, before copy. Selection can be done with mouse.
> Using CTRL-C and CTRL-V might also work for copy/paste - whether
> it does work or not depends on a few factors.
> It that the answer you were looking for?
> Also, if GUI is what you want to work with, vim may not be worth
> looking at. Just my opinion.
-- But masters, remember that I am an ass.
Though it be not written down,
yet forget not that I am an ass.
On Thu, Nov 8, 2012 at 6:23 AM, vicky b <vickyb2...@gmail.com> wrote:
> I have started to learn vim in this modern enviroment where gui takes
> prefers , one thing that still me back to other editors is the ease with
> which we can copy and paste , can anybody help me out with safe effect in
> vim or any thing of that sort
Here is a cool feature that some Linux users don't know about.
Linux has the ability to copy without using a copy command. Simply
high lite the text you want and then place the curse where you want to
paste that text and just click the middle mouse button. This is
available system wide on Linux maybe Mac too but no at all on windows.
In gVim you have to be in insert mode for it to work coming from
another app to gVim. Inside gVim from one place to another you can be
in command mode and do it. This will work in Vim in the terminal too.
vicky b <vickyb2...@gmail.com> wrote:
> no i dont want to use GUI , i want to use vim not gvim how can copy and
> paste with ease in vim
if you're interested in copying and pasting within Vim itself, you can use the
register yanking/deleting/pasting commands, like y, d, c, p and P. If you're
interested in copying to the system buffer, you can prefix these commands with
"+ (double-quotes-plus) or "* (double-quotes-asterisk). For more information,
read ":help change.txt" in Vim (without the quotes).
> On Thu, Nov 8, 2012 at 6:05 PM, Karthick Gururaj <karthick.guru...@gmail.com
> > wrote:
> > On Thu, Nov 8, 2012 at 4:53 PM, vicky b <vickyb2...@gmail.com> wrote:
> >> I have started to learn vim in this modern enviroment where gui takes
> >> prefers , one thing that still me back to other editors is the ease with
> >> which we can copy and paste , can anybody help me out with safe effect in
> >> vim or any thing of that sort
> > If you are using gvim, you have the option of clicking on "Edit" -> "Copy"
> > and "Edit" -> "Paste". You need to select some text first obviously, before
> > copy. Selection can be done with mouse. Using CTRL-C and CTRL-V might also
> > work for copy/paste - whether it does work or not depends on a few factors.
> > It that the answer you were looking for?
> > Also, if GUI is what you want to work with, vim may not be worth looking
> > at. Just my opinion.
> > --
> > 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
> Linux has the ability to copy without using a copy command. Simply
> high lite the text you want and then place the curse where you want to
> paste that text and just click the middle mouse button. This is
> available system wide on Linux maybe Mac too but no at all on windows.
That actually works on my Windows gvim: In normal mode: highlight some text, move mouse to some place and press middle button: stuff that was highlighted gets pasted.
Also, highlight some text in normal mode, hit "<esc>", go to some other place (perhaps using ijkl keys), hit "p" (to put the highlighted text at current location).
> I have started to learn vim in this modern enviroment where gui
> takes prefers , one thing that still me back to other editors is
> the ease with which we can copy and paste , can anybody help me
> out with safe effect in vim or any thing of that sort
As others have mentioned, you might want to go through the vimtutor
that is available when vim is installed.
However, it's helpful to know that the "y"ank, "d"elete, "c"hange,
and "s"ubstitute commands all alter the contents of "registers".
The p/P commands are used to paste contents of those registers in
Normal mode, and (as mentioned elsewhere, control+R can be used to
insert register contents in Insert mode). These are lots of
registers in vim, unlike Windows and Mac, where you usually only
have one system clipboard. By default Vim operates on the unnamed
register, so when you yank/delete/change/substitute, it puts the
thing in this scratch register. By default when you paste, it uses
this register. However, you can prefix the
yank/delete/change/substitute/paste commands by naming the register
you want to operate on, such as
"by3w
will yank 3 words into the "b" register, then
"bp
will paste the contents of the "b" register at some other location.
You can list the contents of registers with the
:reg
command. There are registers for filenames, expression evaluation,
most recent deletions, most recent yank, etc. If you want to
interchange with other applications, you may be interested in the
"system clipboard" register (or the "selection" register, if you're
running on X/Linux/BSD) which is effectively what other applications
will refer to as *the* clipboard. You *can* set 'clipboard' to
include "unnamed" as one of its options, but after trying it for an
afternoon, I found it drove me absolutely bonkers and I turned it
right back off.
> > Linux has the ability to copy without using a copy command. Simply
> > high lite the text you want and then place the curse where you want to
> > paste that text and just click the middle mouse button. This is
> > available system wide on Linux maybe Mac too but no at all on windows.
> That actually works on my Windows gvim: In normal mode: highlight
> some text, move mouse to some place and press middle button: stuff
> that was highlighted gets pasted.
> Also, highlight some text in normal mode, hit "<esc>", go to some
> other place (perhaps using ijkl keys), hit "p" (to put the
> highlighted text at current location).
Yes, this does work very well.
With a version of vim that has +clipboard, +X11 and +xterm_clipboard
features and a ~/.vimrc that has
set mouse=a
set clipboard^=unnamed
you can copy and paste between different instances of vim, gvim and
other applications running in Windows or in X11 on Linux using any
of the techniques discussed here, including the traditional X11
left-click-to-copy, middle-click-to-paste, in normal and insert
modes.
One thing to be careful of: some Linux distributions build separate
binaries for vim and gvim and their vim build does not include
support for X11 or the clipboard. So make sure you are using a vim
with that support. A workaround for this is to use "gvim -v". This
will execute the gvim binary, giving you X11 support, but as a
terminal application, i.e. just like "vim".
Having said all that, I will agree with Tim that including "unnamed"
in 'clipboard' may not be what you want. The advantage is that
everything you select goes to the clipboard. The disadvantage is
that everything you select goes to the clipboard. The result is
that it either "just works" or drives you nuts, depending on your
expectations.