Skip to content

Instantly share code, notes, and snippets.

@JAffleck
Created June 17, 2018 05:42
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JAffleck/2ba6ca0bd0d5545fd17c396357b9abf0 to your computer and use it in GitHub Desktop.
Save JAffleck/2ba6ca0bd0d5545fd17c396357b9abf0 to your computer and use it in GitHub Desktop.
Neovim - Edit With Neovim WIndows Context menu
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\Neovim]
@="Edit with Neovim"
"Icon"="C:\\tools\\neovim\\Neovim\\bin\\nvim-qt.exe"
[HKEY_CLASSES_ROOT\*\shell\Neovim\command]
@="\"C:\\tools\\neovim\\Neovim\\bin\\nvim-qt.exe\" \"%1\""
@JAffleck
Copy link
Author

JAffleck commented Jun 17, 2018

The above worked for me. It took me a bit to realize that Neovim-qt 3.0 has a bug that auto-opens an empty buffer, so you won't see your to-be-edited file until you do a :bd

Init.vim workaround

The above gist was made from adapting this SO answer to Neovim
https://stackoverflow.com/a/27090678

@vonguyenminhtu2504
Copy link

vonguyenminhtu2504 commented Oct 26, 2023

Thanks for this post, I created this Add_NeoVim_to_context_menu.reg to add both Neovim and Neovim-Qt to file, directory and background context menu (if you install Neovim as administrator, it should be at C:\Program Files\Neovim, otherwise please change the "C:\Program Files\Neovim" to your current Neovim directory (remember the double-backslash)):

Windows Registry Editor Version 5.00



;; Neovim-Qt

[HKEY_CLASSES_ROOT\*\shell\nvim-qt]
@="Edit with Neovim-Qt"
"Icon"="\"C:\\Program Files\\Neovim\\bin\\nvim-qt.exe\""

[HKEY_CLASSES_ROOT\*\shell\nvim-qt\command]
@="\"C:\\Program Files\\Neovim\\bin\\nvim-qt.exe\" \"%1\""

[HKEY_CLASSES_ROOT\Directory\shell\nvim-qt]
@="Open with Neovim-Qt"
"Icon"="\"C:\\Program Files\\Neovim\\bin\\nvim-qt.exe\""

[HKEY_CLASSES_ROOT\Directory\shell\nvim-qt\command]
@="\"C:\\Program Files\\Neovim\\bin\\nvim-qt.exe\" \"%1\""

[HKEY_CLASSES_ROOT\Directory\Background\shell\nvim-qt]
@="Open Neovim-Qt here"
"Icon"="\"C:\\Program Files\\Neovim\\bin\\nvim-qt.exe\""

[HKEY_CLASSES_ROOT\Directory\Background\shell\nvim-qt\command]
@="\"C:\\Program Files\\Neovim\\bin\\nvim-qt.exe\" \"%v\""


;; NeoVim

[HKEY_CLASSES_ROOT\*\shell\nvim]
@="Edit with Neovim"
"Icon"="\"C:\\Program Files\\Neovim\\bin\\nvim-qt.exe\""

[HKEY_CLASSES_ROOT\*\shell\nvim\command]
@="wt -p \"Windows PowerShell\" --title Neovim C:\\Program Files\\Neovim\\bin\\nvim.exe \"%1\""

[HKEY_CLASSES_ROOT\directory\shell\nvim]
@="Open with Neovim"
"Icon"="\"C:\\Program Files\\Neovim\\bin\\nvim-qt.exe\""

[HKEY_CLASSES_ROOT\directory\shell\nvim\command]
@="wt -p \"Windows PowerShell\" --title Neovim C:\\Program Files\\Neovim\\bin\\nvim.exe \"%v\""

[HKEY_CLASSES_ROOT\directory\background\shell\nvim]
@="Open Neovim here"
"Icon"="\"C:\\Program Files\\Neovim\\bin\\nvim-qt.exe\""

[HKEY_CLASSES_ROOT\directory\background\shell\nvim\command]
@="wt -p \"Windows PowerShell\" --title Neovim C:\\Program Files\\Neovim\\bin\\nvim.exe \"%v\""

@dnery
Copy link

dnery commented Dec 4, 2023

Thanks for tips, worked like a charm for me! Setting the icon in Windows 11 did not work, however... Did anyone face any issues as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment