-2

I logged into my VPS server via SSH from my remote computer, a macbook pro. I run the command visudo to edit a config file using nano, when I am done editing the file I attempt to exit using control x or ^x (same thing). However instead of prompting me for if I want to save, like I have read, it just says this at the bottom...

--^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)

I can't even exit nano, and when I try other commands like control g nothing happens.

How do I exit nano and save the file?

Thanks

Hurricane Development
  • 2,449
  • 1
  • 19
  • 40

1 Answers1

2

You're not running nano, you're running vim.

Hit Ctrl+Z to put vim in the background and get back to your shell (you can kill vim with kill %1).

Then export EDITOR=nano and visudo again to edit using nano.

(To instead save and exit in Vim, use Esc to exit "^X mode", then press uppercase Z twice to save and exit).

that other guy
  • 116,971
  • 11
  • 170
  • 194
  • Thank you very much, I would like to know however what to do about the down votes I received on this question, I spent about 2 hours researching this and could not figure it out, I feel like it is an honest and well stated question. And now I can't ask more questions either. I would just like some advice from an experienced user such as yourself. – Hurricane Development Jun 27 '14 at 21:35
  • The question itself is very well stated, it's just that stackoverflow.com is meant for programming questions ([superuser.com](http://superuser.com) is the equivalent for software questions, and there's even a [askubuntu.com](http://askubuntu.com/) for Ubuntu specific questions). Whether having multiple sites like this is useful is another matter, but that's how it is. – that other guy Jun 27 '14 at 22:07