This is my neovim configuration. Heavily inspired by kickstart.nvim.
-
git -
nvimv.0.11.0or above [INSTALL] -
cargo[INSTALL] -
npm[INSTALL] -
tree-sitter[INSTALL] -
(optional)
ripgrep[INSTALL] -
(optional)
fd[INSTALL] -
(optional)
fzf[INSTALL] -
(optional) A Nerd Font. If not installed then set
vim.g.have_nerd_font = falseininit.lua.
sudo pacman -S git neovim rust npm tree-sitter-cli ripgrep fd fzf# Required
mv ~/.config/nvim{,.bak}
# Recommended
mv ~/.local/share/nvim{,.bak}
mv ~/.local/state/nvim{,.bak}
mv ~/.cache/nvim{,.bak}
# Install
git clone https://github.com/czyrar/nvim.git ~/.config/nvimThe organization is as follows:
.
├── init.lua
├── lazy-lock.json
└── lua
├── autocmds.lua
├── keymaps.lua
├── options.lua
├── config
│ ├── linters.lua
│ └── lsp.lua
├── mappings
│ ├── formatters.lua
│ └── linters.lua
├── plugins
│ └── ...
└── themes
└── ...init.lua is a simple file which just bootstraps lazy.nvim (the package manager)
and includes the files in the rest of the paths.
lazy.lock fixes the versions of the packages. Feel free to delete it and update to new versions.
autocmds.lua include commands that execute when some action happen and are not related to any plugin.
In particular:
-
Highlight when yanking.
-
Disable features in big files:
- Disable Treesitter and LSP if filesize is bigger than 1MB.
- Disable all syntax highlighting is filesize is bigger than 10MB.
-
Help windows open in vertical.
options.lua sets my preferred defaults:
-
Show numbers (relative) and have them fixed (no LSP/git movement).
-
Do not wrap lines.
-
By default tabs are 2 spaces.
-
Mouse may be used.
-
Omit the mode (I prefer statusline).
-
Save undo history.
-
In general have case-insensitive search.
-
Set nice markers for whitecharacters and such.
-
Preview substitutions.
-
Highlight cursor line.
-
Keep 8 lines above and below cursor.
-
Confirm before closing without save.
keymaps.lua contains my keymaps which are independent of packages.
They are all properly commented.
In general all keymaps may be explored with :Telescope keymaps.
Contains two files. linters.lua holds custom configurations for different linters while
lsp.lua has custom configurations or overrides for LSP servers.
Contains two files. formatters.lua establishes a mapping between languages and formatters
that can be used. linters.lua offers the same but for linters.
Be free to expand them!
One file per plugin with one exception (see below). In the correspondig file at the beginning there is a description of what each plugin does:
-
saghen/blink.cmp: provides autocompletion and snippets (through dependencies). -
numToStr/Comment.nvim: better toggle comments. -
stevearc/conform.nvim: support for formatters. Adds two important commands::FormatDisable(!): disable autoformat (current buffer only if banged).:FormatEnable: reenable autoformat.
-
j-hui/fidget.nvim: beautiful notifications. -
lewis6991/gitsigns.nvim: git integration and hunk navigation. -
folke/lazydev.nvim: good LSP for Neovim configuration files. -
mfussenegger/nvim-lint: support for linters. -
nvim-lualine/lualine.nvim: status bar with style similar toechasnovski/mini.statusline. -
neovim/nvim-lspconfig: allow attachment to LSP servers. -
kylechui/nvim-surround: allows for surrounding operations. -
akinsho/nvim-toggleterm.lua: simple terminal split with REPL-like functionality. -
stevearc/oil.nvim: edit filetrees as if they were a simple file. -
MeanderingProgrammer/render-markdown.nvim: render markdown in normal mode. -
wellle/targets.vim: better textobjects with aliases. -
nvim-telescope/telescope.nvim: fuzzy finder for many things. -
folke/todo-comments.nvim: highlight important comments. -
nvim-treesitter/nvim-treesitter: treesitter queries and highlight. Includes submodules:nvim-treesitter/nvim-treesitter-context: provides context in the upper part of the screen.nvim-treesitter/nvim-treesitter-textobjects: provides textobjects for the language in buffer.
-
Wansmer/treesj: wrap/unwrap nested code. -
folke/which-key.nvim: show help on what keybind are defined.
Where purely theme plugins are located. They are loaded first of all.
To change theme edit the colorscheme variable at the start of init.lua.