I have set VIM as the default editor in the Terminal.
I changed the ~/.bashrc:
export VISUAL=vim export EDITOR="$VISUAL"
You can also set the default editor only for git:
git config --global core.editor "vim"
So far so good.
When I open VIM on its own, it opens in the Terminal frame. When I make a git commit, it pops up inside the same Terminal window I am in, which is good.
Now to the problem. I am a beginner at VIM and I follow what is the command for "Select All" in vim and VsVim?. I cannot right-click and copy after selecting all (
ggVG), it is the normal Terminal menu that pops up, and VIM likely does not have any such menu anyway.
With VIM shortcuts, it does not work either.
Cdoes not work.
- When I press
yto "yank" (which is also not a clear copy command from a beginner's perspective...) the text loses the selection again, but the clipboard is still unchanged.
- Yet, when I mark text in Visual mode "V" or in Insertion mode "I" with the mouse, then of course just the text that I can see on the screen without any scrolling, I can copy (using the right-click menu of the terminal again):
If I mark all with the command from the link above and then shrink this line by line with the
Page Upkey until I have only a one-pager, I still do not get a working
Copysymbol in any step - also not when I reach the one-pager. Copying is only possible with text that can be seen in the window.
I can also press
vand just select something that can be seen on the screen and press
yto copy, works fine. But I cannot go over the screen border and do the same. As soon as scrolling is needed, or as soon I go to the end of the file, I cannot use
yanymore. I have shown this to another user of VIM and he was also surprised, proving that I have not just misunderstood something here.
How can I ungrey this terminal "Copy" button in the right-click menu when all of the text is selected? Or which VIM shortcut can still copy when the "Copy" symbol of the right-click menu is greyed out?
Since I did not want to risk the file content that I had in a Docker container only with some hour of work in it, I decided to copy and paste, step by step, a larger code file before trying even "y" for yank or more shortcuts. With research and this question here I lost half an hour only to try copying my work. Is this murphy's law in action or just a beginner's stupidity so that only I have this problem?