Dude this helped SO much. I've been trying to find this stuff out and all I kept getting was "you never need to clipboard things in and out of vim". So many unhelpful posts read, UNTIL now. Not only that, but I also know more about registers and cool pluses of vim. Great video!
@RajivLochanPanda4 жыл бұрын
I read this solution, somewhere on stack overflow, of using '+' register to copy stuff out of vim, without any background on registers in vim, which left me confused. Thank you for making it clear! You're an awesome educator! 🙏
@SArthur2214 жыл бұрын
5:23 C-v is normally block visual select, which i use a ton xD
@Dusta_Rhymes6 жыл бұрын
Luke, you're the gift that keeps on giving. freakin love your vids, wouldn't be able to Linux without them do not stop or i will find you
@finnianquail88816 жыл бұрын
Dusta Rhymes I'd just like to interject for a moment. What you're referring to as Linux, is in fact, GNU/Linux, or as I've recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX. Many computer users run a modified version of the GNU system every day, without realizing it. Through a peculiar turn of events, the version of GNU which is widely used today is often called "Linux", and many of its users are not aware that it is basically the GNU system, developed by the GNU Project. There really is a Linux, and these people are using it, but it is just a part of the system they use. Linux is the kernel: the program in the system that allocates the machine's resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself; it can only function in the context of a complete operating system. Linux is normally used in combination with the GNU operating system: the whole system is basically GNU with Linux added, or GNU/Linux. All the so-called "Linux" distributions are really distributions of GNU/Linux.
@bratezoran21025 жыл бұрын
@@finnianquail8881 WHO THE F CARES I CALL IT LINUX STOP ME
@minhajshovon97894 жыл бұрын
@@finnianquail8881 here comes RMS agent :3
@rogzinho4 жыл бұрын
Obey koomer
@conceptrat4 жыл бұрын
@@finnianquail8881 I hear ya but could it not be Linux+GNU as the kernel is loaded first right? 😬
@djfl58mdlwqlf4 жыл бұрын
not sure why it doesn't work for me.. using ubuntu tried V "+y to yank (from server) and when I do ctrl+v on browser (local pc) it won't work... won't work from local vim to local browser also..
@prahe866 жыл бұрын
You're a great teacher.
@AhmedKhaled-sj1zx6 жыл бұрын
yeah, agree. he explain things easly
@AhmedKhaled-sj1zx6 жыл бұрын
me too
@ayushmishra60773 жыл бұрын
@@AhmedKhaled-sj1zx lol
@DFsdf3443d6 жыл бұрын
ah the era of me closing vim, opening notepad to copy something over, and then reopening vim is finally over. Thank you sir
@chrest1konto296 жыл бұрын
Sabaton ... a man of culture!
@SimpleLangSolution6 жыл бұрын
Where have you been my entire life? This channel man. This channel right here. Damn, it's so good.
@mkd11136 жыл бұрын
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.
@kant8596004 жыл бұрын
After so many tutorials on internet I found this solution on your channel. Thank you soo much man.
@outlierjahd79103 жыл бұрын
me too
@ViniciusProvenzano6 жыл бұрын
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.
@qwertyasdf76156 жыл бұрын
neovim comes with sys clipboard access as well
@xerneastrainer81113 жыл бұрын
Novim comes with bloat as well.
@stv3qbhxjnmmqbw8353 жыл бұрын
@@xerneastrainer8111 I like neovim
@memoryman513 жыл бұрын
The bloat police are on the case!
@alcesmir6 жыл бұрын
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).
@Comrade_Tux2 жыл бұрын
Wow, You not only answered what I searched, but also taught me a lot about copying and pasting inside vim. Thanks.
@4.0.45 жыл бұрын
The editor I use has these keyboard bindings, Ctrl+C and Ctrl+V, I use them a lot.
@wesleyjrz3 жыл бұрын
lol
@tuananhdo18702 жыл бұрын
what is you editor are you using: sublime or vscode?
@kaksisve40122 жыл бұрын
@@tuananhdo1870 Provably ED. :D
@itsmith32 Жыл бұрын
@@tuananhdo1870 Notepad, of course:)))
@jamescritchlow34452 жыл бұрын
the amount of problems this has solved for me is incredible. who knew that all I needed to do to be able to use windows shortcuts was to install gvim. thankyou kind sir you have earned my subscription
@MuhammadUsman-qf7cl2 жыл бұрын
Thanks Luke, for sharing the valuable information in a simple way, I was really confused, on how to do copy and paste through vim but after watching and implementing at the same time, I am amazed that it really works, my life is pretty simple now, I really appreciate your help.
@christbaumer5 жыл бұрын
is used for block visual by default.
@MatheusCopyright6 жыл бұрын
I used ctrl alt c/ctrl alt v or shift insert to copy/paste, its the terminal clipboard, but it always cut the first letters, finally someone explained how to properly use the registers
@-XArchLinuxEnjoyerX-5 жыл бұрын
Hey, I just wanted to let you know that I'm a new subscriber and I absolutely love your linux videos. You explain things in a way that makes understanding complex things easy, and your subjects are stuff I dont think I would have found on my own. Thank you
@macfhlannchadharonan46684 жыл бұрын
note a caveat to this is that when using vim over ssh, which many of us usually do, the system clipboard may not work. It also may not work if vim isnt compiled with system clipboard support. To get around this you can make use of the OSC52 escape sequence when send the data encoded to your terminal emulator which saves it to your clipboard.
@delta-a177 ай бұрын
Could you explain more about this? I know terminal emulators have big long lists of escape sequences buried in their settings but not much more. How does this work?
@HaydonRyan3 ай бұрын
Great straight forward explanation. Personally I have a leader key (space) and then have the same vim bindings as normal - but space put's it in the "space" of my desktop. :)
@GooogleGoglee4 жыл бұрын
Question: How can you move the content / value of a register to a different register??
@tristanfulford55624 жыл бұрын
The line he shows towards the end with :let @+=@* is making the +register equal the same value as the *register
@GooogleGoglee4 жыл бұрын
@@tristanfulford5562 thank you for your answer. So suppose I want to swap the content of the register "a and register "b, how can I do it with one command?
@tristanfulford55624 жыл бұрын
@@GooogleGoglee I'm not sure what you're trying to do but ill assume you want to preserve the data from both, so id do :let @c=@a, :let @a=@b, :let @b=@c. There may well be a command to do that easily but I'm just guessing here There's good resources from Google like vimwiki or you can try :h register if the above doesn't do what you want
@GooogleGoglee4 жыл бұрын
@@tristanfulford5562 thank you Tristan
@pnuema1.6182 жыл бұрын
You're a good man! I have been putting this off for a while but the frustration grew beyond my laziness. Luckily this was an easy solution without much effort.
@janekiii3 жыл бұрын
read a website that teaches me the same syntax but the lack of context is confusing and this video helps me. TY!
@xbz242 жыл бұрын
holy shit. cristal clear like water, thank you dude. FUCK YEAH now I can copy paste from my browser love you dawg
@fernabianer18984 жыл бұрын
Very well made. I'll rewatch this one later and play around with it. Thank you Luke!
@romjan48693 жыл бұрын
in manjaro, you can't install both gvim and vim together. Package manager will tell you " vim and gvim" are in conflict.
@Eliotime30004 жыл бұрын
In GVIM, the contextual menus explains the VIM bindings for cut, copy and paste are shown ("+x for cut, "+y for copy, "+gP for paste) and works in the good ol' VIM.
@yoshi3146 жыл бұрын
it seems that on gentoo vim has the ability by default, if you build it with USE="X", which is likely what 90% of people do.
@ProtoForte6 жыл бұрын
Yeah, and after some googling I found the command: vim --version | grep clipboard which after you run you need to search for "+clipboard" or "+xterm_clipboard", if you have those you can copy and paste to and from the clipboard. vim.wikia.com/wiki/Accessing_the_system_clipboard is what I found after half a minute of searching.
@ReneHoffmann1946 жыл бұрын
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.
@GooogleGoglee4 жыл бұрын
Thanks Question: How can you move the content / value of a register to a different register??
@ThomasCKFuller6 жыл бұрын
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
@Chalisque7 ай бұрын
I have a number of things for a number of use cases. For clipboard access, I have two scripts, pc and pp (for pasteboard copy and pasteboard paste, inspired by the macos commands), which call the relevant clipboard access whether X, Wayland, Macos, Cygwin, or WSL. Then I have a python clipboard server running on my pi3 which has named clipboards I can put to/get from (so e.g. echo hello | aput boing, and then aget boing will recall). This gives me LAN-wide named clipboards. Then another one is similar, cput, (again in Python) which uses a mysql server as its backend, and maintains a history of previously copied text. Another one, dput, uses a PHP backend and has a web interface. In vim, I use pp pc to copy lines to/from the clipboard; and have similar mappings for aget, cget, and dget.
@sdnnvs3 жыл бұрын
Is there any clipboard manager type app for Vim? When copying multiple text fragments, is there any way to check which register (a, b, c, d etc) should be pasted?
@desktorp6 жыл бұрын
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."
@hacerdemirel98334 жыл бұрын
This is what I was looking for by years. Thanks.
@youngun550 Жыл бұрын
What does
@jmisc4 жыл бұрын
Is the Linux option the same as Mac? what will be the key binding for Mac?
@ali-om4uv6 жыл бұрын
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!
@TheEbbemonster2 жыл бұрын
Great explanation! Unfortunately it is a nightmare to get working on WSL :(
@NozomiFurikaeru4 жыл бұрын
How can I add a keybind to the "*y or "+y in my .vimrc? I copy what Luke put in the video but vim doesn't seem to recognize it.
@twerkingduck12755 жыл бұрын
My +/* registers weren't working because I didn't have -clipboard and -xterm_clipboard supported, so I found out that installing the vim-gtk package fixed it.
@1052rajan2 жыл бұрын
Hey dude, this is not working for me as I am running Ubuntu through VBox. Unable to copy from a text file to Vim. NOTE: I have installed Guest additions on it to share the clipboard between Win11 and Ubuntu. Vim is unable to access the clipboard I guess.
@anupamaiyengar2559 Жыл бұрын
How to copy large vim files or multiple pages from vim to a notepad or notes app
@SandeepSharma-ig9gw2 жыл бұрын
Is there a way to yank text from remote server to local win10 without using mouse? I tried above and it works locally on mac but when i ssh to remote server it does not work.
@jerodburnett36806 жыл бұрын
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
@conceptrat4 жыл бұрын
That's what happens when you Bash your Head with a |, Fsck 😀
@idle_fish_by_the_shore4 жыл бұрын
watch data wrangling missing semesters
@spellman3809 Жыл бұрын
What icon font you use in your bar?
@erickperes04952 ай бұрын
Teacher, I can't paste values from external source of vim to vim. Why? Addtional Information: I am doing that in a Debian server through SSH.
@grantbarthelmes1950 Жыл бұрын
One of the many heros of the internet
@TheHelvetican4 жыл бұрын
When running vim on an external server, will the "+y command copy to the local or the server clipboard? I haven't tried it yet, but my intuition yes me it will use the server clipboard, so it still couldn't be used to paste into my local Firefox. To get around this, I have simply enabled ctl-c and ctl-v in my Terminator preferences. It isn't minimal but I haven't had any issues. I can simply highlight anything on the terminal with the mouse and copy and paste like normal.
@mrchuz05 жыл бұрын
Which is the markdown language are you using?
@honduwave6 жыл бұрын
This doesn't work for me in Void, so I installed vim-x11, as suggested by a commenter.
@TechnoBoomer5 жыл бұрын
Hello Luke. Thanks for this video but the trick does not seem to work on my machine (Fedora 30 + vim 8.1.1359)...
@diegocastillo64705 жыл бұрын
Just out of instinct I tried issuing "gvim" and when apt said to me that I could install it by installing vim, vim-gtk and other, I was like "Where's gvim?"... Anyway, I installed vim-gtk3 and it includes gvim, now I have acces to the + register. Excelent video
@AbhinavKumarJha-j4x3 ай бұрын
V"+y not working in my vim editor, have gvim installed
@VoylinsLife3 жыл бұрын
This explanation was so helpful, I recently started using vim and loving it so far but I couldn't figure out for the life of me how to make this work ^^"
@ezeth85766 жыл бұрын
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?
@JohnInnocentSmyth4 ай бұрын
does neovim have this by default or do i still need to get gvim inaddition?
@Chalisque7 ай бұрын
If you're on X11, one choice is xsel. For Wayland, wl-paste. For cygwin you write to or read from /dev/clipboard. For macos there is pbcopy and pbpaste. (So I have as I mentioned earlier, two scripts pp and pc which choose the appropriate way to deal with the clipboard.)
@MM-doremifaso5 жыл бұрын
I like your music, sabaton forever! 🤘
@jordanmoravenov11 ай бұрын
Thank you! Everything I needed I learned in this video.
@gjermundification6 жыл бұрын
"+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?
@pacogarcia39115 жыл бұрын
What is the key bindings streaming tool guys please ??? thkx !
@CyberDruga3 жыл бұрын
well, i just put this on my vimrc: set clipboard=unnamedplus now every yank/cut/replace goes directly to the system clipboard
@jean-kevin12643 жыл бұрын
omg thank you so much!!!!!!
@loveleshsinghsisodiya5960 Жыл бұрын
Can you please explain to me this I am not getting it
@CyberDruga Жыл бұрын
@@loveleshsinghsisodiya5960 certainly. "unnamedplus" is your system clipboard. :set clipboard=unnamedplus means that everything you copy/delete will go to your system clipboard. It's the same as "+y for every copy, and "+d for every deletion, but without typing "+ at the start.
@morgansippel20575 жыл бұрын
thank you so much, its quite funny I just racked my brain for a good hour trying to figure out how to copy and paste in and out of vim, your tutorial was great but from what I understand Im not the only person struggling with gnome desktop, I think Ill have to use gvim, thanks
@kenny1161166 жыл бұрын
In Fedora, I had to install gvim and use add "alias vim='gvim -v' " in my .bashrc.
@khai-chuongtrinh14296 жыл бұрын
what if your vim doesn't have +clipboard or +xterm_clipboard enabled? I have macvim installed from .dmg file. I searched and seems like one would need to re-install using homebrew to get this functionality. Do you know of another way to enable the clipboard functionality?
@ThreelionsSFIV4 жыл бұрын
In linux you can use xclip/xsel to emulate clipboard yank/paste. search for similar solution for Mac.
@RobertCastilloC2 жыл бұрын
What means "vnore" why the Ctrl+V just have "map"
@miguelangelmeditux87852 жыл бұрын
muchas gracias por el video, soy nuevo con Vim y me ha ayudado mucho
@DavidLee-jd5ot Жыл бұрын
lol ctrl+v is visual block ,even i didnt noticed when i was trying to edit a column but ctrl+v kept pasting instead of going visual block mode haha
@binbashbuddy6 жыл бұрын
I was just this morning wanting to copy more than would fit on my terminal from vim this morning into something. Obviously if it's just something that fits on a screen I can use the mouse to copy but when it's more than a screenful I can't. Thanks. Had to install gvim (which actually requires installing vim-gnome, there is no gvim in the repo)
@shadowleague24866 жыл бұрын
Actually you only need vim-runtime, not gvim.
@JS-kr7zy5 жыл бұрын
gvim can't be installed because it conflicts with vim. Rip.
@davidh.49443 жыл бұрын
It wasn't completely clear in the video, but installing the gvim package also provides you with a version of cli vim that has x-clipboard support compiled in. You can safely remove the original.
@fabriziobertoglio73426 жыл бұрын
amazing. I m trying this since 2 years :)
@Klblaz6 жыл бұрын
I didn't know gvim has the clipboard build in. I remember compiling vim from scratch to get clipboard working.
@ThreelionsSFIV4 жыл бұрын
gVim has full X11 working, change fonts on the fly, gtk/gtk3/motif/athena, full mouse x11, more colors, more keys supports that does not depend from terminals like alt/meta, some extra things and of course clipboard too.
@Klblaz4 жыл бұрын
@@ThreelionsSFIV I know that now, I use gvim for pretty much everything, it's much better than TUI vim.
@ibrahimKaraagac6 жыл бұрын
Luke I enjoy your videos and watch every one of. Thank You.
@cscidev10 ай бұрын
Straight to the point. Useful. Liked and subscribed
@slajmlord32114 жыл бұрын
To move the cursor after the paste, I would suggest gp rather than capital p.
@sourabhjain81125 жыл бұрын
Not working on Fedora.
@anirudhrawat75842 жыл бұрын
Thank you for this. Helped a lot.
@kevingrande13243 жыл бұрын
does it work if I have installed neovim?
@Argletrough4 жыл бұрын
NeoVim now allows you to do things the best possible way: Using the system clipboard as the unnamed register: set clipboard+=unnamedplus This behaviour seems quite invasive, but I'll use it for a while and see if I like it.
@markcuello52 жыл бұрын
Wow; `NeoVim`. Never heard of it. Is it a `Wiki`?
@Argletrough2 жыл бұрын
@@markcuello5 It's a fork of Vim that mainly served to make Vim development more active through artificial market competition. The two are mostly the same, but NeoVim is slightly better.
@md.shazidalhasan67262 жыл бұрын
I am using nvim and this is not working.
@ziggyspaz4 жыл бұрын
Thanks for letting me learn something new today
@longlostwraith51066 жыл бұрын
Wouldn't collide with the trigger for visual mode?
@conceptrat4 жыл бұрын
You could use map! instead of map which applies only to insert and command mode “:“. Also someone mentioned that using , that's Ctrl-Shift-v also works. As well as . Although I haven't tested those yet they would make sense as that's the normal way to copy and paste text in the terminal. And finally I'd recommend using “+P instead of “+p as Like mentioned as it follows what most of us are used to when pasting.
@Dangnguyenhai1412134 жыл бұрын
It's not works with me at all.
@JK-pi6ji4 жыл бұрын
can't really install gvim on a server..
@georgiosroumeliotis43836 жыл бұрын
Why should I learn Vim?
@virgiliomurilloochoa28844 жыл бұрын
hey so this works on windows aswell?
@miika354763 жыл бұрын
Thank you! I love vim, but missing that copy paste thing drove me crazy. :D
@kieuquangtuan10625 жыл бұрын
But gvim conflicts with vim, how can I deal with it?
@imnotblackpinkfanimtheirai53004 жыл бұрын
just uninstall vim and install gvim. bạn có thể dùng vim bình thường mà k cần cài đặt vim vì gvim nó có vim sẵn trong đó rồi
@NaurisMich3 жыл бұрын
lol, :: gvim and vim are in conflict (vim-minimal). Remove vim? [y/N]
@hakety935 жыл бұрын
Hi Luke. Thanks for another great video. I am having issues with the + register being wiped as I exit Vim. I tried "autocmd VimLeave * call system("xsel -ib", getreg('+'))", which should pass the buffer as vim quits, but it doesn't seem to work. Any thoughts on what's going on? I should mention that I am running Ubuntu with X11 I3
@MarioPerez-yi2tw4 жыл бұрын
How to uncomment a line? please
@il22863 жыл бұрын
To paste into vim i usually do :setpaste > i > ctrl + v > :setnopaste And to copy text from vim v > "+y > ctrl + v I don't use gvim, neovim...
@loveleshsinghsisodiya5960 Жыл бұрын
I need help
@jeffraylazo81735 жыл бұрын
(CTRL + V + End) to highlight the entire line of text and (SHIFT + "+y) to copy it in clipboard I'm using Linux by the way. :)
@toby.2a6 жыл бұрын
Hey Luke, love the videos. Why do you have your line numbers set up this way? I don't understand why you might want to know what's 2 lines above or below rather than just viewing line numbers normally. Thanks for the content.
@sflux45934 жыл бұрын
Why not just g? If you know the line number say 100, you can easily go to it by typing "100g"