Vi ctrl+a ctrl+c

Hi,
newbie question

I want to select all the text in vi.
The equivalent of ctrl+a
and then be able to copy it and paste it into a graphical editor like kate under kde.

I searched and found nothing...

thanks!

5 answers

  1. For me, the simplest thing is to use cat.
    1
    1. Hello, in my opinion, you will find what you're looking for at: tnerual.eriogerg.free.fr/vimqrc.pdf
      0
      1. Contributor
        Hello,

        To my knowledge, "vi," in its terminal application version under Linux, does not share its clipboard with applications under X.

        However, you can copy and paste what appears in an xterm window by selecting with the mouse, keeping it selected in that xterm window, and clicking the middle button on your three-button mouse in your other application (or using the scroll wheel, or simultaneously clicking the left and right buttons of the mouse in the absence of a middle button).

        This only allows you to copy the visible part.

        If you really want everything, the simplest thing is to open the text file in your graphical editor.

        That said, the link from "coucou_c_julien" is a goldmine of information on "vi," in a compact form that is useful to have handy.

        Dal
        0
        1. Moderator
          I think you can use gvim for this kind of manipulation... Otherwise with the mouse as Dal suggests (copy = selection, paste with the middle click/with the scroll wheel)

          Good luck
          0
          1. Moderator
            Otherwise, you have mouse support with the option set mouse=a
            http://doc.ubuntu-fr.org/vim#vim_supporte_les_souris

            You need to install gpm beforehand, for example on ubuntu by typing:

            sudo apt-get update sudo apt-get upgrade sudo apt-get install gpm


            Then configure your vimrc:

            echo "set mouse=a" >> ~/.vimrc


            You also have graphical interfaces that embed vim like gvim.
            0