Hi I am trying to quit nano, I don't need to save any changes. I have tried ctrl x and press n for not saving changes but it won't quit. It just switches between saying new file and [ Switched to JAVA_HOME= ] see screen shot
Its OK I fixed it by deleting the bash history
Related
I edited that file and now it shows up each time I open the terminal window. How can I fix that or undo that?
Simply delete the line that says
nano ~/.zshrc
This line opens that screen during startup.
To delete the line, navigate to it first (such that the cursor is pointing to the first letter of the line nano ~/.zshrc.
Then, do the following on your keyboard in order (note that you should press control, not the command button):
Control+K
Control+S
Control+X
Now reopen Terminal and your problem should be solved.
I'm on Windows. After git commit, I entered a message.
Then I tried Ctrl+O to save but it doesn't work (I guess I'm on nano, am I mistaken?).
Nano was added as a choice in 2017 with Git For Windows, because of issue 1224: "Add nano as a choice of editor(s) for git-commit because vim increases what we have to tell to beginners" (!)
But the editor by default remains "vim".
In your case, since you have modified the comment, ESC followed by :x is enough.
If this is nano, commands are Ctrl + X , then Enter (maybe multiple times depending on your conf)
I encounted a problem after I change the syntax of mac's terminal vim. Right now, when I open vim, it just shows up under many line's of my shell command (screenshot below) instead of like before open a clean window and cannot see my shell command. So how can I reset it back that open my vim that in a clean terminal window?
Finally find out that because of the TERM is not set to xterm, so I fixed this issue by adding export TERM=xterm-color in my .bash_profile file. If you have the same issue, hope this would help.
I open bash_profile using the command
nano .bash_profile
To save, I tried ctlr + x, then Y.
then I open the file again, changes are not there?
what am I doing wrong here?
In Nano Control + X exits the program. If you want to save changes to a file you've edited do:
Control + O then Enter followed by
Control + X
This will overwrite the previous file with the changes and then exit.
Recently, Vim started behaving strangely.
Whenever I open a file with Vim in the terminal, I see the line that is normally at the bottom of vim:
"<filename>" [dos] ###L, ###C
But instead of the buffer being displayed above, the screen is blank.
When I press Enter, however, the buffer displays normally.
What did I change to make Vim behave this way when I open files, and how can I change it back?
Here's my .vimrc.
I'm on a Mac, running OS X 10.8, using Vim 7.3.