Re: Remote development with neovim, tmux and SSH from macOS?

From: Kevin Oberman <rkoberman_at_gmail.com>
Date: Sun, 03 Mar 2024 22:15:58 UTC
On Sun, Mar 3, 2024 at 2:04 PM Simon Connah <simon.n.connah@protonmail.com>
wrote:

> On Saturday, 2 March 2024 at 07:39, Daniel Tameling <
> tamelingdaniel@gmail.com> wrote:
>
> >
>
> >
>
> > On Wed, Feb 28, 2024 at 04:30:22PM +0000, Simon Connah wrote:
> >
>
> > > I've just set up a FreeBSD server and was curious about the best
> practices for when it comes to developing on FreeBSD? I have a Mac Studio
> but I'm not used to neovim or tmux at all and I get the feeling that
> learning them is going to take some time.
> > >
>
> > > What do you use for developing on FreeBSD servers? Unfortunately I
> can't install FreeBSD on my machine (well I can but it would be in VMware
> Fusion Pro).
> > >
>
> > > Looking forward to hearing what other people do.
> > >
>
> > > Simon.
> >
>
> >
>
> > I generally use emacs and at work I use tmux for working on remote
> > servers. The main reason is that I can detach from the session
> > shutdown my laptop and continue right where I left off the next day.
> > I don't use any plugins or have much in my .tmux.conf. I remapped
> > splitting to Prefix+h and Prefix+v, and have some shortcuts for easier
> > movement:
> >
>
> > # more intuitive keybindings for splitting
> > unbind %
> > bind h split-window -v
> > unbind '"'
> > bind v split-window -h
> >
>
> > # switch windows using Alt-arrow without prefix
> > bind -n M-Left select-window -t:-1
> > bind -n M-Right select-window -t:+1
> > # switch panes using Shift-arrow without prefix
> > bind -n S-Left select-pane -L
> > bind -n S-Right select-pane -R
> > bind -n S-Up select-pane -U
> > bind -n S-Down select-pane -D
> > # move window left and right with Alt-Shift-arrow
> > bind-key -n M-S-Left swap-window -d -t -1
> > bind-key -n M-S-Right swap-window -d -t +1
> >
>
> > The rest is just stuff you find in every tmux setup guide.
> >
>
> >
>
> > Just throwing out two options of what I have seen other people do:
> >
>
> > 1) Mount remote folders locally with sshfs and then use your favourite
> > editor on the machine itself.
> >
>
> > 2) Connect with x2go to the remote machine and run a desktop
> > environment on the remote machine.
> >
>
> > I don't know whether these two work on MacOS or how difficult they are
> > to setup.
> >
>
> > --
> > Best regards,
> > Daniel
>
> Thank you very much! I'll have a play around with tmux. From what I can
> tell you can have sessions on multiple virtual servers and just switch
> between them with a couple of key presses? Sounds good to me.


Many moons ago the author of tmux made changes such that lines might be
missing from the scrollback buffer. This was simply unacceptable to my
needs at the time and I moved back to screen. I found tmux superior, but
not usable without a complete hitory.

It is possible that this is no longer the case and I have had no need for
such a tool for over a decade of retirement, but it was and might still be
a significant issue for you.

-- 
Kevin Oberman, Part time kid herder and retired Network Engineer
E-mail: rkoberman@gmail.com
PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683