Saturday, July 6, 2019

Re: edit several files

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

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20190706091847.GB929%40trackstand.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment