A minimal setup for Neovim - your personal development environment!
This repository should allow for a quick, easy and unbloated setup for neovim with sane presets. The main goal is to help beginners get quickly into neovim configuration.
The following plugins and features come preinstalled:
- Neotree file browsing and all dependencies
- Treesitter for highlighting
- Null-ls to setup formatters, linters and spellchecker
- LSP (Language Server Protocol)
- LuaSnip snippet engine to add custom snippets and/or enable snippet collections
- FriendlySnippets snippet collection used by LuaSnip
- TabNine AI assistent for additional suggestions for Compe
Plugins are managed by Packer. On first launch of neovim,
packer will install itself. Afterwards, you can use the command PackerInstall
, to install all predefined plugins.
As an alternative, PackerSync
runs after each save of /plugin/init.lua.
As an entrypoint for LSP and Null-ls, the sumneko-lua-language-server and
stylua are predefined with this setup.
The language server will be installed after the first launch of neovim as a result of defining
it inside the ensure_installed
property in after/plugin/lsp/setup.lua. Stylua needs
to be installed manually. See the github repo for more details. Once the formatter is installed, lua files are being
formatted upon saving the file. You can change the formatter options in the stylua.toml
configuration file.
Before you follow the installation process you may want to backup your existing nvim configuration. The following installation steps will otherwise overwrite them.
Clone the repository to $HOME/.config
cd ~/.config
git clone https://github.com/olekatpyle/barebones-nvim.git nvim
Run the command checkhealth
in commandmode, to identify any unsatisfied dependencies or misconfigurations
(in general, it is a good idea to run this command every now and then.).
-
WhichKey displays possible key bindings of the command you started typing
-
A theme if you get annoyed by the barebones look. A good place to look for themes -> Vim Color Schemes
- most theme repositories will give you detailed explanation on how to enable the theme inside your setup
- in general as an example:
" inside /lua/barebones/options.lua vim.cmd([[..]]) colorscheme gruvbox-baby
This setup has the following files tree:
nvim
├── after
│ ├── ftplugin
│ └── plugin
│ └── lsp
│ └── setup.lua
├── ftdetect
├── init.lua
├── lua
│ └── barebones
│ ├── keys.lua
│ ├── lsp
│ │ └── on_attach.lua
│ └── options.lua
├── plugin
│ ├── cmp.lua
│ ├── init.lua
│ ├── luasnip.lua
│ ├── mason.lua
│ ├── neotree.lua
│ ├── null.lua
│ ├── tree-sitter.lua
├── stylua.toml
└── undodir
In general there are five important directories to understand when it comes to configuring neovim.
Contains lua files that are being loaded at startup of neovim. This is the place where you want to set your options for the editor, configure your keymaps aswell as other lua code, that needs to be loaded at start, i.e custom functionalities for your setup.
Contains the packer init.lua to specify, which plugins to install. Further, the directory is being used to define plugin specific configuration files, where the call to the plugins setup-function is being made (most plugins need to be initialized with this call). Inside the setup-function, you can configure native settings for the plugin. If you want to add your own plugins, this is a good place to do so.
If you have filetype specific plugins - i.e a plugin, that is only used with lua files - you should put the configuration file (like the ones in /plugin) inside this directory. This has the advantage, that the modules defined inside /ftplugin are only being loaded, when you open a file of the specific filetype, making the editor more performant.
Inside /ftdetect you may put modules, that help you detect filetypes. Since there are some niche filetypes cruising around, neovim may not detect them.
If you want to expand functionalities of plugins, you want to put those changes inside this directory. This makes sure, that instead of replacing the native plugin, you add to it.
All options for the editor are set in /lua/barebones/options.lua. The comments for each option should be sufficient. Of course, if you need a detailed explanation, use the built-in help system in commandmode:
:h <option_you_need_help_for>
If more information is needed, something is unclear or something is not working correctly, please file an issue and feel free to ask. PROST!