This repository contains my Neovim configuration files. Feel free to use it for any task! If you have any questions, you can open an issue or contact me via the links/email in the profile.
- Install nvim
- Clone this repository:
git clone https://github.com/LaGGgggg/nvim-config ~/.config/nvim - Use your new Neovim!
nvim
├───init.lua # main Neovim entry point
├───lazy.lock # lazy.nvim plugin versions
├───colors # color schemes
│ └───...
└───lua # main directory for lua config files
├───colors # color schemes additional info
│ └───...
├───plugins # plugin settings
│ └───...
└───config # main configs directory
├───lazy.lua # lazy.nvim entry point
├───options.lua # Neovim's global options overrides
├───inits # Neovim's autocmds
│ └───...
├───keymaps # keymaps overrides
│ └───...
├───lsp # LSP configurations
│ └───...
└───statuslines # Neovim's statusline overrides
└───...
init.lua file is Neovim's entry point. In this file I enable all required configurations.
My init.lua does not have any strict format, but I prefer to use only require(...) lines and
comments in it.
If you want to disable/enable something, you should change this file. To disable, for example,
a keymap configuration file, just remove the corresponding require(...).
I use lazy.nvim as a plugin manager. It will be installed automatically on Neovim startup if it is not installed yet. All plugins will be installed automatically too.
I use default lazy's configuration except that checker option is off and lazy does not
automatically check for plugin updates. I update my plugins manually when needed.
Any plugin can have configured options inside its spec. See the file if you want to see/change
something. Inside a spec, default plugin key mappings can be overwritten, but all its overrides
live inside the lua/config/keymaps directory.
All plugins are loaded from the lua/plugins directory:
lua/plugins
├───main_spec.lua
├───autocomplete_spec.lua
├───lsp_spec.lua
├───git_spec.lua
├───github_copilot_spec.lua
└───wakatime_spec.lua
This spec loads all my must-have plugins.
Allows you to easily and very fast find any file or text in any file. It also allows searching across registers, marks, buffers and much much more.
Builds a beautiful and feature-full tree view of a pwd.
Displays a character as the colorcolumn. Useful to always see max allowed line length.
Automatically saves file changes.
Easily comment/uncomment selected code.
This spec loads all plugins required to provide code completion.
A completion engine with enabled buffer, path and cmd line completions. This plugin will work with any configured LSPs.
Provides enhanced code parsers and is used by many other plugins. Enabled languages can be changed in the spec.
This spec loads cmp-nvim-lsp plugin, which is required to use LSPs.
This spec loads gitsigns plugin, which shows git changes inline.
This spec loads copilot-lua plugin, which is used to interact with GitHub Copilot inside Neovim.
This spec loads vim-wakatime plugin to track your coding time.
All LSP config files are listed inside the lua/config/lsp directory. I write in many
languages, so I have a lot of LSP configs. All configs are defined in the same way with the same
structure.
Example of a config:
vim.lsp.config('clangd', {
-- a table of LSP file types
filetypes = { 'c', 'cpp', 'objc', 'objcpp', 'cuda' },
-- a function, which will be executed when the LSP attaches to a buffer
on_attach = function()
-- apply default LSP keymaps
require('config.keymaps.lsp')()
end,
})
-- enable configured LSP
vim.lsp.enable('clangd')Supported LSPs can be found here.
Now I use these LSPs:
- C-based: clangd
- JavaScript/TypeScript: ts_ls
- Lua: lua_ls
- Python: ruff and pyright
- Rust: rust_analyzer
- Tailwind CSS: tailwindcss
- Vue.js: vue_ls
My color scheme is inspired by Alabaster:
Most color themes highlight everything they can, ending up looking like a fireworks show. Instead, Alabaster uses minimal highlighting; it defines just four classes:
- Strings
- All statically known constants (numbers, symbols, user-defined keywords, boolean values)
- Comments
- Global definitions
My version at the moment does not have the fourth class at all and uses different colors for other classes. Strings and constants just use brighter colors, comments are yellow instead of red. Also my version changes all Neovim's inline diagnostic message colors to normal white.
All colors can be found in lua/colors/alabaster_by_lagggggg/colors.lua. All global highlight groups can be found in colors/alabaster_by_lagggggg.lua.
In the lua/config/inits/colorscheme.lua the
alabaster_by_lagggggg scheme is applied.
Also inside this file my custom markdown highlight groups are defined and set as an autocmd for
markdown files, more info about it.
I list my to-dos inside a markdown file and edit it with Neovim, so I need some more highlights for this use case.
Matches:
!!-markdown_extended.priority\\d\\d-markdown_extended.date!!\\d\\d-markdown_extended.priority_date
Highlights:
- All headings are not bold
markdown_extended.priority,markdown_extended.priority_dateare bold, italic and use the comment colormarkdown_extended.dateis bold and uses the comment color
Documentation work in progress..
Documentation work in progress..
Documentation work in progress..
Documentation work in progress..
To enable Django types support, you can use django-stubs. Just install it and types should already work, no additional configuration is needed.
Documentation work in progress..