K9s 在使用 neovim 时不会应用编辑。

huangapple go评论51阅读模式
英文:

K9s edits are not applied when using neovim

问题

编辑资源的YAML定义时,更改不会在k9s中生效。

我注意到neovim会将我对文件所做的更改保存在/tmp中,但在使用:wq退出后,更改不会在k9s中生效。

当我使用nano等编辑器进行相同操作时,更改会立即生效。

我看到这个答案 对类似问题的回答说,需要应用/tmp/中的文件(使用kubectl apply),这确实有效,但我希望能够像nano的情况一样,保存并立即应用更改。

英文:

When editing the yaml definition of a resource the changes are not applied in k9s.

I see that neovim is saving the changes I made to a file in /tmp but after exiting with :wq the changes are not being applied in k9s.

When I do the same thing with e.g. nano as editor, the changes are being applied immediately.

I saw this answer to a similar question that says the file in /tmp/ would need to be applied (using kubectl apply) which does work but I would like to have a similar experience to the nano case, where the changes are saved and applied immediately.

答案1

得分: 1

这可能是Vim在将缓冲区写入磁盘的过程中重命名文件的情况。

如果是这样,您需要调整:help 'backupcopy'

" 在您的vimrc文件中
set backupcopy=yes
英文:

This is probably a case of Vim renaming the file during the process of writing the buffer to disk.

If so, you need to adjust :help 'backupcopy':

" in your vimrc
set backupcopy=yes

huangapple
  • 本文由 发表于 2023年2月16日 17:02:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/75469896.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定