cancel
Showing results for 
Search instead for 
Did you mean: 
nuri
Mission Specialist
Mission Specialist
  • 4,672 Views

Copy tex into yaml

Jump to solution
Have you ever encountered issues when copying text from a learning page into a Vim YAML file, where the content gets changed or scattered in different places? If so, what methods have you tried to fix this problem?
Labels (1)
1 Solution

Accepted Solutions
Travis
Moderator
Moderator
  • 4,646 Views

@nuri -

It all depends on what you are copying from and how you are pasting. The PDF often has hidden characters or can do things messing up the spacing. If you are "unsure", as suggested in the other solution by @Juraj_Šintál copy and paste in a local text editor first and see what it looks like.

In terms of the lab environment (assuming you are using RHLS) there are all kinds of potential issues with Copy/Paste. First, you are going through Guacamole and VNC, so that can causes some issues and pain. There is the "Enable Host Paste" option which is disabled that you must enable, but that can sometimes work great or very poorly depending on your OS and browser. The other option is the "T" where it brings you up a copy/paste to transfer clipboard contents, but it "retypes" in the window. Sometimes, if there is latency in the connection, it can drop or repeat characters.

Then, the other issue you have is with the editor. I mainly use VIM and when I teach the course I provide VIMRC recommendations to students. Sometimes when pasting in VIM and "auto-indent" is enabled, it can cause paste to continually indent and everything pasted is at an angle, so you might need to do a :setpaste or something.

If you are talking about the RH294, we now support the Web Console (WebApp) button which will launch a console to the workstation that is text only. It also allows you to transfer files from your local system into the workstation system (upload/download). This can be useful as you can use your local editor (think VSCode with extensions or something). This will greatly assist with formatting and eliminating some of the copy/paste errors from VNC.

Finally, if you really like the VNC console, there is nothing stopping you from opening the book (HTML) version from RHLS within the workstation Firefox. Then the copy/paste will be local to the VM and you don't need to worry about anything related to VNC or pasting over the network because you are pasting between windows/applications on the same system.

Hope that helps.

Travis Michette, RHCA XIII
https://rhtapps.redhat.com/verify?certId=111-134-086
SENIOR TECHNICAL INSTRUCTOR / CERTIFIED INSTRUCTOR AND EXAMINER
Red Hat Certification + Training

View solution in original post

6 Replies
Juraj_Šintál
Mission Specialist
Mission Specialist
  • 4,657 Views

hello,
no, but if happened, try copy and paste the code into text editor (sublime text, notepad++ ... ) first, and then into your vim. 

0 Kudos
Travis
Moderator
Moderator
  • 4,647 Views

@nuri -

It all depends on what you are copying from and how you are pasting. The PDF often has hidden characters or can do things messing up the spacing. If you are "unsure", as suggested in the other solution by @Juraj_Šintál copy and paste in a local text editor first and see what it looks like.

In terms of the lab environment (assuming you are using RHLS) there are all kinds of potential issues with Copy/Paste. First, you are going through Guacamole and VNC, so that can causes some issues and pain. There is the "Enable Host Paste" option which is disabled that you must enable, but that can sometimes work great or very poorly depending on your OS and browser. The other option is the "T" where it brings you up a copy/paste to transfer clipboard contents, but it "retypes" in the window. Sometimes, if there is latency in the connection, it can drop or repeat characters.

Then, the other issue you have is with the editor. I mainly use VIM and when I teach the course I provide VIMRC recommendations to students. Sometimes when pasting in VIM and "auto-indent" is enabled, it can cause paste to continually indent and everything pasted is at an angle, so you might need to do a :setpaste or something.

If you are talking about the RH294, we now support the Web Console (WebApp) button which will launch a console to the workstation that is text only. It also allows you to transfer files from your local system into the workstation system (upload/download). This can be useful as you can use your local editor (think VSCode with extensions or something). This will greatly assist with formatting and eliminating some of the copy/paste errors from VNC.

Finally, if you really like the VNC console, there is nothing stopping you from opening the book (HTML) version from RHLS within the workstation Firefox. Then the copy/paste will be local to the VM and you don't need to worry about anything related to VNC or pasting over the network because you are pasting between windows/applications on the same system.

Hope that helps.

Travis Michette, RHCA XIII
https://rhtapps.redhat.com/verify?certId=111-134-086
SENIOR TECHNICAL INSTRUCTOR / CERTIFIED INSTRUCTOR AND EXAMINER
Red Hat Certification + Training
Trevor
Commander Commander
Commander
  • 4,635 Views

Travis -

Another extra base hit!!!

Trevor "Red Hat Evangelist" Chandler
0 Kudos
Chetan_Tiwary_
Community Manager
Community Manager
  • 4,602 Views

So,  +1 to what @Travis mentioned. 

To turn off autoindent when you paste code in vim mode :

press esc then  :set paste

then press i ( to insert mode ) -  Notice the “- -  INSERT (paste) - -” at the bottom of the Vim window.

Chetan_Tiwary__0-1695569994288.png

 

then paste the yaml code.

It should save our lives !

Eddie7
Cadet
Cadet
  • 92 Views

still havig issues, are we allowed to remote into the workstation vm from out side the env with a ssh setup example ssh student@xxx??

 

0 Kudos
Travis
Moderator
Moderator
  • 75 Views

The RHLS environment does not support remote access into the VMs via SSH. One option that might allow easier copy/paste is the classroom web terminal application. It is a button available above your lab environment consoles in the upper-half of the lab environment tab.

It will be either a Jupyter Notebook or in our newer courses the Web Terminal. It is accessible with the Classroom Webapp and clicking "Access Classroom Webapp" button.

Screenshot 2025-10-01 at 11.57.34 AM.png

 This will launch a separate browser tab that allows you to edit files or even transfer files directly from your machine to the workstation machine. Additionally, copy/paste is easier. One thing to keep in mind for copy/paste is sometimes in VIM (especially with YAML) you might need to turn on/off the set paste as this controls the auto-indentation.

Screenshot 2025-10-01 at 11.59.44 AM.png

 

Travis Michette, RHCA XIII
https://rhtapps.redhat.com/verify?certId=111-134-086
SENIOR TECHNICAL INSTRUCTOR / CERTIFIED INSTRUCTOR AND EXAMINER
Red Hat Certification + Training
Join the discussion
You must log in to join this conversation.