# An editor as easy as nano, with LSP and syntax highlighting

> Like nano but want code completion, errors, syntax colours and tabs? How far nano's nanorc goes, and modeless editors that add LSP without a learning curve.

Source: https://skink.cc/articles/nano-but-with-more/

Nano is easy because it has no modes and shows its shortcuts on screen. You can make it nicer for code with a few lines in `~/.nanorc`: syntax colours, line numbers, the mouse, auto-indent.

What nano cannot do is talk to a language server, so there is no completion, no go to definition and no live errors. For that, pick a modeless editor that keeps nano's ease: Micro adds it through plugins, Skink has it built in.

## Make nano better for code

```sh
# ~/.nanorc
include "/usr/share/nano/*.nanorc"   # syntax colours (the path varies by system and package manager)
set linenumbers
set mouse
set autoindent
set tabsize 4
set tabstospaces
set softwrap
set constantshow                      # always show line and column
```

`nano -l -m file` gives you line numbers and the mouse for one session.

## Does nano have autocomplete?

Only a basic one. Nano can complete a word from other words already in the file (Ctrl+] in recent versions).

It knows nothing about your language: no method names, no imports, no types.

## Does nano support LSP?

No. Nano's syntax files can name an external `linter` and `formatter` program to run on the buffer, which helps for a quick check. But there is no language server client.

## What a language server gives you

A language server (rust-analyzer, pyright, gopls, typescript-language-server, ...) reads your whole project and answers the editor's questions:

- completion that knows your types and imports
- errors and warnings as you type
- hover docs, go to definition, find references
- rename a symbol across files, code actions ("add missing import")
- formatting

## The nano-like option with LSP: Skink

Skink keeps what makes nano easy and adds the code features.

- **No modes.** Open a file and type. Nothing to learn before your first edit.
- **Desktop keys.** Ctrl+S save, Ctrl+Q quit, Ctrl+F find, Ctrl+Z undo, Ctrl+C / Ctrl+V copy and paste.
- **Help one key away.** Ctrl+E then `help` opens the manual in a tab; F1 lists every command and action.
- **Mouse on**, no setting needed.
- **Syntax colours** from tree-sitter for 19 languages (Rust, TypeScript, JavaScript, Python, Go, Zig, Dart, JSON, TOML, Bash, Markdown, YAML, HTML, CSS, Lua, Make, INI, diff, XML).
- **Language servers** for Rust, TypeScript/JavaScript, Python, Go, Dart and Zig, started automatically when you open a file of that language, if the server is installed.

### The code keys

| Key | Typed command | Does |
|---|---|---|
| Ctrl+Space | `:complete` | Completion (also opens by itself as you type) |
| Alt+K | `:hover` | Type and docs of the symbol |
| Alt+G | `:def` | Go to definition |
| Alt+R | `:refs` | Find references |
| Alt+Enter | `:fix` | Quick fixes and refactorings |
| Shift+F8 (F9 before 0.8) | `:problems` | List of errors |
| F6 | `:nextproblem` | Jump to the next error |
| Alt+Shift+F | `:format` | Format |

If an Alt key does not reach Skink (common on macOS), press Ctrl+E and type the command instead. Every key has one; see [typed commands](https://skink.cc/editing/typed-commands/).

### What nano does not have at all

- tabs and split panes
- a file tree (F8, or `:files`)
- fuzzy file open (Alt+P, or `:recent`)
- search across the project (Alt+S)
- git changes in the gutter
- a terminal tab (F12)

## Install a language server

Skink uses the servers you have installed. Common ones:

```sh
rustup component add rust-analyzer          # Rust
npm install -g typescript-language-server typescript   # TS / JS
pip install basedpyright                    # Python (or: npm install -g pyright)
go install golang.org/x/tools/gopls@latest  # Go
```

Dart's server comes with the Dart SDK; for Zig install `zls`. `:lsp` in Skink shows the server, its memory and progress.

## Same settings words as nano

Skink's `~/.config/skink/settings.json` uses Micro's option names, many of which match nano's:

```json
{
  "tabsize": 4,
  "tabstospaces": true,
  "autoclose": true,
  "rulers": [80]
}
```

Nano's keys differ: nano saves with Ctrl+O and quits with Ctrl+X. See the key table in [Skink vs nano](https://skink.cc/compare/nano/), which also shows how to rebind them.

**Note:**
Nano is still the better tool on a server you cannot install anything on. Skink is a separate download (one binary, no sudo) and is alpha.

## Try it

```sh
curl -fsSL https://skink.cc/install.sh | sh
skink hello.py
```

Next: [quick start](https://skink.cc/start/quick-start/) and [Skink vs Micro](https://skink.cc/compare/micro/).
