VMware Cloud Community
Terri_Garcia
Contributor
Contributor
Jump to solution

using shell to edit a file with vi editor cannot paste text from notepad

I was asked by support to create a new log file and given the text content to add to the file.  I have no problem cutting commands from my email and then pasting them in shell but when I use vi editor in insert mode it will not work.  when I try to right click it does not do anything, when I use  cntrl V it puts it in to some insert visual  mode.  Anyone have a solution or has run in to the same thing.  I am using putty to ssh to the vcenter appliance.  I am running 7.0.3.0600 (7.3.g)

 

I have tried creating a brand new notepad file so that nothing from the webpage would be hidden in my text when I am pasting it also. 

Labels (1)
Reply
0 Kudos
1 Solution

Accepted Solutions
a_p_
Leadership
Leadership
Jump to solution

From https://docs.vmware.com/en/VMware-vSphere/7.0/rn/vsphere-vcenter-server-70u3d-release-notes.html

~snip~
If you use the vi text editor on a vCenter Server Appliance instance, you cannot paste previously copied content by right clicking. Instead, the vi editor changes mode to Visual.

Workaround: From the vCenter Server Appliance shell, run the command/usr/bin/sed -i.bak -E '2alet skip_defaults_vim=1' /etc/vimrc
~snip~

André

View solution in original post

Reply
0 Kudos
5 Replies
a_p_
Leadership
Leadership
Jump to solution

From https://docs.vmware.com/en/VMware-vSphere/7.0/rn/vsphere-vcenter-server-70u3d-release-notes.html

~snip~
If you use the vi text editor on a vCenter Server Appliance instance, you cannot paste previously copied content by right clicking. Instead, the vi editor changes mode to Visual.

Workaround: From the vCenter Server Appliance shell, run the command/usr/bin/sed -i.bak -E '2alet skip_defaults_vim=1' /etc/vimrc
~snip~

André

Reply
0 Kudos
Terri_Garcia
Contributor
Contributor
Jump to solution

this will enable me to paste or what will this command accomplish ?

Reply
0 Kudos
a_p_
Leadership
Leadership
Jump to solution

Yes, the command will reconfigure the vi editor from visual mode to "normal" mode, so that pasting content will work again.

André

Reply
0 Kudos
Terri_Garcia
Contributor
Contributor
Jump to solution

Thank you ! This worked for me!

Reply
0 Kudos
Terri_Garcia
Contributor
Contributor
Jump to solution

yes this worked

Reply
0 Kudos