vimkubectl icon indicating copy to clipboard operation
vimkubectl copied to clipboard

Feature request: Prettifying of YAML "document here"

Open phmarek opened this issue 1 year ago • 1 comments

Sometimes - one trigger is a space before a newline, but there seem to be others as well - my "document here" in YAML (Dockerfiles, shell scripts, etc.) get "reformatted" into a long string containing \n and other escape sequences.

Like

foo: |
  this is "a"
  text
  # with comments

and after reloading I get

foo: "this is \"a\"\ntext\n# with comments"

Needless to say, this is awful to work with.

So I'd like to ask for a keybinding that reformats the current element to the nice form above.

If Kapply detects trailing whitespace it would be great if it asked whether to remove it, abort, or ignore, as well ; )

phmarek avatar Nov 16 '23 12:11 phmarek

I'm not able to reproduce this. Multiline strings that start with | are being preserved with formatting for me.

Could it be kubectl version again?

Does kubectl get -o yaml ... also return formatted string? That is what the plugin uses when fetching & reloading.

rottencandy avatar Nov 20 '23 17:11 rottencandy