# OpenClaw Neovim Plugin: Setup, Lualine Integration, and Terminal Workflow Guide

openclaw.nvim wraps the OpenClaw CLI with gateway control, async status polling, and a Lualine statusline component, all inside Neovim. With over 145,000 stars on the main OpenClaw repo and no built-in editor plugin, this community project fills a gap for terminal-native developers. The guide covers installation, Lua configuration for native and WSL setups, and a tmux workflow for running the agent alongside the editor.

Source: https://fast.io/resources/openclaw-neovim-plugin-setup-guide/
Last reviewed: 2026-06-25

## How openclaw.nvim connects Neovim to the OpenClaw gateway

OpenClaw crossed 145,000 GitHub stars by February 2, 2026, gaining over 66,000 in a single five-day span. That growth confirmed personal AI agents are not a side-project curiosity but production tools people rely on daily. Yet OpenClaw's default interfaces, the web dashboard and terminal UI, pull developers out of their editors. For Neovim users who handle everything from file navigation to git operations inside terminal buffers, switching to a browser to start or stop an agent breaks the flow.

openclaw.nvim solves that problem. Built entirely in Lua by the OpenKnots community, the plugin wraps the OpenClaw CLI with gateway start/stop/restart commands, async status polling, and a Lualine statusline component. Every operation is non-blocking, so your editor stays responsive while the agent works in the background.

The plugin requires two things: Neovim 0.8.0 or later, and the [OpenClaw CLI](https://github.com/njg7194/openclaw.nvim) installed and accessible from your PATH. If the CLI responds in a terminal prompt, you can run it from inside Neovim.

## How to install openclaw.nvim with lazy.nvim, packer, or vim-plug

Three plugin managers support openclaw.nvim out of the box. Pick whichever one matches your current Neovim configuration.

### lazy.nvim

Add the plugin spec for `OpenKnots/openclaw.nvim` to your lazy.nvim plugin list, then call `require("openclaw").setup()` inside a config function. lazy.nvim handles dependency resolution and lazy-loading automatically. The [openclaw.nvim README](https://github.com/njg7194/openclaw.nvim) includes the exact Lua table you can copy into your config. This is the recommended approach for new Neovim configurations.

### packer.nvim

The packer syntax follows the same pattern: add the `OpenKnots/openclaw.nvim` repo to your `use` block with a config function that calls `require("openclaw").setup()`. The setup call works identically to the lazy.nvim version.

### vim-plug

With vim-plug, add the plugin reference to your vimrc, then include the `require("openclaw").setup()` call separately in your `init.lua` file.

All three methods pull from the same [GitHub repository](https://github.com/njg7194/openclaw.nvim). Calling setup with no arguments uses sensible defaults: the OpenClaw CLI from your PATH, a 5-second status refresh interval, and notifications enabled for connection state changes.

## How to configure gateway commands and set up keymaps

The setup function accepts a Lua table that controls how the plugin talks to the OpenClaw CLI:

```lua
require("openclaw").setup({
  command = "openclaw",
  auto_connect = false,
  status_refresh_ms = 5000,
  notify_on_status_change = true,
})
```

**Configuration options:**

- `command` sets the CLI binary name. WSL users should set this to `"wsl openclaw"` so the plugin routes calls through the Windows Subsystem for Linux layer
- `auto_connect` starts the gateway automatically when Neovim opens. Leave it false if you prefer manual control
- `status_refresh_ms` controls the polling interval in milliseconds. Lower values give faster status feedback but generate more process calls
- `notify_on_status_change` triggers a Neovim notification when the agent connects or disconnects

**Available commands:**

- `:OpenClawConnect` starts the gateway
- `:OpenClawDisconnect` stops the gateway
- `:OpenClawRestart` restarts the gateway
- `:OpenClawStatus` checks connection status
- `:OpenClawSetup` runs the first-time setup wizard
- `:OpenClawDoctor` runs health checks on your OpenClaw installation
- `:OpenClawDashboard` opens the web dashboard in your default browser
- `:OpenClawTUI` opens the terminal UI inside a Neovim terminal buffer
- `:OpenClawLogs` streams live agent logs in a terminal buffer

Binding the most-used commands to keymaps saves keystrokes during development sessions:

```lua
vim.keymap.set("n", "<leader>oc", "<cmd>OpenClawConnect<cr>", { desc = "OpenClaw Connect" })
vim.keymap.set("n", "<leader>od", "<cmd>OpenClawDisconnect<cr>", { desc = "OpenClaw Disconnect" })
vim.keymap.set("n", "<leader>os", "<cmd>OpenClawStatus<cr>", { desc = "OpenClaw Status" })
vim.keymap.set("n", "<leader>ot", "<cmd>OpenClawTUI<cr>", { desc = "OpenClaw TUI" })
```

The `<leader>o` prefix groups all OpenClaw bindings under one mnemonic. Adjust the prefix if it conflicts with your existing keymap.

## Displaying agent status in Lualine

The plugin ships a ready-made Lualine component that shows your agent's connection state directly in the statusline. When connected, it displays a green lobster emoji followed by "OpenClaw". When disconnected, it shows the emoji with a pause icon in red.

```lua
require("lualine").setup({
  sections = {
    lualine_x = {
      require("openclaw").lualine_component(),
    },
  },
})
```

Place the component in whatever Lualine section fits your layout. `lualine_x` works well because it sits near the right side of the statusline alongside encoding and file format indicators, but `lualine_c` or `lualine_y` are equally valid choices.

If you do not use Lualine, the native Neovim statusline can display the same information:

```lua
vim.o.statusline = '%{luaeval("require(\\"openclaw\\").statusline()")}'
```

This approach uses a Lua eval call inside Neovim's built-in statusline format string. It is less flexible than Lualine but requires no additional dependencies.

The plugin also exposes a Lua API for custom integrations:

```lua
local oc = require("openclaw")
oc.is_connected()    -- returns boolean
oc.get_state()       -- returns full state table
oc.status(function(state)
  print("Connected:", state.connected)
end)
```

These functions are useful if you build your own statusline component or want to conditionally load other plugins based on whether the agent is running.

## Running OpenClaw alongside Neovim in tmux

Neovim users who work with OpenClaw typically keep the agent and editor in separate terminal panes. tmux is the standard tool for managing this split, and a simple two-pane layout covers most workflows.

This command creates a tmux session with Neovim in the main pane and the OpenClaw TUI in a side panel:

```bash
tmux new-session -s dev \; \
  send-keys 'nvim .' Enter \; \
  split-window -h -p 30 \; \
  send-keys 'openclaw' Enter \; \
  select-pane -L
```

Neovim gets 70% of the screen and the OpenClaw TUI gets the remaining 30%. The `select-pane -L` command returns focus to the editor so you can start coding immediately.

With openclaw.nvim installed, you can start and stop the gateway from Neovim using `:OpenClawConnect` and `:OpenClawDisconnect` while monitoring the agent's full output in the adjacent tmux pane. The Lualine component updates in real time, so you always know whether the agent is active without switching context.

For WSL users, the workflow is identical. Set `command = "wsl openclaw"` in the plugin config so gateway commands route through WSL correctly. The tmux layout works the same way inside Windows Terminal or Alacritty.

Some developers skip the TUI entirely and manage everything through Neovim commands. `:OpenClawLogs` opens a terminal buffer with live agent logs, and `:OpenClawDashboard` launches the web dashboard in your browser. Both keep the entire workflow inside Neovim's own window management, which means fewer context switches during long coding sessions.

## Persisting and sharing agent output

When OpenClaw generates code, documents, or data files, those outputs need somewhere persistent and accessible. Local disk storage works for solo development, but it falls apart when you share results with a team, hand deliverables to a client, or switch between machines.

S3 buckets and Google Drive are common choices for developers who want cloud-accessible storage. Both work but require manual setup for access controls, sharing permissions, and folder organization.

[Fast.io](/storage-for-openclaw/) offers an alternative built for agent workflows. [Plans](/pricing/) start with a 14-day free trial (Starter at $29/month, Business at $99/month), with storage, monthly credits, and workspaces scaled to each tier. Files uploaded to a workspace are automatically indexed for semantic search when Intelligence Mode is enabled, so you can ask questions about your agent's output without opening each file individually.

The [Fast.io MCP server](/storage-for-agents/) exposes workspace operations that agents can call directly, including file reads, writes, and organizational actions. For Neovim users working with OpenClaw, this creates a practical loop: the agent writes files to a Fast.io workspace, the developer reviews them from the same shared environment, and ownership transfer hands full control to a human when the job is done. The workspace stays intact across sessions, so nothing gets lost between tmux restarts or machine switches.

## Frequently asked questions

### Does OpenClaw work with Neovim?

Yes. The openclaw.nvim plugin integrates the OpenClaw CLI directly into Neovim with gateway control, status monitoring, and Lualine statusline support. It requires Neovim 0.8.0 or later and the OpenClaw CLI installed on your system.

### How do I install openclaw.nvim?

Add the plugin to your package manager. With lazy.nvim, include the OpenKnots/openclaw.nvim repo in your plugin list and call require("openclaw").setup() in the config function. Packer.nvim and vim-plug use similar syntax. Run your manager's install or sync command and the plugin is ready.

### Can I see OpenClaw status in Lualine?

Yes. The plugin includes a Lualine component you add to any statusline section by calling require("openclaw").lualine_component() inside your Lualine setup. It displays a green lobster emoji when connected and a red pause icon when disconnected.

### What is the best AI plugin for Neovim?

It depends on your workflow. openclaw.nvim is built for developers who use OpenClaw and want gateway control inside the editor. Copilot.vim provides inline code completion from GitHub Copilot. avante.nvim adds chat-based AI interactions. The right choice depends on which AI service you use and whether you need inline completion, chat, or full agent management.

### Does openclaw.nvim work on Windows with WSL?

Yes. Set the command option to "wsl openclaw" in the plugin's setup function so all gateway commands route through the Windows Subsystem for Linux. Lualine integration, status monitoring, and all other features work identically to native Linux or macOS setups.

## About Fast.io

Fast.io provides shared workspaces where people and AI agents work on the same files, with built-in semantic search and citation-backed chat over what they hold. Agents reach it through a remote MCP server at https://mcp.fast.io/mcp, a REST API at https://api.fast.io/current/, and a command line client published on npm as @vividengine/fastio-cli.
