k9s icon indicating copy to clipboard operation
k9s copied to clipboard

Can't use neovim as editor

Open flenoir opened this issue 1 year ago • 5 comments




Describe the bug I tried to edit EDITOR or K9S_EDITOR env var to use neovim as editor but doesn't seems to work

To Reproduce Steps to reproduce the behavior:

  1. add "export EDITOR=nvim" as env variable
  2. restarts k9s

Historical Documents i did also try using K9S_EDITOR without success

Expected behavior i would like to have neovim as editor in k9s instead of classic vim

Screenshots If applicable, add screenshots to help explain your problem.

Versions (please complete the following information):

  • OS: ununtu 24.04
  • K9s:v0.32.4

flenoir avatar Aug 02 '24 12:08 flenoir

I don't think this is a k9s issue. I am an nvim user as well, and cannot reproduce. I use k9s and nvim literally constantly. I didn't land on version 32.4, but I did just upgrade from 32.3 to 32.5 and it still works as well. Is it possible something else is interfering in your env? I've had similar issues and it is almost always on my end.

Daemoen avatar Aug 04 '24 19:08 Daemoen

I just tried and it works as expected for me, I can swap editors by running k9s with the EDITOR flag.

EDITOR=nano k9s
EDITOR=vim k9s
EDITOR=zed k9s

This feels like an issue with your environment.

KevinGimbel avatar Aug 05 '24 07:08 KevinGimbel

The README says that KUBE_EDITOR is the variable to set. So probably try this instead of K9S_EDITOR.

mpas97 avatar Aug 05 '24 17:08 mpas97

@flenoir could you check again with KUBE_EDITOR? If so, does it work and can this issue be closed?

KevinGimbel avatar Aug 12 '24 07:08 KevinGimbel

I think I may know what is going on.

I have an issue when I use EDITOR=vi to edit a deployment. When I try to save-and-exit with ZZ, k9s doesn't pick up the changes made, but when I use a separate save command (:w) before exiting (:q), it does pick up the change.

Hypothesis: k9 checks if the file was modified < editor exit time, but the modification time is equal to the editor exit time, and so doesn't see the file as modified?

mjpieters avatar Aug 19 '24 10:08 mjpieters