andrius / blink-dotfiles

Dotfiles for tmux and vim/nvim working with blink and mac os

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dotfiles for blink.sh env

Introduction

blink shell is an excellent minimalistic SSH and mosh client for apple mobile devices.

For some folks, like me that's a tool #1, I spent most of the time in terminal (also I work mostly from the iPad pro).

Here I share blink-related dotfiles and create a development repository.

Feel free to use, share and of course to contribute!

Clipboard

Paste from iPad to blink works out of the box, but in opposite it depends. If we copy wrapped lines, usually they breaks. I don't mind apps with menus and interfaces (i.e. mc, tmux with window splits, editors, etc.)

As for now, the perfect solution is to use OSC52 escape codes, these works well with ssh and recent mosh.

Disclamer

In order to get clipboard setup working, we need recent software: tmux 3+, mosh 1.3+, vim 8+ or neovim 4.3+

Check your repository first! Usually it means that such apps should be compiled or installed using brew (yes, it works with linux too!)

Setup

Clone repository to the .dotfiles folder:

git clone http://github.com/andrius/blink-dotfiles ~/.dotfiles

Tmux setup:

ln -s ~/.dotfiles/tmux/tmux.conf ~/.tmux.conf

VIM or neovim setup:

mkdir -p ~/.config
ln -s ~/.dotfiles/nvim ~/.config/nvim
ln -s ~/.dotfiles/nvim/vimrc ~/.vimrc
git clone https://github.com/Shougo/dein.vim ~/.cache/vim/dein/repos/github.com/Shougo/dein.vim
# vim users: replace nvim by vim below
nvim -V1 -es -i NONE -N --noplugin -u "/home/${SSH_USER}/.config/nvim/config/vimrc" \
  -c "try | call dein#clear_state() | call dein#update() | finally | messages | qall! | endtry"

Development setup with docker

It is possible to test stuff with docker. Given dockerfiles just contains openssh-server and mosh-server, and minimal setup to get things working. It is possible to test them directly from the blink shell

Supported docker services (and operating systems):

  • alpine

    tmux, mosh and neovim installed with apk, clipboard does not work with mosh;

  • debian

    tmux and mosh compiled, vim installed as a package. Clipboard works correctly;

  • brew

    debian with homebrew installed. tmux, mosh and neovim installed with brew, everything works;

  • ubuntu

    ubunut 20.10 with apt-get installed tmux, mosh and vim. Clipboard works correctly.

Start and stop service

To start:

# assign alpine, debian, brew or ubuntu to the SERVICE
SERVICE=alpine && \
docker-compose build --force-rm --pull ${SERVICE} && \
docker-compose up -d ${SERVICE} && \
docker-compose logs -ft --tail=100 ${SERVICE}

To stop:

docker-compose rm --stop --force

Access host from the blink

Each time when you build new docker image, SSH keys would be updated, so cleanup known hosts file first:

rm ~/.ssh/known_hosts

SSH access:

ssh -oPort=22022 blink@host

mosh access:

mosh blink@host -P 22022 -p 22022

(if there is issue due to the busy UDP port, you might kill mosh-server first):

docker-compose exec alpine killall mosh-server

References

vim-oscyank plugin

Demo

Screencast

download link

screencast

About

Dotfiles for tmux and vim/nvim working with blink and mac os

License:Apache License 2.0


Languages

Language:Dockerfile 72.6%Language:Vim Script 13.8%Language:Shell 8.5%Language:Makefile 5.1%