This is my old Neovim configuration for Windows (See: Neovim Github repo).
Here I used the Packer.nvim, plugin manager for Neovim.
Info: neovim/projects ==> @bfredl, @tjdevries, @mfussenegger, @folke, ...
init.lua
is the config entry point for terminal Nvim,
and ginit.vim
is the additional config file for GUI client of Nvim.
My GUI client of Nvim is neovim-qt.
You can find Neovim plugins on these sites: plugins
This config is only maintained for the latest nvim stable release. A starting point for my configuration is nvim-lua/kickstart.nvim.
nvim
├── after
│ └── plugin
│ ├── autocmd.lua
│ ├── commands.lua
│ ├── keymaps.lua
│ └── options.lua
│
├── doc\INSTALL.md
│
├── lua
│ ├── custom
│ │ ├── config\bufferline.lua, todocomments.lua, ...
│ │ └── plugins.lua
│ │
│ └──
│
├── plugin\packer_compiled.lua
│
├── templates\HowToTemplate.txt, py.tpl, ...
│
├── ginit.vim
├── init.lua
├── README.md
init.lua
: Main configuration file that call lua modules
nvim\lua\
Folder of lua modules, here reside all the Lua modules that needed.
See: where-to-put-lua-files
See doc here on how to install Neovim and Neovim dependencies.
Check where the config folder is:
:echo stdpath("config")
==> C:\Users\userName\AppData\Local\nvim
:echo stdpath("data")
==> C:\Users\userName\AppData\Local\nvim-data
Windows command shell:
echo %userprofile%
==> C:\Users\userName
echo %localappdata%
==> C:\Users\userName\AppData\Local
Windows command shell: help XCOPY
/S Copy folders and subfolders
/H Copy hidden and system files and folders (default=N)
-
Backup your previous configuration (show hidden files and folders)
XCOPY %LOCALAPPDATA%\nvim\* nvim\ /S /H
and (if you want) archive "nvim-data" folder withzip
archiver
( orXCOPY %LOCALAPPDATA%\nvim-data\* nvim-data\ /S /H
) -
Delete folders "nvim" and "nvim-data"
( Delete file "packer_compiled.lua":DEL %LOCALAPPDATA%\nvim\plugin\packer_compiled.lua
)
Delete folder "nvim":RD %LOCALAPPDATA%\nvim\
Delete folder "nvim-data":RD %LOCALAPPDATA%\nvim-data\
-
Download this repo with git
git clone https://github.com/mlabrkic/dotfiles.git
-
Copy the "nvim" folder of this repo into
%LOCALAPPDATA%
XCOPY nvim\* %LOCALAPPDATA%\ /S /H
-
Start (1.) Neovim (nvim)
Ignore any error message about missing plugins!
==> Wait for: "packer.nvim - finished in" 463s (7,7 min)
Quit Neovim -:q(uit)
(press Enter) -
Start (2.) Neovim (nvim)
" ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'typescript', 'help', 'vim' },"
==> Wait for nvim-treesitter parsers to compile ( 1/9, 2/9, ... , 9/9).
...
[4/9] Treesitter parser fo lua has been installed.
...
Quit Neovim -:q(uit)
(press Enter)
If you want, install manually
:TSInstall java
:TSInstallInfo
Windows-support#troubleshooting
Various checks
Open a source file of one of the supported languages with Neovim, and run command "LspInfo" for testing the LSP support.
:LspInfo
:echo mapcheck('<F4>', 'n')
:echo hasmapto('set relativenumber!<CR>', 'n')
Open nvim and run command "checkhealth", you should not see any error in the output (except for the one related to the Python 2 interpreter if don't have it):
:checkhealth
-- Uncomment No_ 01:
-- use { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make', }
-- Uncomment No_ 02:
-- use { "folke/todo-comments.nvim",
-- requires = "nvim-lua/plenary.nvim",
-- config = [[require('plugins.todocomments')]], }
-- Uncomment No_ 03:
-- use {
-- "iamcco/markdown-preview.nvim", ft = { "markdown" },
-- run = "cd app && npm install",
-- config = [[require('plugins.v_markdown-preview')]],
-- }
Plugins can have post-install/update hooks (Packer.nvim.)
It is best to install them one by one!
Packer info:
-- You must run this (or PackerSync
) whenever you make changes to your plugin configuration:
-- Regenerate compiled loader file :PackerCompile
-- Remove any disabled or unused plugins :PackerClean
-- Clean, then install missing plugins :PackerInstall
-- Show list of installed plugins :PackerStatus
-- Loads opt plugin immediately :PackerLoad trouble.nvim
h packer.compile()
init.lua :
-- INFO: First install other plugins. After that uncomment this:
use { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make', }
To get fzf-native working, you need to build it with either cmake or make:
- CMake, and the Microsoft C++ Build Tools, or
- Make, and MinGW (gcc)(my choice)
( See doc here on how to install C compiler. )
Check this after installation:
Windows Command shell:
cd %LOCALAPPDATA%\nvim-data\site\pack\packer\start\telescope-fzf-native.nvim\
cd build
dir
==> libfzf.dll exist?
If libfzf.dll does not exist ...
A)
Check for "make" (in Neovim):
:echo executable("make")
or
:lua print(vim.fn.executable('make'))
Windows Command shell:
make -v
make -h
B) If you have "make":
Windows Command shell:
cd %LOCALAPPDATA%\nvim-data\site\pack\packer\start\telescope-fzf-native.nvim\
dir
make
C) If you don't have a "make":
Windows Command shell:
cd %LOCALAPPDATA%\nvim-data\site\pack\packer\start\telescope-fzf-native.nvim\
mkdir build
gcc -O3 -Wall -Werror -fpic -std=gnu99 -shared src/fzf.c -o build/libfzf.dll
-->
telescope-fzf-native.nvim\build\libfzf.dll
NOTE: If you want to uninstall this plugin later ...
-
First delete the "build" folder:
cd %LOCALAPPDATA%\nvim-data\site\pack\packer\start\telescope-fzf-native.nvim\
RD build\ -
Uninstall this plugin (Comment plugin in "init.lua", PackerCompile, PackerClean)
--------------
nvim\lua\plugins.lua :
-- Please make sure that you have installed node.js .
-- INFO: First install other plugins. After that uncomment this:
use {
"iamcco/markdown-preview.nvim", ft = { "markdown" },
run = "cd app && npm install",
-- requires = { "zhaozg/vim-diagram", "aklt/plantuml-syntax" },
config = [[require('plugins.v_markdown-preview')]],
}
- Open some markdown file.
- :MarkdownPreview (
nnoremap <A-m> :<C-U>MarkdownPreview<CR>
) - Wait cca 15 s.
If nothing happened after "MarkdownPreview" command ...
Nothing happened after "MarkdownPreview" command. No page opened in browser.
Check for errors :messages
Please make sure that you have installed node.js ( node --version
).
If there are errors, then uninstall the plugin, and repeat everything.
--------------
I use these plugins
- Plugin management via Packer.nvim.
- Code, snippet, word auto-completion via nvim-cmp.
- Language server protocol (LSP) support via nvim-lspconfig.
- Git integration via vim-fugitive.
- gitsigns - Super fast git decorations implemented purely in lua/teal
- Smarter and faster matching pair management (add, replace or delete) via vim-sandwich.
- Fast buffer jump via hop.nvim.
- Beautiful statusline via lualine.nvim.
- Show search index and count with nvim-hlslens.
- Command line auto-completion via wilder.nvim.
- Code highlighting via nvim-treesitter.
- Markdown writing and previewing via vim-markdown and markdown-preview.nvim.
- LuaSnip - Snippet Engine for Neovim written in Lua
- indentBlankline - Adds indentation guides to all lines (including empty lines)
- nvim-autopairs - A super powerful autopairs for Neovim
- ......
https://github.com/jdhao/nvim-config
https://github.com/brainfucksec/neovim-lua
:help lua-guide (large part taken from https://github.com/nanotee/nvim-lua-guide)
Lua in Y minutes - https://learnxinyminutes.com/docs/lua/
Lua Quick Guide - https://github.com/medwatt/Notes/blob/main/Lua/Lua_Quick_Guide.ipynb
( Lua 5.1 Reference Manual )
- Devlog | Build your first Neovim configuration in lua
- Devlog | Everything you need to know to configure neovim using lua
https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/windows-commands
https://ss64.com/nt/