Tuesday, March 14, 2023

Re: How do I replicate vim settings across two machines?

On Di, 14 Mär 2023, 'Ottavio Caruso' via vim_use wrote:

> Hi,
>
> I have two laptops.
>
> LAP-EXT is a laptop that I use when out and about and is connected to the
> Internet via mobile 4G.
>
> I frequently edit a file called mlog.txt
>
> $ vim ~/docs/mlog
>
> At home I have another laptop (LAP-HOME), with no access to the Internet, on
> which I mount $HOME on LAP1 over sshfs:
>
>
> $ sshfs LAP-HOME: ~/external
>
> Both machines run latest Debian stable.
>
> So I can access mlog.txt as:
>
> $ vim ~/external/docs/mlog
>
>
> However if I do that, I get different behaviours, for example the cursor
> mark is in different places, so I don't know where I left the text on the
> other machine.
>
> The only workaround at the moment is to ssh to LAP-EXT and run vim from
> there.
>
> How can I tell vim on LAP-HOME to use exactly the same settings as vim on
> LAP-EXT including leaving the cursor at the same position?

You are editing the same file using 2 different paths, so Vim thinks
those are different files. I don't think there is a way to convince Vim
that those are the same files, thus the only other option would be to
edit your viminfo file manually and carefully and change the path there.

Best,
Christian
--
Eine Frau begeht einen Fehler, wenn sie den Mann schon beim ersten
Beisammensein ihre Blinddarm-Operationsnarbe bewundern läßt.
-- Cathérine Deneuve

--
--
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/ZBBcopAm3aXJ/AOA%40256bit.org.

No comments: