cancel
Showing results for 
Search instead for 
Did you mean: 
sakshi-80
Mission Specialist
Mission Specialist
  • 4,102 Views

copy and paste yaml file to the linux terminal

Jump to solution

Hi Team, 

When you copy a YAML file from the Openshift documentation to the Linux `vim ` file, the indentation of the file changes, and lot of time is spent to indent the YAML file .

Any suggestions to resolve the issue. Thanks! 

 

2 Solutions

Accepted Solutions
Chetan_Tiwary_
Community Manager
Community Manager
  • 4,066 Views

Hello @sakshi-80 !

Thanks for reaching out !

You might want to refer this thread : https://learn.redhat.com/t5/Containers-DevOps-OpenShift/Copy-tex-into-yaml/m-p/37084/emcs_t/S2h8ZW1h... 

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-1695644468685.png

 

 

then paste the yaml code. See if this helps.

 

 

View solution in original post

sakshi-80
Mission Specialist
Mission Specialist
  • 4,049 Views

Thanks for the prompt reply. `:set paste`  in the `vim` is working 

View solution in original post

5 Replies
justasd
Mission Specialist
Mission Specialist
  • 4,087 Views

Hi,

 

Do you browse docs and copy YAML from your host machine or workstation machine directly from lab environment? I personally copy YAML from docs in workstation machine, paste and modify it in gedit editor and jus then paste it to vim. By doing it this way there is no indentation issues at all.

Chetan_Tiwary_
Community Manager
Community Manager
  • 4,067 Views

Hello @sakshi-80 !

Thanks for reaching out !

You might want to refer this thread : https://learn.redhat.com/t5/Containers-DevOps-OpenShift/Copy-tex-into-yaml/m-p/37084/emcs_t/S2h8ZW1h... 

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-1695644468685.png

 

 

then paste the yaml code. See if this helps.

 

 

IvanLabrovic
Flight Engineer
Flight Engineer
  • 2,797 Views

Thanks! this is helpful for me too.

Chetan_Tiwary_
Community Manager
Community Manager
  • 2,735 Views

glad it helped @IvanLabrovic !

0 Kudos
sakshi-80
Mission Specialist
Mission Specialist
  • 4,050 Views

Thanks for the prompt reply. `:set paste`  in the `vim` is working 

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