Article 56RVH vi, filename extension and indentation

vi, filename extension and indentation

by
berndbausch
from LinuxQuestions.org on (#56RVH)
How can I prevent vi/vim from adding unwanted indentations? The following happens on Ubuntu 16.04 with vim 7.4, and Ubuntu 20.04 with vim 8.1.
gvim on Windows and vim on Fedora 28 work as expected (both are vim 8.1). My conclusion: It has something to do with the vim configuration on Ubuntu.

I have the following YAML file:
Code:apiVersion: v1
kind: ConfigMap
metadata:
name: myconfig
data:
customer: myself
type: databaseI then use vi to open a file named bla.yaml and copy the above text into it. I get unintended indents:
Code:apiVersion: v1
kind: ConfigMap
metadata:
name: myconfig
data:
customer: myself
type: databaseI tried the following settings in vi:
Code::set noai
:syntax off
:filetype off
:filetype indent offNo change.

However, when I edit a file that does not have the yaml extension, the text is pasted as I intend it, i.e. without any additional indentations.

Which vi or vim setting controls this behaviour?latest?d=yIl2AUoC8zA latest?i=oYcHlDrHXqo:795kHydjR_0:F7zBnMy latest?i=oYcHlDrHXqo:795kHydjR_0:V_sGLiP latest?d=qj6IDK7rITs latest?i=oYcHlDrHXqo:795kHydjR_0:gIN9vFwoYcHlDrHXqo
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments