Post

Neovim or Neovide, what is the difference?

Understand what Neovide is, how to install it and how to set it up

Contents

YouTube video

Disclaimer

  • I use the lazyvim.org neovim distribution, which comes with a lot of defaults

Introduction

  • I’ll clear the confusion on what Neovide is, I didn’t get it quite well until I installed it and I’ll show it’s possible benefits
  • So you can follow along or review it later

If you like this, and want to support me

Follow me on Twitter

If you want to try the configuration you’re looking at

  • In this video I explain how to install the lazyvim.org distro, kickstart and my own config, which is the one that you see in the video:

My complete Neovim markdown setup and workflow in 2024

  • If you like this current article, you will find this quite useful:

Neovim vs Neovide

What is it?

  • It’s a standalone app not related to your terminal application, that runs a Neovim GUI

Benefits

  • Smooth scrolling
  • Nice cursor animations
  • Blurred background when in pop ups
  • It’s decent with big markdown files, smoother than kitty
  • Read the features page for more info

How to install Neovide on macOS

1
brew install --cask neovide
  • After installing it, I didn’t change anything, it picked up my neovim config, theme and everything
  • Just open it

Set command line options

  • Here’s where I set the frame to transparent, to disable the bar on top
  • You can find my config.toml file in my dotfiles
  • Make sure you create the following file and add the options there
1
2
mkdir -p ~/.config/neovide
vim ~/.config/neovide/config.toml

Run specific options only if on Neovide

  • Run this command, if you run it on your terminal you will see the variable is undefined
  • If you run it from Neovide you will see v:true
1
:echo g:neovide
  • This means that you can have this conditional to run some options only when inside Neovide and not your regular Neovim instance on the terminal
1
2
3
4
5
6
7
8
if vim.g.neovide then
  vim.keymap.set("n", "<D-s>", ":w<CR>") -- Save
  vim.keymap.set("v", "<D-c>", '"+y') -- Copy
  vim.keymap.set("n", "<D-v>", '"+P') -- Paste normal mode
  vim.keymap.set("v", "<D-v>", '"+P') -- Paste visual mode
  vim.keymap.set("c", "<D-v>", "<C-R>+") -- Paste command mode
  vim.keymap.set("i", "<D-v>", '<ESC>l"+Pli') -- Paste insert mode
end
  • This is how I configure configure all my Neovide options in the ~/github/dotfiles-latest/neovim/neobean/lua/config/options.lua file

Fix paste issue macOS

  • You won’t be able to paste text in Neovide, more info on the FAQ
  • This is fixed by adding the following, in my case to my ~/github/dotfiles-latest/neovim/neobean/lua/config/options.lua file
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
if vim.g.neovide then
  vim.keymap.set("n", "<D-s>", ":w<CR>") -- Save
  vim.keymap.set("v", "<D-c>", '"+y') -- Copy
  vim.keymap.set("n", "<D-v>", '"+P') -- Paste normal mode
  vim.keymap.set("v", "<D-v>", '"+P') -- Paste visual mode
  vim.keymap.set("c", "<D-v>", "<C-R>+") -- Paste command mode
  vim.keymap.set("i", "<D-v>", '<ESC>l"+Pli') -- Paste insert mode
end

-- Allow clipboard copy paste in neovim
vim.api.nvim_set_keymap("", "<D-v>", "+p<CR>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("!", "<D-v>", "<C-R>+", { noremap = true, silent = true })
vim.api.nvim_set_keymap("t", "<D-v>", "<C-R>+", { noremap = true, silent = true })
vim.api.nvim_set_keymap("v", "<D-v>", "<C-R>+", { noremap = true, silent = true })

Get variable values

  • The variables for all the different options can be found in the configuration page
  • If for example you want to know the value of the vim.g.neovide_cursor_animation_length variable just run
1
2
3
4
5
echo neovide_cursor_animation_length

# or

echo g:neovide_cursor_animation_length

Issues

  • Cannot view and paste images in neovim, the same way I can with kitty, but that’s because kitty has image support

Timeline

1
2
3
4
5
6
7
8
9
10
11
12
13
0:00 - What is neovide
0:25 - Smooth scrolling and cursor animations
1:16 - blurred pop ups
1:26 - Smooth on big markdown files
2:03 - Install on macos
2:18 - Set command line options
2:30 - My config.toml file and dotfiles
3:18 - Configure neovide options
4:23 - Set cursor animation
4:40 - Fix paste issues
5:27 - Get variable values
5:45 - Cannot view images in Neovide
6:33 - Multiple instances in a tmux way
1
2
6:21 - RECOMMENDATION view paste images neovim
6:31 - RECOMMENDATION markdown workflow
This post is licensed under CC BY 4.0 by the author.