Skip to content

Instantly share code, notes, and snippets.

@AMZN-alexpete
Last active October 19, 2023 17:17
Show Gist options
  • Save AMZN-alexpete/a0a1e3f93a882e529cc1e64f01880dae to your computer and use it in GitHub Desktop.
Save AMZN-alexpete/a0a1e3f93a882e529cc1e64f01880dae to your computer and use it in GitHub Desktop.
Windows NVIM-Qt setup

choco install neovim

To make nvim-qt appear in Windows searches, add a shortcut to it named nvim-qt in C:\Users\%USER%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs e.g. to the path C:\tools\neovim\nvim-win64\bin\nvim-qt.exe working directory: C:\tools\neovim\nvim-win64\bin

.registry file contents to add shortcuts:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\nvim-qt]
@="Open Neovim"
"Icon"="\"C:\\tools\\neovim\\nvim-win64\\bin\\nvim-qt.exe\""

[HKEY_CLASSES_ROOT\*\shell\nvim-qt\command]
@="\"C:\\tools\\neovim\\nvim-win64\\bin\\nvim-qt.exe\" \"%1\""

[HKEY_CLASSES_ROOT\Directory\shell\nvim-qt]
@="Open Neovim Here"
"Icon"="\"C:\\tools\\neovim\\nvim-win64\\bin\\nvim-qt.exe\""

[HKEY_CLASSES_ROOT\Directory\shell\nvim-qt\command]
@="\"C:\\tools\\neovim\\nvim-win64\\bin\\nvim-qt.exe\" \"%1\""

[HKEY_CLASSES_ROOT\Directory\Background\shell\nvim-qt]
@="&Neovim here"
"Icon"="\"C:\\tools\\neovim\\nvim-win64\\bin\\nvim-qt.exe\""

[HKEY_CLASSES_ROOT\Directory\Background\shell\nvim-qt\command]
@="\"C:\\tools\\neovim\\nvim-win64\\bin\\nvim-qt.exe\" \"%v\"

Install Vim-Plug https://github.com/junegunn/vim-plug

modify ~/AppData/Local/nvim/init.vim to include plugins

source $VIMRUNTIME/mswin.vim

call plug#begin()

" if you add more plugins don't forget to run 
" :source %
" :PlugInstall
"
" A git wrapper
Plug 'tpope/vim-fugitive'

" Solarized color theme
Plug 'lifepillar/vim-solarized8'

" A tree explorer plugin
Plug 'scrooloose/nerdtree'

" lean & mean status/tabline
Plug 'vim-airline/vim-airline'
" Airline themes, changes with :AirlineTheme
Plug 'vim-airline/vim-airline-themes'

call plug#end()


" key binds for NERDTree
nnoremap <leader>n :NERDTreeFocus<CR>
nnoremap <C-n> :NERDTree<CR>
nnoremap <C-t> :NERDTreeToggle<CR>
nnoremap <C-f> :NERDTreeFind<CR>

syntax enable
set background=dark
colorscheme solarized8

let g:AirlineTheme='base16_solarized_dark'

" Automatically change to the opened file's location
set autochdir

set shiftwidth=4
set expandtab
set ts=4
set backspace=indent,eol,start
set statusline=%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P
set number

" Default to starting in the current working director
augroup cdpwd
    autocmd!
    autocmd VimEnter * cd ~
augroup EN

Reload .vimrc and :PlugInstall to install plugins.

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