vi editor is not responding any command in ksh.
I tried q
, ctrl+c
, :q!
, nothing responded. I have to close connection on secureCrt and re-login.
Does anyone know cause-and solution?
Press Esc to enter Command mode, and then type :wq to write and quit the file. The other, quicker option is to use the keyboard shortcut ZZ to write and quit. To the non-vi initiated, write means save, and quit means exit vi.
From Command Mode :w Write changes to your file. :sh Return to the shell to enter a number of commands without leaving vi. Press <Control>d to return to vi editing.
another way is to press Ctrl + c or ctrl + z command to exit the vi editor forcefully. press ZZ (shift+z+z). it will save and exit.
I will also go through common problems people have with the Vi editor especially the annoying problem when logging into your server using a SSH client such as Putty, where you find that the backspace key doesn’t work or the arrow keys simply return letters.
There are many ways to exit from vi editors, and you can use some of these commands to exit from other editors Press F2, this will drop you in Insert Mode, now press: q and hit enter another way is to press Ctrl + c or ctrl + z command to exit the vi editor forcefully.
The default editor that comes with the UNIX operating system is called vi (visual editor). Using vi editor, we can edit an existing file or create a new file from scratch. we can also use this editor to just read a text file. Modes of Operation in vi editor There are three modes of operation in vi:
Output: Modes of Operation in vi editor There are three modes of operation in vi: Command Mode: When vi starts up, it is in Command Mode. This mode is where vi interprets any characters we type as commands and thus does not display them in the window.
I think you wanted to save the file with CTRL-s
. That's a screen-lock. Use CTRL-q
to unlock and save with :w
.
Did you try ESC-colon-q-bang?
:q!
ESC to get out of insert mode, colon is to enter command mode, 'q' to quit, the bang is to discard any changes. It looks like you may just be missing the colon for command mode.
Check out this post for other ways to exit vi
: https://stackoverflow.com/a/11828573/2543416
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With