nvim-from-scratch
nvim-from-scratch copied to clipboard
π οΈ Ready to use starting point for your new Neovim configuration
Neovim from Scratch
This is a starter Neovim configuration meant to act as a jumping-off point for new Neovim users or those who have declared config bankruptcy.
Why?
Neovim is a fantastic source code editor out of the box, but with a little help can provide a truly feature-rich development environment that matches (or exceeds) alternative offerings.
The leg work involved in going from a blank init.lua
to a useful daily driver
can be intimidating. This repo provides a handy starting point so that you can
begin using Neovim right away while building your own Personalized Development
Environment.
Getting started
Clone the project into your $XDG_CONFIG_HOME directory (usually ~/.config
)
as nvim
:
git clone https://github.com/ngscheurich/nvim-from-scratch ~/.config/nvim
The next time you launch Neovim, the configuration will be applied and the plugin manager should start doing its thing.
Requirements
This config has only been tested with Neovim 0.8.2 and higher.
Youβll also need to have fd and ripgrep; these help improve the fuzzy finding experience. Homebrew users can install these with:
brew install ripgrep fd
Whatβs included
The core Neovim experience is configured with sensible settings and examples of key mappings, autocommands, and abbreviations are included.
Additionally, a handful of plugins are configured to augment the user interface, tap into powerful features like the native LSP client and tree-sitter integration, and extend Neovimβs already powerful text editing capabilities.
Files are organized in a way that makes things succinct and easy to find:
~/.config/nvim
βββ init.lua
βββ lua
βββ config
βΒ Β βββ abbrevs.lua
βΒ Β βββ commands.lua
βΒ Β βββ keymaps.lua
βΒ Β βββ options.lua
βββ plugins
βββ init.lua
βββ ...
Plugins
lazy.nvim is used for plugin management. You can learn more about the plugin
manager and configuration options with :h lazy.nvim
.
Editing
Plugins for more effortless text editing.
- echasnovski/mini.align: Interactively align text
- echasnovski/mini.comment: Comment/uncomment lines and ranges
- echasnovski/mini.pairs: Automatically insert the latter half of character pairs
- tpope/vim-surround: Text objects based on quotes, parens, etc.
Interface
Plugins that extend or improve the Neovim terminal user interface (TUI).
- nvim-lualine/lualine.nvim: Enhance the statusline
- folke/todo-comments.nvim: Highlight, list, and search TODO comments
- folke/tokyonight.nvim: A rich colorscheme with great plugin support
- folke/which-key.nvim: Key hints in a pop-up buffer
Navigation
Plugins for efficiently moving through and between files.
- andymass/vim-matchup: Extend % to operate on language keywords
- folke/trouble.nvim: Handy list for diagnostics, search results, quickfix, etc.
- ggandor/leap.nvim: Precision movement to visible locations
- justinmk/vim-dirvish: Fast, convenient directory viewer
- nvim-telescope/telescope.nvim: Generic fuzzy finder over lists, with some useful built-ins
- nvim-tree/nvim-tree.lua: File explorer sidebar
Syntax
Plugins that help Neovim understand different programming languages.
- sheerun/vim-polyglot: A collection of language packs that get loaded on demand
Code Intelligence
Plugins that enable a rich source code editing experience.
- folke/neodev.nvim: Configures environment for Neovim config and plugin development
- neovim/nvim-lspconfig: Collection of quick-start language server configurations
- nvim-treesitter/nvim-treesitter: Interface to and features around tree-sitter
- nvim-treesitter/playground: View and interact with tree-sitter AST
- williamboman/mason.nvim: Install and update binaries for LSP, DAP, linting, and formatting
- williomboman/mason-lspconfig.nvim: Bridge the gap between mason.nvim and nvim-lspconfig
Completion and Snippets
Plugins that save time and provide intelligent insert mode completion.
- L3MON4D3/LuaSnip: Lua-based snippet engine
- hrsh7th/cmp-buffer: Completion source for buffer words
- hrsh7th/cmp-nvim-lsp: Completion source for Neovim LSP client
- hrsh7th/nvim-cmp: Completion system
- saadparwaiz1/cmp_luasnip: Completion source for LuaSnip
Source Control
Plugins that integrate with source sontrol systems.
- lewis6991/gitsigns.nvim: Buffer-level Git integration
- tpope/vim-fugitive: Wrapper for running arbitrary Git commands
Miscellaneous
Plugins that don't neatly fit into any other category.
- NvChad/nvim-colorizer.lua: Highlight color strings
- tpope/vim-rsi: Readline bindings for insert and command line mode
- tpope/vim-unimpaired: Handy bracket-based mappings for paired commands
What next?
This is meant to be a starting point! Once youβre comfortable, here are some ways you might start making it your own:
- Try out a new colorscheme
- Define some additional keymaps
- Test out some more built-in Telescope pickers
- Write some new snippets
And of course, donβt be afraid to explore the Neovim plugin ecosystem!
Development
A Dockerfile is included to simplify manually testing changes. Build the
Docker image with make build
.
Now running make
will drop you into a Debian container with the latest stable
nvim
available. Any changes made to the config files will be reflected in the
container.
See also
- Folke Lemaitreβs well-organized and thorough dotfiles were heavily referenced, and lots of his plugins are included. Thanks, Folke!
- Kickstart.nvim is another great starting point for your configuration.
- The name of this project was inspired by Emacs from Scratch.