edit several files

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

edit several files

Mathieu
Good morning,
I can read in help file usr_07.txt, that



"So far you had to start Vim for every file you wanted to edit.  There
is a
simpler way.  To start editing another file, use this command:

        :edit foo.txt

You can use any file name instead of "foo.txt".  Vim will close the
current
file and open the new one.  If the current file has unsaved changes,
however,
Vim displays an error message and does not open the new file:

        E37: No write since last change (use ! to override)"



On my laptop, it is not the same behaviour. The first file remains
open, and vim does not ask me anything to open the second file...

Can you help me?
Best regards,
Mathieu





--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/1531833005552bb4e0ff17bec0497b409a1fcab8.camel%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: edit several files

Paul-7
On Sat, Jul 06, 2019 at 10:08:51AM +0200, Mathieu Roux wrote:
>On my laptop, it is not the same behaviour. The first file remains
>open, and vim does not ask me anything to open the second file...

Your laptop has 'hidden' set. See ":help 'hidden'".

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20190706082834.GA16305%40rainslide.net.
For more options, visit https://groups.google.com/d/optout.

signature.asc (817 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: edit several files

Mathieu
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...






On sam., 2019-07-06 at 09:28 +0100, Paul wrote:
> On Sat, Jul 06, 2019 at 10:08:51AM +0200, Mathieu Roux wrote:
> > On my laptop, it is not the same behaviour. The first file remains
> > open, and vim does not ask me anything to open the second file...
>
> Your laptop has 'hidden' set. See ":help 'hidden'".
>
> --

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/63d85812cfa6d8362ee715a20fa0d575a301099d.camel%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: edit several files

trialero
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 [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: edit several files

Mathieu
Thank you very much.
Indeed, i don't know how i can do :    <ctrl>-^
I use a french keyword. Is ^ the "hat" caractère which can be top of
letters: âêî???




On sam., 2019-07-06 at 11:18 +0200, meine wrote:

> 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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/84f067827d974b6bf7822bc9a508283eb19cc7d5.camel%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: edit several files

trialero
On Sat, Jul 06, 2019 at 12:04:20PM +0200, Mathieu Roux wrote:
> Thank you very much.

:-)

> Indeed, i don't know how i can do :    <ctrl>-^
> I use a french keyword. Is ^ the "hat" caractère which can be top of
> letters: âêî???

yes, it is the `caret'

`<right-Alt> 9' should give a ^ on an azerty keyboard

on querty keyboards it is `<shift> 6'

//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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20190706104847.GC929%40trackstand.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: edit several files

Mathieu
Perfect!

thank you again!


On sam., 2019-07-06 at 12:48 +0200, meine wrote:

> On Sat, Jul 06, 2019 at 12:04:20PM +0200, Mathieu Roux wrote:
> > Thank you very much.
>
> :-)
>
> > Indeed, i don't know how i can do :    <ctrl>-^
> > I use a french keyword. Is ^ the "hat" caractère which can be top
> > of
> > letters: âêî???
>
> yes, it is the `caret'
>
> `<right-Alt> 9' should give a ^ on an azerty keyboard
>
> on querty keyboards it is `<shift> 6'
>
> //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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/750e42096a117915a3af26ce7077879ced701b54.camel%40gmail.com.
For more options, visit https://groups.google.com/d/optout.