1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254
|
[](https://circleci.com/gh/equalsraf/neovim-qt)
[](https://ci.appveyor.com/project/equalsraf/neovim-qt/branch/master)
[](https://travis-ci.org/equalsraf/neovim-qt)
[](https://codecov.io/gh/equalsraf/neovim-qt)
[](https://dev.azure.com/equalsraf/neovim-qt/_build/latest?definitionId=1&branchName=master)
[](https://github.com/equalsraf/neovim-qt/releases)
# Neovim Qt
Neovim Qt is a lightweight cross-platform Neovim GUI written in C++ with Qt.

## Installing Neovim Qt
Neovim Qt is available on all platforms supported by Qt.
Instructions for common platforms are listed below.
### Windows
Nightly versions of Neovim Qt require manual download + installation.
Pre-built Windows binaries are provided for all recent commits:
[AppVeyor Commit Build Wiki Instructions](https://github.com/equalsraf/neovim-qt/wiki/Windows-AppVeyor-Builds)
#### Neovim version 0.10.0 and later
Starting with Neovim version `0.10.0`, Neovim Qt is no longer bundled with Neovim on Windows; each package must be installed separately.
```
> winget install neovim.neovim
> winget install equalsraf.neovim-qt
```
#### Neovim versions before 0.10.0
Neovim Qt is bundled with all releases of Neovim on Windows prior to Neovim version `0.10.0`.
See the Neovim release page:
- [Nightly Release](https://github.com/neovim/neovim/releases/nightly)
- [Stable Release](https://github.com/neovim/neovim/releases/latest)
Neovim is available as a [Chocolatey Package](https://chocolatey.org/packages/neovim/).
Stable Neovim + Neovim Qt:
```
> choco install neovim
```
Pre-Release Neovim + Stable Neovim Qt:
```
> choco install neovim --pre
```
### MacOS
#### Homebrew
Neovim Qt is available in the [Homebrew](https://brew.sh/) core package repository.
To install the latest release:
```
$ brew install neovim-qt
```
To install the latest development version:
```
$ brew install --HEAD neovim-qt
```
### Linux
Neovim Qt is packaged for many distributions, use your favorite package manager.
If your distribution is not listed here, please create an Issue with instructions.
#### Arch Linux
Neovim Qt is available from the Arch [Community Repository](https://archlinux.org/packages/community/x86_64/neovim-qt/).
```
$ sudo pacman -S neovim-qt
```
#### Gentoo
Neovim Qt is available from this [Portage Ebuild](https://github.com/jgehrig/gentoo/blob/master/app-editors/neovim-qt/neovim-qt-9999.ebuild).
Alternatively, you can add the entire overlay:
```
$ eselect repository add jgehrig git https://github.com/jgehrig/gentoo.git
$ emerge --sync
$ emerge -av neovim-qt
```
#### OpenSUSE
Neovim Qt is available from this [Community Package](https://build.opensuse.org/package/show/home%3AAptrug/neovim-qt).
#### Debian, Ubuntu
Neovim Qt is in both the Debian and Ubuntu package repositories, and can be installed with APT. This means that it should also available on any OS that uses these repositories, such as Linux Mint.
```
$ apt install neovim-qt
```
#### Homebrew
Homebrew supports Linux (sometimes called "Linuxbrew"); follow the MacOS Homebrew installation instructions.
## Configuration
Neovim Qt can be configured through the `ginit.vim` file.
The default locations are:
- Windows: `%LOCALAPPDATA%\nvim\ginit.vim`
- MacOS: `~/.config/nvim/ginit.vim`
- Linux: `~/.config/nvim/ginit.vim`
Recommended `ginit.vim`:
```vim
" Enable Mouse
set mouse=a
" Set Editor Font
if exists(':GuiFont')
" Use GuiFont! to ignore font errors
GuiFont {font_name}:h{size}
endif
" Disable GUI Tabline
if exists(':GuiTabline')
GuiTabline 0
endif
" Disable GUI Popupmenu
if exists(':GuiPopupmenu')
GuiPopupmenu 0
endif
" Enable GUI ScrollBar
if exists(':GuiScrollBar')
GuiScrollBar 1
endif
" Right Click Context Menu (Copy-Cut-Paste)
nnoremap <silent><RightMouse> :call GuiShowContextMenu()<CR>
inoremap <silent><RightMouse> <Esc>:call GuiShowContextMenu()<CR>
xnoremap <silent><RightMouse> :call GuiShowContextMenu()<CR>gv
snoremap <silent><RightMouse> <C-G>:call GuiShowContextMenu()<CR>gv
```
For more options, try `:help nvim_gui_shim` and scroll down to `Commands`.
More detailed information can be found on the [Configuration Wiki Page](https://github.com/equalsraf/neovim-qt/wiki/Configuration-Options).
## Frequently Asked Questions
### Why are the `:Gui` commands missing?
You need the Neovim Qt runtime to use commands like `:GuiFont`.
You can manually specify the path with `NVIM_QT_RUNTIME_PATH`.
Alternatively, you can install the Neovim Qt plugin separately:
`Plugin 'equalsraf/neovim-gui-shim`
On recent releases, you can check if the runtime is loaded with `nvim-qt --version`:
```
$ nvim-qt --version
NVIM-QT v0.2.16.1
Build type: Release
Compilation:-march=native -O2 -pipe -Wall -Wextra -Wno-unused-parameter -Wunused-variable -std=c++11
Qt Version: 5.15.2
Environment:
nvim: nvim
args: --cmd let &rtp.=',/usr/share/nvim-qt/runtime' --cmd set termguicolors
runtime: /usr/share/nvim-qt/runtime
...
```
Notice that `runtime:` is non-empty and points to a folder with `nvim_gui_shim.vim`.
### Why does `:Gui` not work in `init.vim`?
The `:Gui...` commands are not loaded when `init.vim` runs.
These options must be configured from `ginit.vim`. The file should be placed in the same directory as `init.vim`.
Alternatively, Neovim Qt responds to some vim options. You can `:set guifont=...` directly in `init.vim`.
### How do I disable the GUI Tabs?
Try `:GuiTabline 0`. This option can be added to `ginit.vim`.
To prevent startup flicker, see [Wiki - Configuration Options](https://github.com/equalsraf/neovim-qt/wiki/Configuration-Options)
### Why does the popup menu look different?
Try `:GuiPopupmenu 0`. This option can be added to `ginit.vim`.
The menu looks different because it is a widget rendered via Qt. Many users expect the `nvim` TUI (Terminal UI) menu instead.
### How do I change the font?
Use the `:GuiFont` command or the `'guifont'` setting. For example, `:GuiFont Fira Code:h12`, or `:set guifont=Hack:h12`.
### Why does `:GuiFont` throw an error?
You may see these errors:
- `{Font Name} is not a fixed pitch Font`
- ` Warning: Font {Font Name} reports bad fixed pitch metrics`
You can override this warning with `:GuiFont! {Font Name}`.
These warnings display for fonts containing variable-width characters.
They are safe to ignore, but you might notice font spacing and clipping issues.
### Why is Neovim unable to start?
The `nvim` binary must be in your `$PATH`. You can manually provide a path to Neovim:
```
$ nvim-qt --nvim {path_to_nvim}
```
In recent versions, `nvim-qt --version` reports the `nvim` binary path:
```
$ nvim-qt --version
...
Environment:
nvim: nvim
...
```
## Building From Source
Detailed build instructions can be found at the [Wiki](https://github.com/equalsraf/neovim-qt/wiki/Build-Instructions).
Simplified Build Commands:
```
$ mkdir build
$ cd build
$ cmake -DCMAKE_BUILD_TYPE=Release ..
$ cmake --build .
$ NVIM_QT_RUNTIME_PATH=../src/gui/runtime bin/nvim-qt
```
NOTE: `NVIM_QT_RUNTIME_PATH` must be set for commands such as `:GuiFont` to work.
|