cancel
Showing results for 
Search instead for 
Did you mean: 
nuri
Mission Specialist
Mission Specialist
  • 2,788 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
  • 2,762 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

4 Replies
Juraj_Šintál
Mission Specialist
Mission Specialist
  • 2,773 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
  • 2,763 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
Starfighter Starfighter
Starfighter
  • 2,751 Views

Travis -

Another extra base hit!!!

Trevor "Red Hat Evangelist" Chandler
0 Kudos
Chetan_Tiwary_
Community Manager
Community Manager
  • 2,718 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 !

Join the discussion
You must log in to join this conversation.