I know this is more of a general linux question but w/e. So when I enter a program like vim in the command prompt it displays all the text in the file and I can edit it etc. But I can't figure out how to close or save the file and get back to the command prompt without killing the process. Any help is appreciated.
|
|
In vim there are 3 different modes:
To get back to Normal mode, you can always press esc. Once you are at Normal mode Press
|
|||||||||||||
|
|
First, hit the escape key.1 Then just type Alternately, you can type If you've made edits, and you want to discard them and leave, type 1 : This ensures you are in "command" mode. Which you want for typing commands, like those needed to exit. |
||||
|
|
|
Alongside jondavidjohn's answer, here are two links that have indispensable information about using vim.
Finally, there are some like aendruk who simply don't want to use advanced command line text editors. Vim in particular has a steep learning curve, and does actually take some initial effort to get used to. But it's very fast, and very powerful. If you have interest in linux beyond basic desktop usage, it's worth investing time learning a decent command line text editor like Vim or Emacs. If you just need to edit some text and don't care much beyond that, try typing |
|||||||||||
|
|
Much to our inconvenience, there is no general method for exiting command-line programs like there is the "X" button for graphical programs. Many command-line programs follow the theme of using either Q (e.g.
Editors like this are traps for the inexperienced. My personal preference and recommendation is to, when forced to edit text on the command-line, use instead the more self-explanatory Joe's Own Editor (JOE). |
|||||||
|
