Copy and Paste to/from Vim from/to Other Programs!

#linux, #linuxapp, #linuxsoftware, #linuxprograms, #linuxgame, #datsfreeinfo






https://lukesmith.xyz.

Loading…

READ  Linux Gaming #1 - X-Plane 11

41 thoughts on “Copy and Paste to/from Vim from/to Other Programs!

  • August 30, 2018 at 5:43 pm
    Permalink

    It's also worth mentioning you can use the "* to access the register corresponding to the primary selection (i.e. the selection you can paste with middle mouse button and set by selecting text).

    Reply
  • August 30, 2018 at 5:43 pm
    Permalink

    Where have you been my entire life?
    This channel man. This channel right here.
    Damn, it's so good.

    Reply
  • August 30, 2018 at 5:43 pm
    Permalink

    When I use 'vim' straight from terminal. I have almost all the features including copy and pasting to and fro vim and other programs.

    But it doesn't work when I get into vim from 'ranger'. Can someone help?

    Reply
  • August 30, 2018 at 5:43 pm
    Permalink

    Why do you mark the whole line and yank it afterwards? Use "Y" instead of this … or with registers: "aY

    BTW: I'm using :set clipboard=unnamedplus to copy stuff the the x11 clipboard and insert from it. Works pretty well for me.

    Reply
  • August 30, 2018 at 5:43 pm
    Permalink

    This is a good tip. I am using the terminal that I don’t like that much, but that has the shortcut shift control V, so when I need to copy and paste into vim I just press insert and the shortcut. Sometimes also as a workaround inside i3 I would have only one window with vim on split mode instead of having two windows neatly placed. Thanks, it’s much easier now.

    Reply
  • August 30, 2018 at 5:43 pm
    Permalink

    i'm pretty sure if you map control+v to 'paste' you will lose the ability to use "—visual block—-" mode not sure tho maybe im just a noob

    Reply
  • August 30, 2018 at 5:43 pm
    Permalink

    Also Luke, I noticed on some new larbs installs that zathura pdf is replacing mupdf in a lot of places. Is this part of Larbs 2.0? Will you have a video on zathura pdf?

    Reply
  • August 30, 2018 at 5:43 pm
    Permalink

    Would you consider a video on regular expressions and implementing them in bash scripts? Whenever I'm actually scripting I seem to go brain dead

    Reply
  • August 30, 2018 at 5:43 pm
    Permalink

    Wow! CTRL SHIFT + y in vim to copy and CTRL SHIFT + p to paste into another program. Wow! I have always hated the fact that I cannot do that. Now I can! That is tremendous! Thank you so much for that info! I would usually open up another editor to do that like say, for example, gedit or featherpad or kate or some such. Being able to do that with vim is outstanding! Thank you do much for this information. I so mean that. Thank you!

    Reply
  • August 30, 2018 at 5:43 pm
    Permalink

    Great Video! I have a question tho: I am currently working on a HPC running CentOS 7.3 . A takst i have to do quite often is to copy something from the terminal and paste it in Vim. For example the output of the "pwd" command. At the moment i highlight the text with the mouse, which paste it to the clipboard i guess, and than i paste it in vim by right clicking the mouse in insert mode. IF i highlight text in the terminal ( wich copys it to clip) and type "+p in Vim i get nothing. If i tyoe :reg i dont see the copied text in any register… but i can paste it by right clicking the mouse. Any help would be appreciated!

    Reply
  • August 30, 2018 at 5:43 pm
    Permalink

    This doesn't work for me in Void, so I installed vim-x11, as suggested by a commenter.

    Reply
  • August 30, 2018 at 5:43 pm
    Permalink

    Why aren't you using ed?
    ?
    x
    ?
    x
    ?
    quit
    ?
    leave
    ?
    help
    ?
    ?
    ?
    vi
    ?
    emacs-nox
    ?
    q

    Reply
  • August 30, 2018 at 5:43 pm
    Permalink

    3:15 "So I'm gonna close out of this and then I'll be right back"

    "Okay so I've showered and I still feel dirty so I'll just end this video now."

    Reply
  • August 30, 2018 at 5:43 pm
    Permalink

    I'm too lazy to even rebind "+p/y in my vimrc, so I just enter insert mode and use st's built in ctrl+shift+c/v. I also have tmux to select text from my terminal buffer with the keyboard so I don't have to use the mouse.

    Reply
  • August 30, 2018 at 5:43 pm
    Permalink

    i CTRL ^ V
    or "+vimcomand
    Also i use neovim
    which have it by default ^

    Reply
  • August 30, 2018 at 5:43 pm
    Permalink

    Couple of comments:

    1. Vim keeps your last 9 deletions in the registers from 1-9, with each subsequent deletion going to reg 1 and the other moving down (9 goes away).

    2. Vim has the _ register, which stores nothing; it's like /dev/null. If you REALLY want to delete something, "_d will get rid forever.

    3. You can paste stuff from within the Insert mode with <C-R>*register char*, e.g. <C-R>+ for system clipboard. I don't believe it formats it, so better use for text of a single line or less.

    4. The selection copy-paste is a feature of the X system, so I'm guessing it would also be found on BSD and proprietary UNIXes that use it as well.

    5. For those on NixOS, to get gvim you need to put vimHugeX in your configuration.nix or from the command line via nix-env. Looking at the GuixSD docs, you might need vim-full (although if probably there are emacs users in any case).

    Reply
  • August 30, 2018 at 5:43 pm
    Permalink

    I just put "set clipboard=unnamedplus" in my vimrc which will share the clipboard with the system.

    Reply
  • August 30, 2018 at 5:43 pm
    Permalink

    Did you mention that you can look up your registers with ":reg" ? Pretty neat! 😀

    Reply
  • August 30, 2018 at 5:43 pm
    Permalink

    "+y and "+p with visual mode obviously, but isn't this video incomplete without a yank from regular vim's normal mode? Something like "+y4j?

    Reply
  • August 30, 2018 at 5:43 pm
    Permalink

    I just got an X220 with Arch, I'm getting closer. My desktop has Gentoo :3

    Reply
  • August 30, 2018 at 5:43 pm
    Permalink

    oh my god why didnt u make this video last year i remember spending an entire day on stack exchange to find this like a retarded brainlet

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Este sitio web utiliza cookies para que usted tenga la mejor experiencia de usuario. Si continúa navegando está dando su consentimiento para la aceptación de las mencionadas cookies y la aceptación de nuestra política de cookies, pinche el enlace para mayor información.plugin cookies

ACEPTAR
Aviso de cookies

Apóyanos con un me gusta