no write since last change,add ! to override!
But I want to open another file instead of quit the vim!
I tried :o anotherfile I get the warning : no write since last change,add ! to override! so I tried :o! anotherfile It didn't work But I just don't want to :q! It will quit vim and then I must enter vim again. |
You can save the changes first and then open another one:
Code:
:w |
You can open vim with the names of the two files.
:buffers will list the buffers :files will list the files You can also split the window into two and start another buffer. :split :next file2 Enter ":set hidden" to enable hidden buffers. Now you can go from one buffer to another without needing to save first: :set hidden :bN (buffer next) :bp (previous buffer) :b3 (buffer #1) You can start editing one file. Enter ":hidden" and then ":n file2". Now you can switch between the two buffers, without needing to write the displayed buffer. >vim file1 :set hidden :n file2 :bp (display previous buffer) :bN (dispaly next buffer :b2 (display buffer #2) :b1 (display buffer #1) |
You can put multiple commands on the same line by seperating with the '|' symbol, eg.:
Code:
:sav | e ~/somefile |
Than you!
|
All times are GMT -5. The time now is 06:37 PM. |