DEV Community

Cover image for How to use Neovim 0.5 on iSH on iPadOS
Takuya Matsuyama
Takuya Matsuyama

Posted on

How to use Neovim 0.5 on iSH on iPadOS

I have an iPad. I love Neovim. Can I use it on my iPad? -- Let's try it.

Use iSH as a terminal emulator

iSH

https://ish.app/

iSH is a Linux shell built for iOS & iPadOS, using usermode x86 emulation and syscall translation. It's not a SSH client. You can actually have a terminal locally on your device.
It runs Alpine Linux, so you can install packages with apk command. Pretty neat!

Couldn't build Neovim from source

Apparently, the official iSH package repository currently provides only Neovim 0.4.
Looks like you need to build the latest Neovim from its source.

Install prerequisites:

apk update
apk add git build-base cmake automake autoconf libtool pkgconf coreutils curl unzip gettext-tiny-dev
Enter fullscreen mode Exit fullscreen mode

Clone the reopsitory:

git clone https://github.com/neovim/neovim.git
cd neovim
Enter fullscreen mode Exit fullscreen mode

Build it:

make -j4 CMAKE_BUILD_TYPE=Release
Enter fullscreen mode Exit fullscreen mode

But got an error:

Install the project...
-- Install configuration: "Release"
-- Installing: /root/neovim/.deps/usr/lib/libluv_a.a
-- Installing: /root/neovim/.deps/usr/include/luv/luv.h
-- Installing: /root/neovim/.deps/usr/include/luv/util.h
-- Installing: /root/neovim/.deps/usr/include/luv/lhandle.h
-- Installing: /root/neovim/.deps/usr/include/luv/lreq.h
make[4]: Leaving directory '/root/neovim/.deps/build/src/luv-static-build'
[ 94%] Completed 'luv-static'
make[3]: Leaving directory '/root/neovim/.deps'
[ 94%] Built target luv-static
make[2]: Leaving directory '/root/neovim/.deps'
make[1]: *** [Makefile:104: all] Error 2
make[1]: Leaving directory '/root/neovim/.deps'
make: *** [Makefile:105: deps] Error 2
Enter fullscreen mode Exit fullscreen mode

I don't understand what's going wrong from this error log.
iSH is quite unstable on doing those things.

I decided to go another way.

Try Alpine's edge repository

The iSH's default package repository is kind of outdated.
So, I tried to use the Alpine's official edge repository.
Because neovim-0.5.0 is available there:

https://pkgs.alpinelinux.org/package/edge/community/x86/neovim

echo https://dl-cdn.alpinelinux.org/alpine/edge/main > /etc/apk/repositories
echo https://dl-cdn.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories
apk update
apk upgrade
apk add neovim
Enter fullscreen mode Exit fullscreen mode

Boom. It worked!

IMG_0341

You can't use all the edge packages

I found that git or nodejs won't work if I installed it from the edge repos due to "Bad system call".
So, you basically should be on the default package repos.

I hope iSH gets more stable. Kudos to tbodt for the awesome work!

Related

I've made a tutorial video on how to set up Neovim on macOS:

Top comments (6)

Collapse
 
69keks profile image
Teri Huxley

Ugh… so if anyone is here in 2024, I managed to build and install with 0 issues on iSH (iPad Pro 2nd gen 10.5inch late 2017 model)by following the official build instructions. Stumbled here after installation and was looking if anyone was able to install a distribution (more like find out any nvim distro supported on iSH). Now that I think about it, I’m sure mason and lazy would take care of this by themselves.. gcc version 10.3.1 20210424
`NVIM v0.11.0-dev-5fc25ec
Build type: RelWithDebInfo
LuaJIT 2.1.1720049189
Compilation: /usr/bin/cc -O2 -g -Og -g -flto -fno-fat-lto-objects -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wvla -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -fsigned-char -fstack-protector-strong -Wno-conversion -fno-common -Wno-unused-result -Wimplicit-fallthrough -fdiagnostics-color=auto -DUNIT_TESTING -DHAVE_UNIBILIUM -D_GNU_SOURCE -DINCLUDE_GENERATED_DECLARATIONS -DUTF8PROC_STATIC -I/root/neovim/.deps/usr/include/luajit-2.1 -I/root/neovim/.deps/usr/include -I/root/neovim/build/src/nvim/auto -I/root/neovim/build/include -I/root/neovim/build/cmake.config -I/root/neovim/src -I/usr/include

system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/local/share/nvim"
`
Image description

Collapse
 
wangmengj profile image
Wang mengjia

I tried to build Neovim from its git repository and encounter a build error.
I traced some code and found below triggered this error:

LUAROCKS_SYSCONFDIR="/root/neovim/.deps/usr/etc/luarocks" LUA_PATH="/root/neovim/.deps/build/src/luarocks/src/?.lua;;" exec "/root/neovim/.deps/usr/bin/luajit" "/root/neovim/.deps/build/src/luarocks/src/bin/luarocks" --project-tree="/root/neovim/.deps/build/src/luarocks/lua_modules" "$@"

As you suggested, the edge repos are not very stable, therefore it is not a good choice. I just wish this works. .. any suggestion?

Collapse
 
vergeev profile image
Pavel Vergeev

Awesome! Just got my iPad, didn’t hear about iSH previously. Thanks for sharing!

Collapse
 
onezhaoyn profile image
Yinan Zhao

Thanks for sharing, eager to try it out on my iPad!

Collapse
 
lazyfahim profile image
Syed Mohammad Fahim Abrar

Super. Can we do dot net development on it ? With neovim?

Collapse
 
wangmengj profile image
Wang mengjia

Image description