This is MysticalDevil's neovim config, containing some commonly used plugins and custom configs
This config mainly uses lazy.nvim
for plugin management
The code editing configuration here mainly targets go, rust, javascript, typescript, lua, with basic nvim-lsp functionality for other languages
-
Install neovim: I mainly use Arch, Gentoo, Debian for Linux, please check the official docs for other distros. Neovim version needs to be 0.10.0(nightly) or above, since inlay hints does not work properly before 0.10.0
# Arch sudo pacman -S neovim # Gentoo sudo emerge -vj app-editors/neovim # Debian sudo apt install neovim # Windows scoop install neovim # macOS brew install neovim
For Debian, it's recommended to build from source, since the latest neovim version in Debian official repo is 0.7.2. Build steps:
# Install necessary library sudo apt install git cmake ninja-build gettext unzip curl # Clone neovim repository git clone https://github.com/neovim/neovim.git # Enter neovim source directory cd neovim # Build neovim make CMAKE_BUILD_TYPE=RelWithDebInfo # Package as deb cd build && cpack -G DEB # Install sudo dpkg -i nvim-linux64.deb
-
Clone this repo:
git clone https://github.com/MysticalDevil/nvim ~/.config/nvim/
-
Open neovim to install plugins
Lazy install
If using pure lua config for neovim, all config files will be under ./lua
. So by default the root here means ./lua/devil
to avoid namespace collisions
init.lua
Entry file for pure lua configginit.vim
Additional config loaded when using GUI frontend, supportsneovide
andneovim-qt
configs/core
Core configs, includes basic options, keybindings, plugin list, custom commands, autocmds and core plugin setup for initial launchconfigs/colorscheme
Colorscheme configs, contains various themes, can switch viasetup.lua
configs/gui
GUI related configs like font, animations etcconfigs/plugin
Configs for most plugins, excluding completion, formatting, DAP, LSPplugins
Default installed plugins, separated into common(common.lua
), colorschemes(colorscheme.lua
), git(git.lua
) and programming(prog.lua
)complete
Completion plugins config, usingnvim-cmp
by default, withcoq_nvim
as alternative. Snippets provided byLuaSnip
, icons bylspkind
dap
Debug Adapter Protocol configs, powered bynvim-dap
format
Formatting configs, usingnone-ls.nvim
,conform.nvim
,formatter.nvim
andefm
as alternatives, configurable viasetup.lua
lint
Linting configs, usingnone-ls.nvim
,nvim-lint
andefm
as alternatives, configurable viasetup.lua
lsp
Language Server Protocol related configs, usingmason
for dependency management,nvim-lspconfig
andmason-lspconfig
for LSP setuputils
Common utils like global functions, generic configs etc
Main keybindings are in keybindings.lua
and which-key.lua
Some common bindings:
<leader>
is,
<leader>w + ...
Save file and derivatives (like save and quit)<leader>q + ...
Quit and derivatives (like force quit)Ctrl-j/k
Scroll down/up 5 linesCtrl-d/u
Scroll down/up 10 linesgcc/gcb
Quick commentsv
Vertical splitsh
Horizontal splitsc
Close currentso
Close othersAlt-h/j/k/l
Navigate between windowsts
New tabth/l/j/k
Tab navigatetc
Close tabZ
Open foldzz
Close foldLeader-f
Format code- Check keybindings config for more
Some major plugins used:
lazy.nvim
Plugin manager, simpler and faster thanpacker.nvim
, easy to configureonedark.nvim
Colorscheme, I really like the onedark theme, can be changed to othersbufferline.nvim
Tab pages like other editorsComment.nvim
Comment togglingdashboard-nvim
Fancier start screen, withproject.nvim
for quick project/file switchleap.nvim
Motion plugin, keys are-
and_
lualine.nvim
Statuslineneo-tree.nvim
File explorer, previouslynvim-tree.lua
noice.nvim
Notify, command line, floating windows etc, a bit unstablenvim-treesitter
Syntax highlighttelescope.nvim
Fuzzy finding, previewing, pickinggitsigns.nvim
Git integration
Main screen:
Code edit:
Contributions are welcome! Feel free to open PRs to add new plugins or modify existing config.