@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.
hello,
no, but if happened, try copy and paste the code into text editor (sublime text, notepad++ ... ) first, and then into your vim.
@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 -
Another extra base hit!!!
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.
then paste the yaml code.
It should save our lives !
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.