Neovim in LogiShell
The Vim tab of the bottom panel is a real Neovim. It runs on your computer, on the file that is open in the editor, and what you save there shows in the editor at once.
Neovim has a reputation: you open it and nothing you type does what you expect. So the tab starts it with a LogiShell setup: the bottom line always says in words what mode you are in, Space opens a menu of what you can do, and one key shows every key that matters.
You need Neovim on the computer. If it is not there, the tab says so: install
the package neovim (with Homebrew, apt, dnf or winget) and press Try
again.
The first time, the computer downloads the setup (one small file) from LogiShell and checks it before using it. If it cannot, for example with no network, the tab starts the computer's own Neovim, says *LogiShell setup needs the network once*, and tries again on the next start.
The ten keys
| Key | What it does |
|---|---|
i | Start typing. The bottom line says INSERT: you are typing. |
Esc | Stop typing. The bottom line says NORMAL: keys are commands. |
u | Undo. Ctrl+r brings it back. |
Space w | Save. |
Space q | Close. If something is not saved, Neovim asks first. |
Space e | File list on the left. Enter opens a file. |
Space f | Find a file by a part of its name. |
Space / | Search in all files. |
v | Select. Then y copies, d cuts, and p pastes. |
Space ? | A page with all of these keys. q closes it. |
One more for later: Space l turns on language help for the project you are
in (see below).
The mouse works: click to move the cursor, drag to select, scroll with the
wheel. Ctrl+s saves too.
If you forget everything else, remember two things: Esc gets you back to
safety, and Space ? shows the keys. The same keys are listed under the tab.
What the setup contains
Everything in the first list works at once, with no network and nothing to install:
- line numbers, the mouse, the system clipboard, undo that survives closing the file, search that ignores case until you type a capital letter;
- colours that follow the light or dark theme of LogiShell;
- the bottom line with the mode in words, the file name and one quiet note;
- the keys above and the help page.
When the computer can reach github.com, the setup adds a short list of extras in the background. The first start says Setting up extras, a minute in the bottom line and you can type meanwhile. On our test computer it took about twelve seconds. Without a network you see *Extras are not installed yet: no network*, everything in the first list still works, and the next start with a network tries again. Nothing is compiled on your computer.
| Extra | What you get |
|---|---|
| which-key | Press Space and wait a moment: a list of what comes next. |
| nvim-tree | The file list of Space e as a tree. |
| telescope (with plenary) | Space f and Space / with a live preview. Search in files needs ripgrep on the computer; without it the built in search is used. |
| lazy.nvim | The manager that fetches the ones above. |
Every extra is pinned to one exact commit, so nothing on your computer follows a moving branch. The list and the hashes are in the config file itself. Code is coloured by Neovim's built in syntax for now.
Language help, when you ask for it
If a language server is already installed on the computer (for TypeScript, Go,
Python, Rust, Lua or C), Neovim can use it: gd goes to a definition, K
explains the word under the cursor, Space r renames, Space a offers quick
fixes.
It never starts by itself. A language server runs the project's own tooling
(its build scripts, its own copy of TypeScript), so opening a file from a
project you do not know must not start one. Press Space l in a file: Neovim
names the server and asks. Yes turns it on for that project until you close
Neovim. LogiShell does not install language servers.
For the same reason a file cannot change Neovim's settings from inside (modelines are off), and a config file lying in a project folder is not read.
Your own Neovim is not touched
The setup lives under a name of its own, logishell-nvim:
- the config is
~/.config/logishell-nvim/init.lua; - extras are in
~/.local/share/logishell-nvim; - undo history and the like are in
~/.local/state/logishell-nvim.
The config is downloaded from the address of the LogiShell app you are using and its checksum is compared with the one the app names before the file is put in place. Nothing from the download is run by the shell.
Your own ~/.config/nvim is never read and never written. Nothing is
installed outside those folders, and nothing needs administrator rights. To
remove the setup, delete the three folders.
LogiShell replaces its init.lua when a newer one ships. Your own additions
go into ~/.config/logishell-nvim/lua/user.lua: that file is loaded last and
is never overwritten.
Use your own Neovim instead
If you already have a Neovim you like, open the chooser in the tab's bar and pick My own Neovim. The tab then starts Neovim exactly as the computer has it set up. The choice is remembered per computer, so a fresh server can keep the LogiShell setup while your laptop keeps yours.
A Neovim that is already running keeps its setup. The bar offers Restart with ...; save first, because unsaved changes are lost with the restart.
On a Windows computer the tab runs your own Neovim for now.
Files from the editor
When you open another file in the editor while Neovim is running, the bar offers Open (file) here. If you want that to happen by itself, switch on Follow the editor in the bar.
LogiShell opens the file by typing one short command into Neovim for you. It
does that only into a Neovim with the LogiShell setup that this window saw
start, and only while Neovim is on screen. In every other case (your own
Neovim, a tab that was open before you reloaded the page) Open (file) here
starts Neovim again on that file instead, and tells you first that unsaved
changes would be lost. After you close Neovim with Space q the bar says so
and offers Open Neovim again.
When something looks wrong
- The colours do not match after you changed the theme. Neovim learns the
theme when it starts. Type
:set background=light(ordark) and press Enter; the next Neovim the tab starts picks the theme up by itself. - The tab says the LogiShell setup needs the network once. The computer
could not download the setup, or has no
curland nowget. You are in the computer's own Neovim, with its own keys; the next start tries again. - The bottom line says the extras are not installed. The computer could
not reach github.com, or has no
git. The basics work; the next start tries again. - You typed something and the text went wild. Press
Esc, thenua few times.