4
1
Lets say I log in to bash, open a file in vi, then using alt-f2 I open a new terminal. After logging in I navigate to a second file and open that in vi. How can I CnP between these two files?
I found this from wikia.com. I'm not familiar with this command shift-8-y-y. I follow the vimtutor and use virtual mode. I tried this sequence and was unsuccessful.
And, I read this about registers. I found a mention of using double_quote-p to 'put' or paste the register, but this does not work in a different file. The second file reported the register empty.
Alternatively, I read in the VIM docs, it is possible to open multiple files under split screens. This may be a course to a solution. The need I often encounter has me navigating in a different bash window to find a file, then wishing to copy between the two. Whereas, I imagine, a split VIM window useful for files in the same directory.
I think the two sessions would have to be in the same terminal to use copy and past in vi. You can try an experiment where you have two terminals open, use yy to copy a line into a buffer and see that pasting in each window results in the content that was yanked in that window. You could of course use the windowing enviroment to copy and paste (say CNTL-C and CNTL-V and that would work if you put vi into its correct mode before the pasting). – Peter Grill – 2011-06-15T22:19:56.403
FYI, you don't really "log into bash", and there is no such thing as a "bash window". Do you mean Linux console? – Keith – 2011-06-15T23:29:48.577
(>_<) Linux console sounds good. And, to "open a new console" and "I have multiple consoles open." would also be correct terminology? Is console synonymous with terminal? To me, ANYTHING which displays on a monitor is generically a window. ehehe. – xtian – 2011-06-16T00:41:19.750
Consoles and terminals are not synonymous in the Unix/Linux worlds. You're talking about Linux "virtual terminals". – JdeBP – 2011-06-16T09:38:32.453