On Sat, Jul 06, 2019 at 10:44:26AM +0200, Mathieu Roux wrote:
> Ah yes, that is right.
> Thank you very much.
>
> In fact, i want to edit several files with vim, say titi and toto.
> And then, i want to close titi and not toto, so that i can open titi in
> another terminal. In fact, if i try to work with titi in another
> terminal (with vi), it is said:
>
>
> "E325: ATTENTION
> Trouvé un fichier d'échange nommé ".titi.swp"
> propriété de : m daté : Sat Jul 6 10:43:30 2019"
>
> because it is already open...
when you open a second file with `e: <filename>', vim opens a new buffer
with the file in it.
you can list te opened files with `:ls', the file marked with % is de
one that is visible. to switch between files you can hit `:bnext' or
<ctrl>-^ to toggle between files. if `<leader> b' is set in your vimrc
(don't know, maybe it is default) you can see the list and switch by
choosing the other file.
when you want to open a file for a second time in another terminal
window, it warns you that the file is already opened -- the .swp
swap-file. editing a file that is already being edited can corrupt your
content. with `:bd' you can close a buffer the right way and the .swp
file belonging to it will be destroyed automatically.
basically there is no really a need to open a second terminal window
with a new instance of vim. keeping all together and switching buffers
permits copy-paste etc between files in a much easier way.
seeing two different files in one terminal window can be done with the
`:split' command
//meine